Description
Bugzilla Link | 14610 |
Version | trunk |
OS | Linux |
Blocks | #14702 llvm/llvm-bugzilla-archive#24345 |
CC | @DougGregor,@echristo |
Extended Description
Reduced from the GDB 7.5 test gdb.cp/mb-ctor.cc:
#include
struct Base {
~Base() {
printf("~Base\n");
}
};
struct Derived : virtual Base {
~Derived();
};
Derived::~Derived() {
printf("~Derived\n");
}
int main() {
Derived d;
}
breaking on "Derived::~Derived()" in GDB with Clang debug info causes this program to break twice. With GCC's debug info the program only breaks once.
From the DWARF dump it looks like Clang is emitting debug info (DW_TAG_subprogram and line table entries) for both the D1 and D2 version of the function, both with a DW_AT_specification of the DW_TAG_subprogram named "~Derived". I assume this is why GDB breaks twice.
I can't quite do a direct comparison to GCC & see which function it's emitted debug info for because it seems to have inlined the dtor call, even at -O0, so I can't match it to a particular exported symbol.