This is an archive of the discontinued LLVM Phabricator instance.

[lldb/crashlog] Make TextCrashLogParser more resilient to new lines
ClosedPublic

Authored by mib on Aug 3 2023, 3:01 PM.

Details

Summary

This patch changes the parsing logic for the legacy crash report format
to avoid interrupting the parsing if there are new lines in the middle
of a section.

To do, the parser starts to skip all consecutive empty lines. If the
number of lines skipped is greater than 1, the parser considers that it
reached a new setion of the report and should reset the parsing mode to
back to normal.

Otherwise, it tries to parse the next line in the current parsing mode.
If it succeeds, the parser will also skip that line since it has already
been parsed and continue the parsing.

rdar://107022595

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

Diff Detail

Event Timeline

mib created this revision.Aug 3 2023, 3:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2023, 3:01 PM
mib requested review of this revision.Aug 3 2023, 3:01 PM
bulbazord accepted this revision.Aug 3 2023, 4:26 PM

Looks alright to me. I think it would be interesting to replace a lot of the index juggling code with python Iterators that can only iterate over the lines that are not empty, but that's just a fun idea I had.

This revision is now accepted and ready to land.Aug 3 2023, 4:26 PM
JDevlieghere accepted this revision.Aug 4 2023, 11:28 AM

LGTM with a test.

This revision is now accepted and ready to land.Aug 12 2023, 10:56 AM
mib added a comment.Aug 14 2023, 3:21 AM

Test?

I'll do it in a follow-up.

mib closed this revision.Aug 18 2023, 4:30 PM

Test?

I'll do it in a follow-up.

7602641