Skip to content
Merged
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
10 changes: 5 additions & 5 deletions src/scripts/lldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def connect_command(debugger, command, result, internal_dict):
lldb.SBTarget.GetBroadcasterClassName(),
lldb.SBProcess.eBroadcastBitStateChanged | lldb.SBProcess.eBroadcastBitSTDOUT | lldb.SBProcess.eBroadcastBitSTDERR)

process = lldb.target.ConnectRemote(listener, connect_url, None, error)
process = debugger.GetSelectedTarget().ConnectRemote(listener, connect_url, None, error)

# Wait for connection to succeed
events = []
Expand All @@ -42,7 +42,7 @@ def connect_command(debugger, command, result, internal_dict):
def run_command(debugger, command, result, internal_dict):
device_app = internal_dict['fruitstrap_device_app']
args = command.split('--',1)
lldb.target.modules[0].SetPlatformFileSpec(lldb.SBFileSpec(device_app))
debugger.GetSelectedTarget().modules[0].SetPlatformFileSpec(lldb.SBFileSpec(device_app))
args_arr = []
if len(args) > 1:
args_arr = shlex.split(args[1])
Expand All @@ -62,7 +62,7 @@ def run_command(debugger, command, result, internal_dict):
envs_arr = envs_arr + shlex.split('{envs}')
launchInfo.SetEnvironmentEntries(envs_arr, True)

lldb.target.Launch(launchInfo, startup_error)
debugger.GetSelectedTarget().Launch(launchInfo, startup_error)
lockedstr = ': Locked'
if lockedstr in str(startup_error):
print('\\nDevice Locked\\n')
Expand All @@ -71,7 +71,7 @@ def run_command(debugger, command, result, internal_dict):
print(str(startup_error))

def safequit_command(debugger, command, result, internal_dict):
process = lldb.target.process
process = debugger.GetSelectedTarget().process
state = process.GetState()
if state == lldb.eStateRunning:
process.Detach()
Expand All @@ -84,7 +84,7 @@ def safequit_command(debugger, command, result, internal_dict):

def autoexit_command(debugger, command, result, internal_dict):
global listener
process = lldb.target.process
process = debugger.GetSelectedTarget().process
if not startup_error.Success():
print('\\nPROCESS_NOT_STARTED\\n')
os._exit({exitcode_app_crash})
Expand Down