This is an archive of the discontinued LLVM Phabricator instance.

[dwarfdump] Add support for -debug-line=OFFSET
ClosedPublic

Authored by JDevlieghere on Sep 25 2017, 7:47 AM.

Details

Diff Detail

Repository
rL LLVM

Event Timeline

JDevlieghere created this revision.Sep 25 2017, 7:47 AM
dblaikie accepted this revision.Sep 25 2017, 8:45 AM

Seems good

test/tools/llvm-dwarfdump/X86/debug_line_offset.test
1–11

I'd probably skip this test case? Or is there something interesting about the zero case?

This revision is now accepted and ready to land.Sep 25 2017, 8:45 AM
aprantl accepted this revision.Sep 25 2017, 9:16 AM

Without having checked out API yet — this is still traversing over all CUs to find the one with the entry. This could be slow for something like clang.dSYM. Is there a way to find the one CU containing the entry quicker? If not, this LGTM.

Without having checked out API yet — this is still traversing over all CUs to find the one with the entry. This could be slow for something like clang.dSYM. Is there a way to find the one CU containing the entry quicker? If not, this LGTM.

Except for the address byte size (for which other parts of the code use the hack below), we only need the offset.

uint8_t savedAddressByteSize = 0;
// FIXME: This seems sketchy.
for (const auto &CU : compile_units()) {
  savedAddressByteSize = CU->getAddressByteSize();
  break;
}

But that leaves us with the same issues as mentioned in D38237: we run into trouble when passing an invalid offset.

Okay then let's solve the "let's deal with invalid offsets gracefully" separately.

This revision was automatically updated to reflect the committed changes.