Skip to content

[lldb/crashlog] Add --no-parallel-image-loading hidden flag #94513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions lldb/examples/python/crashlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,11 +555,15 @@ def load_images(self, options, loaded_images=None):

futures = []
with tempfile.TemporaryDirectory() as obj_dir:
with concurrent.futures.ThreadPoolExecutor() as executor:

def add_module(image, target, obj_dir):
return image, image.add_module(target, obj_dir)
def add_module(image, target, obj_dir):
return image, image.add_module(target, obj_dir)

max_worker = None
if options.no_parallel_image_loading:
max_worker = 1

with concurrent.futures.ThreadPoolExecutor(max_worker) as executor:
for image in images_to_load:
if image not in loaded_images:
if image.uuid == uuid.UUID(int=0):
Expand Down Expand Up @@ -1528,6 +1532,7 @@ def load_crashlog_in_scripted_process(debugger, crashlog_path, options, result):
"file_path": crashlog_path,
"load_all_images": options.load_all_images,
"crashed_only": options.crashed_only,
"no_parallel_image_loading": options.no_parallel_image_loading,
}
)
)
Expand Down Expand Up @@ -1720,6 +1725,13 @@ def CreateSymbolicateCrashLogOptions(
help="show source for all threads, not just the crashed thread",
default=False,
)
arg_parser.add_argument(
"--no-parallel-image-loading",
dest="no_parallel_image_loading",
action="store_true",
help=argparse.SUPPRESS,
default=False,
)
if add_interactive_options:
arg_parser.add_argument(
"-i",
Expand Down
8 changes: 8 additions & 0 deletions lldb/examples/python/crashlog_scripted_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def set_crashlog(self, crashlog):
class CrashLogOptions:
load_all_images = False
crashed_only = True
no_parallel_image_loading = False

def __init__(self, exe_ctx: lldb.SBExecutionContext, args: lldb.SBStructuredData):
super().__init__(exe_ctx, args)
Expand Down Expand Up @@ -84,6 +85,13 @@ def __init__(self, exe_ctx: lldb.SBExecutionContext, args: lldb.SBStructuredData
if crashed_only.GetType() == lldb.eStructuredDataTypeBoolean:
self.options.crashed_only = crashed_only.GetBooleanValue()

no_parallel_image_loading = args.GetValueForKey("no_parallel_image_loading")
if no_parallel_image_loading and no_parallel_image_loading.IsValid():
if no_parallel_image_loading.GetType() == lldb.eStructuredDataTypeBoolean:
self.options.no_parallel_image_loading = (
no_parallel_image_loading.GetBooleanValue()
)

self.pid = super().get_process_id()
self.crashed_thread_idx = 0
self.exception = None
Expand Down
Loading