Skip to content

Commit ffecde1

Browse files
committed
[lldb/crashlog] Fix frame parser regex for when there is no source info
It can happen that the originator of a crash report doesn't have access to certain images. When that's the case, ReportCrash won't show the source info in the crash report stack frames, but only the stack address and image name. This patch fixes a bug in the crashlog stackframe parser regular expression to optionally match the source info group. rdar://101934135 Differential Revision: https://reviews.llvm.org/D137466 Signed-off-by: Med Ismail Bennani <[email protected]>
1 parent 172f8d1 commit ffecde1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lldb/examples/python/crashlog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ class TextCrashLogParser(CrashLogParser):
645645
r'(.+?)\s+' # img_name
646646
r'(?:' +version+ r'\s+)?' # img_version
647647
r'(0x[0-9a-fA-F]{4,})' # addr (4 chars or more)
648-
r' +(.*)' # offs
648+
r'(?: +(.*))?' # offs
649649
)
650650
null_frame_regex = re.compile(r'^\d+\s+\?\?\?\s+0{4,} +')
651651
image_regex_uuid = re.compile(r'(0x[0-9a-fA-F]+)' # img_lo

lldb/test/Shell/ScriptInterpreter/Python/Crashlog/Inputs/a.out.crash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Terminating Process: exc handler [21606]
2929

3030
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
3131
0 a.out @foo@ foo + 16 (test.c:3)
32-
1 a.out @bar@ bar + 9 (test.c:6)
32+
1 a.out @bar@
3333
2 a.out @main@ main + 20 (test.c:8)
3434
3 libdyld.dylib 0x1000000 start + 1
3535

0 commit comments

Comments
 (0)