[clang] [llvm] [clang][DebugInfo] Add symbol for debugger with VTable information. (PR #130255)
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon May 12 07:47:44 PDT 2025
dwblaikie wrote:
> > Uploaded a patch that eliminates the global variable and it moves the vtable information into the static member; in that way, a consumer always will have access to the vtable information, just by having the object instance or the object definition.
>
> IIUC this means that to see the vtable for a class, the debugger has to scan the class declaration itself -- the vtable isn't a separate CU-level global variable but is instead a static member of the class.
>
> This approach won't work well for gdb. gdb tries not to scan DIEs that it does not need, in order to improve startup times. In particular it tries not to scan function bodies until necessary.
My intent (haven't checked the patch) is that it'd be modeled as a static member variable - so there'd be a declaration in the class, but a definition DIE outside the class that'd be indexed by gdb OK, I'd have thought? (it'd go in .debug_names, and gdb_index, I think - figure gdb would parse/index the definition DIE?)
https://github.com/llvm/llvm-project/pull/130255
More information about the llvm-commits
mailing list