While C++ base classes are registered with CreateBaseClassSpecifier(), we have to use SetObjCSuperClass() for ObjC. The isa member of NSObject is a zero-length UDT. Special handling for ObjC id type will be added in one of the next patches.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I don't know anything about Objective C internals, perhaps you can provide some reference that talks about this?
lldb/test/Shell/Expr/objc-gnustep-print-pdb.m | ||
---|---|---|
44 | Could you use label in the source so you don't have to update this line number each each time? I forget if labels are included in the debug info. In the python tests we have this more heavyweight thing that searches for a particular comment to find the line. |
Honestly, I am mostly looking what the DWARF parser does and try to mimic it in PDB. I haven't done much research for a formal reference. My impression is that the implementation is the reference here. (Please correct me if I am wrong!)
Yeah, let's wait and see if I get feedback from ObjC and PDB maintainers.
lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp | ||
---|---|---|
349 | Maybe this is ok without a dedicated language type check? IIUC the worst thing that could happen, in case we really have zero-length types with such names in C++ code, is a small performance drop. BTW the reference for this seems to be: https://github.com/llvm/llvm-project/blob/release/16.x/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp#L709-L710 😄 | |
lldb/test/Shell/Expr/objc-gnustep-print-pdb.m | ||
44 | It's a minor effort on my side to update the line number and it's solid. We cannot break on ok, since the function name doesn't get parsed with a correct basename yet. Main would work, but it doesn't seem more readable: -o "b main" -o "n" -o "n"
If possible I'd like to stay away from the Python tests. I don't think we need their advanced features. lit is a lot easier for me (and more widespread in LLVM). | |
68 | With this change we get base class and the member offsets right (all are zero-initialized). |
lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp | ||
---|---|---|
399 | Does it make sense to drop a note here that the 0-length UDT is used as a marker for the NSObject root? Although, shouldn't NSObject's isa be NSObject? Or does GNUStep not do that? |
Maybe this is ok without a dedicated language type check? IIUC the worst thing that could happen, in case we really have zero-length types with such names in C++ code, is a small performance drop.
BTW the reference for this seems to be: https://github.com/llvm/llvm-project/blob/release/16.x/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp#L709-L710 😄