aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/Shell/ScriptInterpreter/Python/Crashlog
diff options
context:
space:
mode:
authorMed Ismail Bennani <medismail.bennani@gmail.com>2022-03-24 17:19:33 -0700
committerMed Ismail Bennani <medismail.bennani@gmail.com>2022-03-25 14:59:50 -0700
commit12301d616fbcd3bbc78664221256404123a0935f (patch)
tree3d187b1015b2322c8ebc6b1f8a2cf68f5e98c15b /lldb/test/Shell/ScriptInterpreter/Python/Crashlog
parentafaefb671fe12e7788d3e8de6b6193b935fbf16c (diff)
downloadllvm-12301d616fbcd3bbc78664221256404123a0935f.zip
llvm-12301d616fbcd3bbc78664221256404123a0935f.tar.gz
llvm-12301d616fbcd3bbc78664221256404123a0935f.tar.bz2
[lldb/crashlog] Parse thread fields and pass it to crashlog scripted process
Previously, the ScriptedThread used the thread index as the thread id. This patch parses the crashlog json to extract the actual thread "id" value, and passes this information to the Crashlog ScriptedProcess blueprint, to create a higher fidelity ScriptedThreaad. It also updates the blueprint to show the thread name and thread queue. Finally, this patch updates the interactive crashlog test to reflect these changes. rdar://90327854 Differential Revision: https://reviews.llvm.org/D122422 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/test/Shell/ScriptInterpreter/Python/Crashlog')
-rw-r--r--lldb/test/Shell/ScriptInterpreter/Python/Crashlog/scripted_crashlog_json.test19
1 files changed, 13 insertions, 6 deletions
diff --git a/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/scripted_crashlog_json.test b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/scripted_crashlog_json.test
index 6d66d7b..4cf6159 100644
--- a/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/scripted_crashlog_json.test
+++ b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/scripted_crashlog_json.test
@@ -4,17 +4,17 @@
# RUN: cp %S/Inputs/scripted_crashlog.ips %t.crash
# RUN: %python %S/patch-crashlog.py --binary %t.out --crashlog %t.crash --offsets '{"main":160, "bar":20, "foo":24}' --json
-# RUN: %lldb %t.out -o 'command script import lldb.macosx.crashlog' -o 'crashlog -a -i %t.crash' 2>&1 -o "bt all" | FileCheck %s
+# RUN: %lldb %t.out -o 'command script import lldb.macosx.crashlog' -o 'crashlog -a -i %t.crash' 2>&1 -o "thread list" -o "bt all" | FileCheck %s
# CHECK: "crashlog" {{.*}} commands have been installed, use the "--help" options on these commands
# CHECK: (lldb) process status
# CHECK-NEXT: Process 24991 stopped
-# CHECK-NEXT: * thread #3, name = 'CrashLogScriptedThread.thread-2', stop reason = EXC_BAD_ACCESS
+# CHECK-NEXT: * thread #3, stop reason = EXC_BAD_ACCESS
# CHECK-NEXT: frame #0: 0x00000001047f5970 scripted_crashlog_json.test.tmp.out`bar
# CHECK: (lldb) thread backtrace
-# CHECK-NEXT: * thread #3, name = 'CrashLogScriptedThread.thread-2', stop reason = EXC_BAD_ACCESS
+# CHECK-NEXT: * thread #3, stop reason = EXC_BAD_ACCESS
# CHECK-NEXT: * frame #0: 0x00000001047f5970 scripted_crashlog_json.test.tmp.out`bar
# CHECK-NEXT: frame #1: 0x00000001047f5998 scripted_crashlog_json.test.tmp.out`foo
# CHECK-NEXT: frame #2: 0x00000001047f5b04 scripted_crashlog_json.test.tmp.out`compute_pow
@@ -24,14 +24,21 @@
# CHECK-NEXT: frame #6: 0x000000018bf5326c libsystem_pthread.dylib`_pthread_start
# CHECK-NEXT: frame #7: 0x000000018bf4e08c libsystem_pthread.dylib`thread_start
+# CHECK: (lldb) thread list
+# CHECK-NEXT: Process 24991 stopped
+# CHECK-NEXT: thread #1: tid = 0x4ea840, 0x000000018bf17854 libsystem_kernel.dylib`__ulock_wait{{.*}}, queue = 'com.apple.main-thread'
+# CHECK-NEXT: thread #2: tid = 0x4ea850, 0x00000001047f59e8 scripted_crashlog_json.test.tmp.out`call_and_wait
+# CHECK-NEXT: * thread #3: tid = 0x4ea851, 0x00000001047f5970 scripted_crashlog_json.test.tmp.out`bar{{.*}}, stop reason = EXC_BAD_ACCESS
+
+
# CHECK: (lldb) bt all
-# CHECK-NEXT: thread #1, name = 'CrashLogScriptedThread.thread-0'
+# CHECK-NEXT: thread #1
# CHECK-NEXT: frame #0: 0x000000018bf17854 libsystem_kernel.dylib`__ulock_wait
# CHECK-NEXT: frame #1: 0x000000018bf555a0 libsystem_pthread.dylib`_pthread_join
# CHECK-NEXT: frame #2: 0x000000018beae9c0 libc++.1.dylib`std::__1::thread::join
# CHECK-NEXT: frame #3: 0x00000001047f5bb8 scripted_crashlog_json.test.tmp.out`main
# CHECK-NEXT: frame #4: 0x0000000104ae5088 dyld`start
-# CHECK-NEXT: thread #2, name = 'CrashLogScriptedThread.thread-1'
+# CHECK-NEXT: thread #2
# CHECK-NEXT: frame #0: 0x00000001047f59e8 scripted_crashlog_json.test.tmp.out`call_and_wait
# CHECK-NEXT: frame #1: 0x00000001047f59d4 scripted_crashlog_json.test.tmp.out`call_and_wait
# CHECK-NEXT: frame #2: 0x00000001047f7690 scripted_crashlog_json.test.tmp.out`decltype
@@ -39,7 +46,7 @@
# CHECK-NEXT: frame #4: 0x00000001047f6d58 scripted_crashlog_json.test.tmp.out`void* std::__1::__thread_proxy
# CHECK-NEXT: frame #5: 0x000000018bf5326c libsystem_pthread.dylib`_pthread_start
# CHECK-NEXT: frame #6: 0x000000018bf4e08c libsystem_pthread.dylib`thread_start
-# CHECK-NEXT: * thread #3, name = 'CrashLogScriptedThread.thread-2', stop reason = EXC_BAD_ACCESS
+# CHECK-NEXT: * thread #3, stop reason = EXC_BAD_ACCESS
# CHECK-NEXT: * frame #0: 0x00000001047f5970 scripted_crashlog_json.test.tmp.out`bar
# CHECK-NEXT: frame #1: 0x00000001047f5998 scripted_crashlog_json.test.tmp.out`foo
# CHECK-NEXT: frame #2: 0x00000001047f5b04 scripted_crashlog_json.test.tmp.out`compute_pow