Created attachment 6070 [details] Test case When setting a breakpoint at a constructor, I cannot "print" an argument because gdb doesn't get its address correct. See attached. It may be useful to note that it works properly at a class method (as opposed to the constructor). gcc (Debian 4.5.3-1) 4.5.3 GNU gdb (GDB) 7.3-debian
This bug still affects gdb 7.9 - See this stack overflow thread: http://stackoverflow.com/questions/8980566/gdb-reports-wrong-address-for-parameter-in-c-objects-constructor#comment46681158_8980566
Addendum: clang++ -gdwarf-4 creates a binary that gdb debugs correctly, so maybe this is a gcc bug?
(In reply to Phil Armstrong from comment #2) > Addendum: clang++ -gdwarf-4 creates a binary that gdb debugs correctly, so > maybe this is a gcc bug? I can reproduce this problem when compiling with gcc up to version 8, but it works fine for me with gcc 9, so I guess you were right that this was a gcc bug (but I don't know which one).