[clang] [llvm] [clang][DebugInfo] Add symbol for debugger with VTable information. (PR #130255)

Adrian Vogelsgesang via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 6 10:10:15 PDT 2025


vogelsgesang wrote:

Afaict, the issue is not that the address gets optimized out, but rather that we are setting `LineNo` to 0:

```
      DBuilder.createGlobalVariableExpression(
          TheCU, SymbolName, VTable->getName(), Unit, /*LineNo=*/0,
          getOrCreateType(VoidPtr, Unit), VTable->hasLocalLinkage(),
          /*isDefined=*/true, nullptr, DT, /*TemplateParameters=*/nullptr,
          PAlign);
```

I think this can be solved by setting the line number to the line number of, e.g., the `class` / `struct` keyword or the line number of the class name, or whatever is easily available

https://github.com/llvm/llvm-project/pull/130255


More information about the llvm-commits mailing list