mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-23 04:05:30 +08:00
Merge remote-tracking branch
'origin/GP-5347_d-millar_lldb_bat_fix--SQUASHED' into patch (#4977)
This commit is contained in:
@@ -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\src
|
||||
set PYTHONPATH1=%GHIDRA_HOME%\Ghidra\Debug\Debugger-rmi-trace\pypkg\src
|
||||
IF 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\src
|
||||
set 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\src
|
||||
set PYTHONPATH1=%GHIDRA_HOME%\ghidra\Ghidra\Debug\Debugger-rmi-trace\build\pypkg\src
|
||||
)
|
||||
set PYTHONPATH=%PYTHONPATH1%;%PYTHONPATH0%;%PYTHONPATH%
|
||||
|
||||
set target_image=%1
|
||||
shift
|
||||
set target_args=%*
|
||||
set target_args=<%*
|
||||
|
||||
IF DEFINED target_args (
|
||||
argspart=-o "settings set target.run-args %target_args%"
|
||||
)
|
||||
|
||||
IF "%target_image%"=="" (
|
||||
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" ^
|
||||
) ELSE (
|
||||
-o "ghidra trace sync-enable"
|
||||
)
|
||||
|
||||
IF NOT '%target_image%'=="" IF "%target_args%"=="" (
|
||||
"%OPT_LLDB_PATH%" ^
|
||||
-o "version" ^
|
||||
-o "script import ghidralldb" ^
|
||||
-o "target create %target_image%" ^
|
||||
%argspart% ^
|
||||
-o "target create "%target_image%"" ^
|
||||
-o "ghidra trace connect %GHIDRA_TRACE_RMI_ADDR%" ^
|
||||
-o "ghidra trace start" ^
|
||||
-o "ghidra trace sync-enable" ^
|
||||
-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%"" ^
|
||||
-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%"
|
||||
)
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user