[lldb/crashlog] Add '-t|--target' option to interactive mode
This patch introduces a new flag for the interactive crashlog mode, that allow the user to specify, which target to use to create the scripted process. This can be very useful when lldb already have few targets created: Instead of taking the first one (zeroth index), we will use that flag to create a new target. If the user didn't provide a target path, we will rely on the symbolicator to create a targer.If that fails and there are already some targets loaded in lldb, we use the first one. rdar://94682869 Differential Revision: https://reviews.llvm.org/D129611 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
This commit is contained in:
@@ -13,7 +13,7 @@ class CrashLogScriptedProcess(ScriptedProcess):
|
||||
try:
|
||||
crash_log = CrashLogParser().parse(self.dbg, self.crashlog_path, False)
|
||||
except Exception as e:
|
||||
return
|
||||
raise e
|
||||
|
||||
self.pid = crash_log.process_id
|
||||
self.addr_mask = crash_log.addr_mask
|
||||
@@ -44,6 +44,7 @@ class CrashLogScriptedProcess(ScriptedProcess):
|
||||
super().__init__(target, args)
|
||||
|
||||
if not self.target or not self.target.IsValid():
|
||||
# Return error
|
||||
return
|
||||
|
||||
self.crashlog_path = None
|
||||
@@ -54,6 +55,7 @@ class CrashLogScriptedProcess(ScriptedProcess):
|
||||
self.crashlog_path = crashlog_path.GetStringValue(4096)
|
||||
|
||||
if not self.crashlog_path:
|
||||
# Return error
|
||||
return
|
||||
|
||||
load_all_images = args.GetValueForKey("load_all_images")
|
||||
|
||||
Reference in New Issue
Block a user