This is an archive of the discontinued LLVM Phabricator instance.

[lldb/crashlog] Expand crash report file path before parsing
ClosedPublic

Authored by mib on Jun 2 2023, 10:39 AM.

Details

Summary

This patch should fix a crash in the opening a crash report that was
passed with a relative path.

This patch expands the crash report path before parsing it and raises a
FileNotFoundError exception if the file doesn't exist.

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>

Diff Detail

Event Timeline

mib created this revision.Jun 2 2023, 10:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2023, 10:39 AM
mib requested review of this revision.Jun 2 2023, 10:39 AM
bulbazord accepted this revision.Jun 2 2023, 11:02 AM

The key here is that you're expanding the path and checking for the validity before calling CrashLogParser.create() right? It looks like for the load_crashlog_in_scripted_process case nothing has changed. If my understanding is correct, then this looks good to me.

This revision is now accepted and ready to land.Jun 2 2023, 11:02 AM
mib added a comment.Jun 2 2023, 11:25 AM

The key here is that you're expanding the path and checking for the validity before calling CrashLogParser.create() right? It looks like for the load_crashlog_in_scripted_process case nothing has changed. If my understanding is correct, then this looks good to me.

Yep, I had to fixed this in the past for interactive mode in a07a751 but not for the regular crashlog command. This patch refactors it to cover both cases.

This revision was automatically updated to reflect the committed changes.