Bug 57487 - vterminate.cc local variable optimized out
Summary: vterminate.cc local variable optimized out
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-debug
Depends on:
Blocks:
 
Reported: 2013-05-31 19:31 UTC by Tom Tromey
Modified: 2021-08-30 03:04 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2013-05-31 19:31:59 UTC
I built git master gcc today (317121db1372a50999ab1cba75aa59df0f2eff7c)
using the default arguments on my x86-64 Fedora 18 machine.

Then I compiled this program with the new g++ and ran it in gdb:

int main()
{
  throw 5;
}

Then, at the crash, I went up until I was in the verbose terminate
handler frame.  At this point I looked at the locals:

#2  0x00007ffff7d59515 in __gnu_cxx::__verbose_terminate_handler ()
    at ../../../../gcc/libstdc++-v3/libsupc++/vterminate.cc:95
95	    abort();
(gdb) info local
terminating = true
t = <optimized out>


Here, it is unfortunate that 't' is optimized out.  If it were
not, then the thrown exception type would be obvious from the stack
trace.  As it is, this information is written to stderr but otherwise
lost -- for example, ABRT cannot easily pick it up.
Comment 1 Andrew Pinski 2013-05-31 19:34:56 UTC
>vterminate.cc

This is compiled with -O2 so this kinda expected to be optimized out.