File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
lldb/source/Plugins/SymbolFile/DWARF Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -279,6 +279,22 @@ static const char *GetMangledOrStructorName(const DWARFDIE &die) {
279
279
}
280
280
281
281
static std::optional<std::string> MakeLLDBFuncAsmLabel (const DWARFDIE &die) {
282
+ const DWARFUnit *cu = die.GetCU ();
283
+ if (!cu)
284
+ return std::nullopt;
285
+
286
+ // FIXME: Workaround for when the declaration DIE for a method is in a
287
+ // type-unit. The definition DIE's specification points to the declaration DIE
288
+ // in the compile-unit, so if we encoded the DIE from the type-unit, the DIEs
289
+ // wouldn't match and the label decoder would error out.
290
+ if (die.IsMethod () && cu->IsTypeUnit ()) {
291
+ const char *mangled = die.GetMangledName (/* substitute_name_allowed=*/ false );
292
+ if (!mangled)
293
+ return std::nullopt;
294
+
295
+ return mangled;
296
+ }
297
+
282
298
const char *name = GetMangledOrStructorName (die);
283
299
if (!name)
284
300
return std::nullopt;
Original file line number Diff line number Diff line change @@ -2497,8 +2497,10 @@ llvm::Error SymbolFileDWARF::FindAndResolveFunction(
2497
2497
if (entry.GetAttributeValueAsUnsigned (llvm::dwarf::DW_AT_declaration, 0 ))
2498
2498
return true ;
2499
2499
2500
- // TODO: this specification check doesn't work if declaration DIE was in a
2501
- // type-unit (we should only encode DIEs from .debug_info).
2500
+ // FIXME: this specification check doesn't work if declaration DIE was in a
2501
+ // type-unit. We currently work around this by only creating the
2502
+ // LLDB function call labels when the declaration DIE was *not* in a
2503
+ // type-unit.
2502
2504
auto spec = entry.GetAttributeValueAsReferenceDIE (DW_AT_specification);
2503
2505
if (!spec)
2504
2506
return true ;
You can’t perform that action at this time.
0 commit comments