This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Make it easier to spot if sources were resolved in crashlog output
ClosedPublic

Authored by JDevlieghere on Jun 13 2023, 9:30 PM.

Details

Summary

It can be tricky to troubleshoot why the crashlog script can't show inline sources. The two most common causes are that we couldn't find the dSYM or, if we find the dSYM, that the path remapping included in the dSYMForUUID output isn't correct. The former is relatively easy to diagnose thanks to the messages printed by the crashlog script. The latter is harder, because you have to figure out the remapped source path. This patch tries to make it easier to diagnose the second issue by including whether the path in the source remapping is accessible. If at least one of the paths exists, we consider the image to have sources, and include that in the symbol resolution output.

Example output:

Resolved symbols and sources for 11111111-2222-3333-4444-555555555555 /path/to/foo
Resolved symbols for 66666666-7777-8888-9999-AAAAAAAAAAAA /path/to/bar

Diff Detail

Event Timeline

JDevlieghere created this revision.Jun 13 2023, 9:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2023, 9:30 PM
JDevlieghere requested review of this revision.Jun 13 2023, 9:30 PM
JDevlieghere edited the summary of this revision. (Show Details)
mib added inline comments.Jun 13 2023, 9:36 PM
lldb/examples/python/crashlog.py
342–345
346

I guess that checks that the user have access to the remapped path, is that right ?

If that's not the case, I think we should let the user know

JDevlieghere added inline comments.Jun 14 2023, 9:25 AM
lldb/examples/python/crashlog.py
346

Yeah, that's exactly right. We do let the user know by including or emitting "and sources" in the symbol resolution print. Currently we print the "and sources" when at least one of the remapped paths is accessible. We could change this to only print it when all the paths are accessible. We could also change the message the say "and could not find sources" when a path remapping is present but the paths are not accessible.

mib added inline comments.Jun 14 2023, 10:10 AM
lldb/examples/python/crashlog.py
346

It think it would be clearer for the user if we said something like "couldn't access remapped source path (path/to/source)"

JDevlieghere marked 2 inline comments as done.

Make the warning its own line

mib accepted this revision.Jun 14 2023, 4:51 PM

LGTM! Thanks!

This revision is now accepted and ready to land.Jun 14 2023, 4:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2023, 5:25 PM