This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Flesh out STABS implementation
ClosedPublic

Authored by int3 on Nov 30 2020, 10:29 PM.

Details

Reviewers
clayborg
Group Reviewers
Restricted Project
Commits
rG78f6498cdcdb: [lld-macho] Flesh out STABS implementation
Summary

This addresses a lot of the comments in D89257: [lld-macho] Emit STABS symbols for debugging, and drop debug sections. Ideally it'd have been
done in the same diff, but the commits in between make that difficult.

This diff implements:

  • N_GSYM and N_STSYM, the STABS for global and static symbols
  • Has the STABS reflect the section IDs of their referent symbols
  • Ensures we don't fail when encountering absolute symbols or files with no debug info
  • Sorts STABS symbols by file to minimize the number of N_OSO entries

Diff Detail

Event Timeline

int3 created this revision.Nov 30 2020, 10:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 30 2020, 10:30 PM
int3 requested review of this revision.Nov 30 2020, 10:30 PM
clayborg added inline comments.Nov 30 2020, 11:05 PM
lld/MachO/SyntheticSections.cpp
653–654

You shouldn't need this because of lines 634 and 635 skips adding absolute symbols to symbolsNeedingStabs

676

Is this going to always work for all functions? This really needs to be bullet proof or dsymutil and lldb won't be able to find functions for this symbol.

int3 marked 2 inline comments as done.Dec 1 2020, 2:09 PM
int3 added inline comments.
lld/MachO/SyntheticSections.cpp
653–654

ah yeah, copypasta mistake

676

Addressed here: D92430

int3 updated this revision to Diff 308768.Dec 1 2020, 2:09 PM
int3 marked 2 inline comments as done.

address comment

clayborg accepted this revision.Dec 1 2020, 2:36 PM
This revision is now accepted and ready to land.Dec 1 2020, 2:36 PM
This revision was landed with ongoing or failed builds.Dec 1 2020, 3:05 PM
This revision was automatically updated to reflect the committed changes.