This is an archive of the discontinued LLVM Phabricator instance.

Don't emit apple accelerator tables on non-darwin targets
ClosedPublic

Authored by labath on Jan 12 2018, 5:01 AM.

Details

Summary

Currently -glldb turns on emission of apple tables on all targets, but
lldb is only really capable of consuming them on darwin. Furthermore,
making lldb consume these tables is not straight-forward because of the
differences in how the debug info is distributed on darwin vs. elf
targets.

The darwin debug model assumes that the debug info (along with
accelerator tables) will either remain in the .o files or it will be
linked into a dsym bundle by a linker that knows how to merge these
tables. In the elf world, all present linkers will simply concatenate
these accelerator tables into the shared object. Since the tables are
not self-terminating, this renders the tables unusable, as the debugger
cannot pry the individual tables apart anymore.

It might theoretically be possible to make the tables work with split
dwarf, as that is somewhat similar to the apple .o model, but
unfortunately right now the combination of -glldb and -gsplit-dwarf
produces broken object files.

Until these issues are resolved there is no point in emitting the apple
tables for these targets. At best, it wastes space; at worst, it breaks
compilation and prevents the user from getting other benefits of -glldb.

Diff Detail

Repository
rL LLVM

Event Timeline

labath created this revision.Jan 12 2018, 5:01 AM
aprantl requested changes to this revision.Jan 12 2018, 8:48 AM
aprantl added inline comments.
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
293 ↗(On Diff #129603)

I'm not sure isDarwin is the right condition for this. Can you check for isMachO instead? I'm afraid that this would break LLDB for embedded use-cases otherwise.

This revision now requires changes to proceed.Jan 12 2018, 8:48 AM

I'm still cautiously optimistic that we will get DWARF5 accelerator tables in the near future, which will hopefully make this problem disappear.

labath updated this revision to Diff 129827.Jan 15 2018, 3:25 AM

s/isdarwin/ismacho, as requested.

I'm still cautiously optimistic that we will get DWARF5 accelerator tables in the near future, which will hopefully make this problem disappear.

Do you know if anyone is working (or planning to) on that? I have that on my todo list for this year, and I've started making some experiments with it. It would be good to sync up to avoid duplicating work..

You should sync up with @JDevlieghere. It would be awesome if we could collaborate on this.

aprantl accepted this revision.Jan 16 2018, 9:58 AM
This revision is now accepted and ready to land.Jan 16 2018, 9:58 AM
This revision was automatically updated to reflect the committed changes.