Ghidra is a software reverse engineering (SRE) framework
GP-5347: fix for spaces GP-5347: fix for no args GP-5347: typo GP-5347: fix for lldb bat
d-millar98da75584e02
diff --git a/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/local-lldb.bat b/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/local-lldb.batindex a422bec4df..e92e16c73c 100644--- a/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/local-lldb.bat+++ b/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/local-lldb.bat@@ -17,41 +17,50 @@::@env OPT_START_CMD:StartCmd="process launch" "Run command" "The lldb command to actually run the target."@echo off-set PYTHONPATH0=%GHIDRA_HOME%\Ghidra\Debug\Debugger-agent-gdb\pypkg\src+set PYTHONPATH0=%GHIDRA_HOME%\Ghidra\Debug\Debugger-agent-lldb\pypkg\srcset PYTHONPATH1=%GHIDRA_HOME%\Ghidra\Debug\Debugger-rmi-trace\pypkg\srcIF EXIST %GHIDRA_HOME%\.git (- set PYTHONPATH0=%GHIDRA_HOME%\Ghidra\Debug\Debugger-agent-gdb\build\pypkg\src+ set PYTHONPATH0=%GHIDRA_HOME%\Ghidra\Debug\Debugger-agent-lldb\build\pypkg\srcset PYTHONPATH1=%GHIDRA_HOME%\Ghidra\Debug\Debugger-rmi-trace\build\pypkg\src)IF EXIST %GHIDRA_HOME%\ghidra\.git (- set PYTHONPATH0=%GHIDRA_HOME%\ghidra\Ghidra\Debug\Debugger-agent-gdb\build\pypkg\src+ set PYTHONPATH0=%GHIDRA_HOME%\ghidra\Ghidra\Debug\Debugger-agent-lldb\build\pypkg\srcset PYTHONPATH1=%GHIDRA_HOME%\ghidra\Ghidra\Debug\Debugger-rmi-trace\build\pypkg\src)set PYTHONPATH=%PYTHONPATH1%;%PYTHONPATH0%;%PYTHONPATH%set target_image=%1shift-set target_args=%*+set target_args=<%*-IF DEFINED target_args (- argspart=-o "settings set target.run-args %target_args%"-)+IF '%target_image%'=="" (+ "%OPT_LLDB_PATH%" ^+ -o "version" ^+ -o "script import ghidralldb" ^+ -o "ghidra trace connect %GHIDRA_TRACE_RMI_ADDR%" ^+ -o "ghidra trace start" ^+ -o "ghidra trace sync-enable"+)-IF "%target_image%"=="" (+IF NOT '%target_image%'=="" IF "%target_args%"=="" ("%OPT_LLDB_PATH%" ^-o "version" ^-o "script import ghidralldb" ^+ -o "target create "%target_image%"" ^-o "ghidra trace connect %GHIDRA_TRACE_RMI_ADDR%" ^-o "ghidra trace start" ^-o "ghidra trace sync-enable" ^-) ELSE (+ -o "%OPT_START_CMD%"+)++IF NOT '%target_image%'=="" IF NOT "%target_args%"=="" ("%OPT_LLDB_PATH%" ^-o "version" ^-o "script import ghidralldb" ^- -o "target create %target_image%" ^- %argspart% ^+ -o "target create "%target_image%"" ^+ -o "settings set target.run-args %target_args%" ^-o "ghidra trace connect %GHIDRA_TRACE_RMI_ADDR%" ^-o "ghidra trace start" ^-o "ghidra trace sync-enable" ^-o "%OPT_START_CMD%"-)+)\ No newline at end of filediff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/arch.py b/Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/arch.pyindex 5c9f02aaf1..587ea88b4b 100644--- a/Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/arch.py+++ b/Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/arch.py@@ -132,9 +132,8 @@ default_compiler_map = {'macosx': 'gcc','tvos': 'gcc','watchos': 'gcc',- 'windows': 'Visual Studio',- # This may seem wrong, but Ghidra cspecs really describe the ABI- 'Cygwin': 'Visual Studio',+ 'windows': 'windows',+ 'Cygwin': 'windows','default': 'default','unknown': 'default',}@@ -206,6 +205,9 @@ def compute_ghidra_language():# through them by endian and probably prefer default/simpler variants. The# heuristic for "simpler" will be 'default' then shortest variant id.arch = get_arch()+ osabi = get_osabi()+ if osabi == 'windows' and arch == 'i386':+ arch = 'x86_64'endian = get_endian()lebe = ':BE:' if endian == 'big' else ':LE:'if not arch in language_map: