aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/Shell/ScriptInterpreter/Python
diff options
context:
space:
mode:
authorMed Ismail Bennani <ismail@bennani.ma>2024-03-04 15:44:44 -0800
committerGitHub <noreply@github.com>2024-03-04 15:44:44 -0800
commit5000e4c2527ae53bf7c1a609f739a97cdc522bbe (patch)
treebed6df45b47a446757991fbdeb85b6e8dc9f8c68 /lldb/test/Shell/ScriptInterpreter/Python
parent07b1aebced8015c62d4ce0afe07358049afae5b1 (diff)
downloadllvm-5000e4c2527ae53bf7c1a609f739a97cdc522bbe.zip
llvm-5000e4c2527ae53bf7c1a609f739a97cdc522bbe.tar.gz
llvm-5000e4c2527ae53bf7c1a609f739a97cdc522bbe.tar.bz2
[lldb/crashlog] Fix breaking changes in textual report format (#83861)
This patch should address some register parsing issue in the legacy report format. rdar://107210149 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
Diffstat (limited to 'lldb/test/Shell/ScriptInterpreter/Python')
-rw-r--r--lldb/test/Shell/ScriptInterpreter/Python/Crashlog/Inputs/altered_threadState.crash50
-rw-r--r--lldb/test/Shell/ScriptInterpreter/Python/Crashlog/altered_threadState.test13
2 files changed, 63 insertions, 0 deletions
diff --git a/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/Inputs/altered_threadState.crash b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/Inputs/altered_threadState.crash
new file mode 100644
index 0000000..8fcbdd2
--- /dev/null
+++ b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/Inputs/altered_threadState.crash
@@ -0,0 +1,50 @@
+Process: a.out [21606]
+Path: /private/tmp/a.out
+Identifier: a.out
+Version: 0
+Code Type: X86-64 (Native)
+Parent Process: fish [88883]
+User ID: 501
+
+Date/Time: 2020-11-11 14:47:34.600 -0800
+OS Version: macOS 11.0.1
+Report Version: 12
+Bridge OS Version: redacted
+Anonymous UUID: DCEF35CB-68D5-F524-FF13-060901F52EA8
+
+
+Time Awake Since Boot: 400000 seconds
+
+System Integrity Protection: enabled
+
+Crashed Thread: 0 Dispatch queue: com.apple.main-thread
+
+Exception Type: EXC_BAD_ACCESS (SIGSEGV)
+Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
+Exception Note: EXC_CORPSE_NOTIFY
+
+Termination Signal: Segmentation fault: 11
+Termination Reason: Namespace SIGNAL, Code 0xb
+Terminating Process: exc handler [21606]
+
+Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
+0 a.out @foo@ foo + 16 (test.c:3)
+1 a.out @bar@
+2 a.out @main@ main + 20 (test.c:8)
+3 libdyld.dylib 0x1000000 start + 1
+
+Thread State
+ rax: 0x0000000000000000 rbx: 0x0000000000000000 rcx: 0x00007ffee42d81d0 rdx: 0x00007ffee42d8080
+ rdi: 0x0000000000000001 rsi: 0x00007ffee42d8070 rbp: 0x00007ffee42d8020 rsp: 0x00007ffee42d8020
+ r8: 0x0000000000000000 r9: 0x0000000000000000 r10: 0x0000000000000000 r11: 0x0000000000000000
+ r12: 0x0000000000000000 r13: 0x0000000000000000 r14: 0x0000000000000000 r15: 0x0000000000000000
+ rip: 0x000000010b92af70 rfl: 0x0000000000010202 cr2: 0x0000000000000000
+
+Logical CPU: 2
+Error Code: 0x00000006 (no mapping for user data write)
+Trap Number: 14
+
+
+Binary Images:
+ 0x100000000 - 0x200000000 +a.out (0) <@UUID@> @EXEC@
+ 0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
diff --git a/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/altered_threadState.test b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/altered_threadState.test
new file mode 100644
index 0000000..5a946a3
--- /dev/null
+++ b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/altered_threadState.test
@@ -0,0 +1,13 @@
+# RUN: %clang_host -g %S/Inputs/test.c -o %t.out
+# RUN: cp %S/Inputs/altered_threadState.crash %t.crash
+# RUN: %python %S/patch-crashlog.py --binary %t.out --crashlog %t.crash --offsets '{"main":20, "bar":9, "foo":16}'
+# RUN: %lldb %t.out -o 'command script import lldb.macosx.crashlog' -o 'crashlog %t.crash' 2>&1 | FileCheck %s
+
+# CHECK: "crashlog" {{.*}} commands have been installed, use the "--help" options on these commands
+
+# CHECK: Thread[0] EXC_BAD_ACCESS (SIGSEGV) (KERN_INVALID_ADDRESS at 0x0000000000000000)
+# CHECK: [ 0] {{.*}}out`foo + 16 at test.c
+# CHECK: [ 1] {{.*}}out`bar + 8 at test.c
+# CHECK: [ 2] {{.*}}out`main + 19 at test.c
+# CHECK: [ 3] 0x{{[0]+}}1000000 start + 1
+# CHECK: rbp = 0x00007ffee42d8020