This is an archive of the discontinued LLVM Phabricator instance.

[llvm-symbolizer] Fix line offset for inline site.
ClosedPublic

Authored by zequanwu on Apr 5 2022, 12:20 PM.

Details

Summary

This fixes the issue when the current line offset is actually for next range.

Maintain a current code range with current line offset and cache next file/line
offset. Update file/line offset after finishing current range.

Diff Detail

Unit TestsFailed

Event Timeline

zequanwu created this revision.Apr 5 2022, 12:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2022, 12:20 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
zequanwu requested review of this revision.Apr 5 2022, 12:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2022, 12:20 PM
akhuang accepted this revision.Apr 5 2022, 4:38 PM

I think this looks good, although I don't entirely remember how these work-- what's the situation where the "current line offset is actually for next range"?

This revision is now accepted and ready to land.Apr 5 2022, 4:38 PM

what's the situation where the "current line offset is actually for next range"?

In the following example, It has the mapping:
[0x15, 0x20) -> 1
[0x20, 0x31) -> 2
[0x31, 0x3A) -> 3
[0x3A, 0x43) -> 4

If OffsetInFunc is 0x21, the original implementation exits the function after reading 5th line which updates line offset to 3 but it should be 2. line offset 3 is for next code range.

0602      line 1 (+1)
0315      code 0x15 (+0x15)
0B2B      code 0x20 (+0xB) line 2 (+1)
0602      line 3 (+1)
0311      code 0x31 (+0x11)
0B29      code 0x3A (+0x9) line 4 (+1)
0409      code end 0x43 (+0x9)

Oh, I see, looks good then!

This revision was landed with ongoing or failed builds.Apr 7 2022, 3:18 PM
This revision was automatically updated to reflect the committed changes.