Why running the next command will jump back to the previous line position
Jan Kratochvil
jan.kratochvil@redhat.com
Sat Oct 29 07:42:00 GMT 2011
On Sat, 29 Oct 2011 09:11:25 +0200, asmwarrior wrote:
[...]
> This was quite strange, it looks like the instruction will return to some
> previous position. (I guess that the destructor of the "std::map" was
> called.
yes, objdump -dSC shows there:
std::map<int, std::string> m;
400bab: 48 8d 45 b0 lea -0x50(%rbp),%rax
400baf: 48 89 c7 mov %rax,%rdi
400bb2: e8 43 00 00 00 callq 400bfa <std::map<int, std::string, std::less<int>, std::allocator<std::pair<int const, std::string> > >::~map()>
400bb7: 89 d8 mov %ebx,%eax
> My question is: This behavior is quite anti-friendly,
Maybe GCC could produce there DW_LNS_negate_stmt so that the variable
declaration line is still shown in backtraces (if the destructor crashes) but
it is skipped over during stepping/nexting; but GDB currently would not show
such line in backtraces, GCC currently does not produce DW_LNS_negate_stmt
anyway.
Regards,
Jan
More information about the Gdb
mailing list