aboutsummaryrefslogtreecommitdiff
path: root/lldb/examples/python/crashlog.py
diff options
context:
space:
mode:
authorMed Ismail Bennani <ismail@bennani.ma>2023-05-22 15:51:43 -0700
committerMed Ismail Bennani <ismail@bennani.ma>2023-05-22 16:14:00 -0700
commitabba5de724665362db707d4cfab598cfbf5a475e (patch)
tree293da7b5b91e3a339b5b984860e34bbd0b362097 /lldb/examples/python/crashlog.py
parent273a2d337f675f3ee050f281b1fecc3e806b9a3c (diff)
downloadllvm-abba5de724665362db707d4cfab598cfbf5a475e.zip
llvm-abba5de724665362db707d4cfab598cfbf5a475e.tar.gz
llvm-abba5de724665362db707d4cfab598cfbf5a475e.tar.bz2
[lldb/crashlog] Remove tempfile prefix from inlined symbol object file
This patch changes the way we generate the ObjectFileJSON files containing the inlined symbols from the crash report to remove the tempfile prefix from the object file name. To do so, instead of creating a new tempfile for each module, we create a temporary directory that contains each module object file with the same name as the module. This makes the backtraces only contain the module name without the temfile prefix which makes it look like a regular stackframe. Differential Revision: https://reviews.llvm.org/D151045 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
Diffstat (limited to 'lldb/examples/python/crashlog.py')
-rwxr-xr-xlldb/examples/python/crashlog.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index d207af1..7bfa402 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -40,6 +40,7 @@ import shlex
import string
import subprocess
import sys
+import tempfile
import threading
import time
import uuid
@@ -1154,12 +1155,17 @@ def SymbolicateCrashLog(crash_log, options):
futures = []
loaded_images = []
with concurrent.futures.ThreadPoolExecutor() as executor:
- def add_module(image, target):
- return image, image.add_module(target)
+ with tempfile.TemporaryDirectory() as obj_dir:
- for image in crash_log.images:
- futures.append(executor.submit(add_module, image=image, target=target))
+ def add_module(image, target, obj_dir):
+ return image, image.add_module(target, obj_dir)
+ for image in crash_log.images:
+ futures.append(
+ executor.submit(
+ add_module, image=image, target=target, obj_dir=obj_dir
+ )
+ )
for future in concurrent.futures.as_completed(futures):
image, err = future.result()
if err: