gdb fails to unroll stack for backtrace command

Sat Feb 1 09:13:00 GMT 2014

I am seeing gdb not unrolling stack properly where it is possible. In my 
case, libexecinfo unrolls stack fine at the same point (see log below). 
And gdb fails at the same function.

Correct stack would be:
0x5deac6 Xxxxxx::xxxxxxxxx
0x260b0062 HelloWorld::main::Xxxx
0x000000080824b4bf in gggg::Fffffffff::zzzzzzzzz

gdb shows some wrong locations after Xxxxxx::xxxxxxxxx, and then fails 
after gggg::Fffffffff::zzzzzzzzz.
Why can't it just unroll the same way as libexecinfo?

---gdb failure log---
Breakpoint 1, Xxxxxx::xxxxxxxxx () at xxxx.C:22
(gdb) bt
#0  Xxxxxx::xxxxxxxxx () at xxx.C:22
#1  0x00000000260b0062 in ?? ()
#2  0x00000000260b0050 in ?? ()
#3  0x00000008020bca80 in ?? ()
#4  0x00007fffffffa470 in ?? ()
#5  0x000000080824b4bf in gggg::Fffffffff::zzzzzzzzz (fn_ptr=0x260b0062, 
xarg=0x260b0050) at hh.C:731
Backtrace stopped: frame did not save the PC

---libexecinfo successful log---
   0x5df195 <_ZN6CommonlsERSoRKNS_9BackTraceE+21> at myapp
   0x5deac6 <_ZN6Xxxxxx9xxxxxxxxxEv+22> at myapp
   0x260b0062 <_ZN10HelloWorld4mainEP4Xxxx+18>
   0x80824b4bf <_ZN4gggg9Fffffffff10zzzzzzzzzzEPvS1_+98> at
   0x6b4e87 <some func+103> at myapp
  <...unrolls ok all the way to main...>

gdb-7.6.2 on FreeBSD 9.2

More information about the Gdb mailing list