Skip to content

Commit

Permalink
fix lldb script on xcode 12 (#464)
Browse files Browse the repository at this point in the history
Co-authored-by: Uldis Kalniņš <[email protected]>
  • Loading branch information
Ukalnins and Uldis Kalniņš authored Jun 26, 2020
1 parent dadab25 commit c1050a9
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit c1050a9

Please sign in to comment.