diff --git a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/local-gdb.bat b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/local-gdb.bat index 8765033567..4d121f60e2 100644 --- a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/local-gdb.bat +++ b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/local-gdb.bat @@ -11,11 +11,13 @@ ::@icon icon.debugger ::@help TraceRmiLauncherServicePlugin#gdb ::@enum StartCmd:str run start starti +::@enum Endian:str auto big little ::@env OPT_TARGET_IMG:file="" "Image" "The target binary executable image" ::@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target" ::@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb. Omit the full path to resolve using the system PATH." ::@env OPT_START_CMD:StartCmd="starti" "Run command" "The gdb command to actually run the target." ::@env OPT_ARCH:str="i386:x86-64" "Architecture" "Target architecture" +::@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order" @echo off @@ -38,6 +40,8 @@ IF "%OPT_TARGET_IMG%"=="" ( -ex "set confirm off" ^ -ex "show version" ^ -ex "python import ghidragdb" ^ + -ex "set architecture %OPT_ARCH%" ^ + -ex "set endian %OPT_ENDIAN%" ^ -ex "ghidra trace connect '%GHIDRA_TRACE_RMI_ADDR%'" ^ -ex "ghidra trace start" ^ -ex "ghidra trace sync-enable" ^ @@ -50,6 +54,8 @@ IF "%OPT_TARGET_IMG%"=="" ( -ex "set confirm off" ^ -ex "show version" ^ -ex "python import ghidragdb" ^ + -ex "set architecture %OPT_ARCH%" ^ + -ex "set endian %OPT_ENDIAN%" ^ -ex "target exec %OPT_TARGET_IMG%" ^ -ex "set args %OPT_TARGET_ARGS%" ^ -ex "ghidra trace connect '%GHIDRA_TRACE_RMI_ADDR%'" ^ diff --git a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/local-gdb.sh b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/local-gdb.sh index 2629d0e1ac..740b77b6d0 100755 --- a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/local-gdb.sh +++ b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/local-gdb.sh @@ -27,11 +27,13 @@ #@icon icon.debugger #@help TraceRmiLauncherServicePlugin#gdb #@enum StartCmd:str run start starti +#@enum Endian:str auto big little #@arg :file "Image" "The target binary executable image, empty for no target" #@args "Arguments" "Command-line arguments to pass to the target" #@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb. Omit the full path to resolve using the system PATH." #@env OPT_START_CMD:StartCmd="starti" "Run command" "The gdb command to actually run the target." #@env OPT_ARCH:str="i386:x86-64" "Architecture" "Target architecture" +#@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order" #@env OPT_EXTRA_TTY:bool=false "Inferior TTY" "Provide a separate terminal emulator for the target." #@tty TTY_TARGET if env:OPT_EXTRA_TTY @@ -63,6 +65,7 @@ then -ex "show version" \ -ex "python import ghidragdb" \ -ex "set architecture $OPT_ARCH" \ + -ex "set endian $OPT_ENDIAN" \ -ex "set inferior-tty $TTY_TARGET" \ -ex "ghidra trace connect \"$GHIDRA_TRACE_RMI_ADDR\"" \ -ex "ghidra trace start" \ @@ -77,6 +80,7 @@ else -ex "show version" \ -ex "python import ghidragdb" \ -ex "set architecture $OPT_ARCH" \ + -ex "set endian $OPT_ENDIAN" \ -ex "file \"$target_image\"" \ -ex "set args $target_args" \ -ex "set inferior-tty $TTY_TARGET" \ diff --git a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/qemu-gdb.sh b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/qemu-gdb.sh index 37944e8a36..71a53269a9 100755 --- a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/qemu-gdb.sh +++ b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/qemu-gdb.sh @@ -27,12 +27,15 @@ #@menu-group cross #@icon icon.debugger #@help TraceRmiLauncherServicePlugin#gdb_qemu +#@enum Endian:str auto big little #@arg :file! "Image" "The target binary executable image" #@args "Arguments" "Command-line arguments to pass to the target" #@env GHIDRA_LANG_EXTTOOL_qemu:file="" "QEMU command" "The path to qemu for the target architecture." #@env QEMU_GDB:int=1234 "QEMU Port" "Port for gdb connection to qemu" #@env OPT_EXTRA_QEMU_ARGS:str="" "Extra qemu arguments" "Extra arguments to pass to qemu. Use with care." #@env OPT_GDB_PATH:file="gdb-multiarch" "gdb command" "The path to gdb. Omit the full path to resolve using the system PATH." +#@env OPT_ARCH:str="auto" "Architecture" "Target architecture" +#@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order" #@env OPT_EXTRA_TTY:bool=false "QEMU TTY" "Provide a separate terminal emulator for the target." #@env OPT_PULL_ALL_SECTIONS:bool=false "Pull all section mappings" "Force gdb to send all mappings to Ghidra. This can be costly (see help)." #@tty TTY_TARGET if env:OPT_EXTRA_TTY @@ -69,6 +72,8 @@ gdb_args=( -ex "set confirm off" -ex "show version" -ex "python import ghidragdb" + -ex "set architecture $OPT_ARCH" + -ex "set endian $OPT_ENDIAN" -ex "file \"$target_image\"" -ex "ghidra trace connect \"$GHIDRA_TRACE_RMI_ADDR\"" -ex "ghidra trace start" diff --git a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/qemu-sys-gdb.bat b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/qemu-sys-gdb.bat index 10c5242255..21f8e4cbd6 100644 --- a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/qemu-sys-gdb.bat +++ b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/qemu-sys-gdb.bat @@ -11,11 +11,14 @@ ::@menu-group cross ::@icon icon.debugger ::@help TraceRmiLauncherServicePlugin#gdb_qemu +::@enum Endian:str auto big little ::@env OPT_TARGET_IMG:file!="" "Image" "The target binary executable image" ::@env GHIDRA_LANG_EXTTOOL_qemu_system:file="" "QEMU command" "The path to qemu-system for the target architecture." ::@env QEMU_GDB:int=1234 "QEMU Port" "Port for gdb connection to qemu" ::@env OPT_EXTRA_QEMU_ARGS:str="" "Extra qemu arguments" "Extra arguments to pass to qemu. Use with care." ::@env OPT_GDB_PATH:file="gdb-multiarch" "gdb command" "The path to gdb. Omit the full path to resolve using the system PATH." +::@env OPT_ARCH:str="auto" "Architecture" "Target architecture" +::@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order" ::@env OPT_EXTRA_TTY:bool=false "QEMU TTY" "Provide a separate terminal emulator for qemu." @echo off @@ -32,9 +35,9 @@ IF EXIST %GHIDRA_HOME%\ghidra\.git ( set PYTHONPATH=%PYTHONPATH1%;%PYTHONPATH0%;%PYTHONPATH% IF "%OPT_EXTRA_TTY%"=="true" ( - start "qemu" "%GHIDRA_LANG_EXTTOOL_qemu%" %OPT_EXTRA_QEMU_ARGS% -gdb tcp::%QEMU_GDB% -S "%OPT_TARGET_IMG%" + start "qemu" "%GHIDRA_LANG_EXTTOOL_qemu_system%" %OPT_EXTRA_QEMU_ARGS% -gdb tcp::%QEMU_GDB% -S "%OPT_TARGET_IMG%" ) ELSE ( - start /B "qemu" "%GHIDRA_LANG_EXTTOOL_qemu%" %OPT_EXTRA_QEMU_ARGS% -gdb tcp::%QEMU_GDB% -S "%OPT_TARGET_IMG%" + start /B "qemu" "%GHIDRA_LANG_EXTTOOL_qemu_system%" %OPT_EXTRA_QEMU_ARGS% -gdb tcp::%QEMU_GDB% -S "%OPT_TARGET_IMG%" ) :: Give QEMU a moment to open the socket @@ -46,6 +49,8 @@ powershell -nop -c "& {sleep -m 100}" -ex "set confirm off" ^ -ex "show version" ^ -ex "python import ghidragdb" ^ + ex "set architecture %OPT_ARCH%" ^ + ex "set endian %OPT_ENDIAN%" ^ -ex "target exec '%OPT_TARGET_IMG%'" ^ -ex "ghidra trace connect '%GHIDRA_TRACE_RMI_ADDR%'" ^ -ex "ghidra trace start" ^ diff --git a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/qemu-sys-gdb.sh b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/qemu-sys-gdb.sh index b572ecee0c..91d438173e 100755 --- a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/qemu-sys-gdb.sh +++ b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/qemu-sys-gdb.sh @@ -27,11 +27,14 @@ #@menu-group cross #@icon icon.debugger #@help TraceRmiLauncherServicePlugin#gdb_qemu +#@enum Endian:str auto big little #@arg :file! "Image" "The target binary executable image" #@env GHIDRA_LANG_EXTTOOL_qemu_system:file="" "QEMU command" "The path to qemu-system for the target architecture." #@env QEMU_GDB:int=1234 "QEMU Port" "Port for gdb connection to qemu" #@env OPT_EXTRA_QEMU_ARGS:str="" "Extra qemu arguments" "Extra arguments to pass to qemu. Use with care." #@env OPT_GDB_PATH:file="gdb-multiarch" "gdb command" "The path to gdb. Omit the full path to resolve using the system PATH." +#@env OPT_ARCH:str="auto" "Architecture" "Target architecture" +#@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order" #@env OPT_EXTRA_TTY:bool=false "QEMU TTY" "Provide a separate terminal emulator for qemu." #@env OPT_PULL_ALL_SECTIONS:bool=false "Pull all section mappings" "Force gdb to send all mappings to Ghidra. This can be costly (see help)." #@tty TTY_TARGET if env:OPT_EXTRA_TTY @@ -53,9 +56,9 @@ target_image="$1" if [ -z "$TTY_TARGET" ] then - "$GHIDRA_LANG_EXTTOOL_qemu" $OPT_EXTRA_QEMU_ARGS -gdb tcp::$QEMU_GDB -S $1 & + "$GHIDRA_LANG_EXTTOOL_qemu_system" $OPT_EXTRA_QEMU_ARGS -gdb tcp::$QEMU_GDB -S $1 & else - "$GHIDRA_LANG_EXTTOOL_qemu" $OPT_EXTRA_QEMU_ARGS -gdb tcp::$QEMU_GDB -S $1 <$TTY_TARGET >$TTY_TARGET 2>&1 & + "$GHIDRA_LANG_EXTTOOL_qemu_system" $OPT_EXTRA_QEMU_ARGS -gdb tcp::$QEMU_GDB -S $1 <$TTY_TARGET >$TTY_TARGET 2>&1 & fi # Give QEMU a moment to open the socket @@ -67,6 +70,8 @@ gdb_args=( -ex "set confirm off" -ex "show version" -ex "python import ghidragdb" + -ex "set architecture $OPT_ARCH" + -ex "set endian $OPT_ENDIAN" -ex "file \"$target_image\"" -ex "ghidra trace connect \"$GHIDRA_TRACE_RMI_ADDR\"" -ex "ghidra trace start" diff --git a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/remote-gdb.bat b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/remote-gdb.bat index 3fa80e731b..20c4778780 100644 --- a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/remote-gdb.bat +++ b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/remote-gdb.bat @@ -10,11 +10,13 @@ ::@icon icon.debugger ::@help TraceRmiLauncherServicePlugin#gdb_remote ::@enum TargetType:str remote extended-remote +::@enum Endian:str auto big little ::@env OPT_TARGET_TYPE:TargetType="remote" "Target" "The type of remote target" ::@env OPT_HOST:str="localhost" "Host" "The hostname of the target" ::@env OPT_PORT:int=9999 "Port" "The host's listening port" -::@env OPT_ARCH:str="auto" "Architecture" "Target architecture override" ::@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb on the local system. Omit the full path to resolve using the system PATH." +::@env OPT_ARCH:str="auto" "Architecture" "Target architecture override" +::@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order" @echo off set PYTHONPATH0=%GHIDRA_HOME%\Ghidra\Debug\Debugger-agent-gdb\pypkg\src @@ -35,7 +37,8 @@ set PYTHONPATH=%PYTHONPATH1%;%PYTHONPATH0%;%PYTHONPATH% -ex "set confirm off" ^ -ex "show version" ^ -ex "python import ghidragdb" ^ - -ex "set arch %OPT_ARCH%" ^ + -ex "set architecture %OPT_ARCH%" ^ + ex "set endian %OPT_ENDIAN%" ^ -ex "echo Connecting to %OPT_HOST%:%OPT_PORT%... " ^ -ex "target %OPT_TARGET_TYPE% %OPT_HOST%:%OPT_PORT%" ^ -ex "ghidra trace connect '%GHIDRA_TRACE_RMI_ADDR%'" ^ diff --git a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/remote-gdb.sh b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/remote-gdb.sh index 909c033efd..06ee2bcac7 100755 --- a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/remote-gdb.sh +++ b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/remote-gdb.sh @@ -26,11 +26,13 @@ #@icon icon.debugger #@help TraceRmiLauncherServicePlugin#gdb_remote #@enum TargetType:str remote extended-remote +#@enum Endian:str auto big little #@env OPT_TARGET_TYPE:TargetType="remote" "Target" "The type of remote target" #@env OPT_HOST:str="localhost" "Host" "The hostname of the target" #@env OPT_PORT:int=9999 "Port" "The host's listening port" -#@env OPT_ARCH:str="auto" "Architecture" "Target architecture override" #@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb on the local system. Omit the full path to resolve using the system PATH." +#@env OPT_ARCH:str="auto" "Architecture" "Target architecture override" +#@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order" if [ -d ${GHIDRA_HOME}/ghidra/.git ] then @@ -51,7 +53,8 @@ fi -ex "set confirm off" \ -ex "show version" \ -ex "python import ghidragdb" \ - -ex "set arch $OPT_ARCH" \ + -ex "set architecture $OPT_ARCH" \ + -ex "set endian $OPT_ENDIAN" \ -ex "echo Connecting to $OPT_HOST:$OPT_PORT... " \ -ex "target $OPT_TARGET_TYPE $OPT_HOST:$OPT_PORT" \ -ex "ghidra trace connect \"$GHIDRA_TRACE_RMI_ADDR\"" \ diff --git a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdb.bat b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdb.bat index 1f4f986fa4..ce6f76afb5 100644 --- a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdb.bat +++ b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdb.bat @@ -12,6 +12,7 @@ ::@icon icon.debugger ::@help TraceRmiLauncherServicePlugin#gdb_ssh ::@enum StartCmd:str run start starti +::@enum Endian:str auto big little ::@env OPT_TARGET_IMG:str="" "Image" "The target binary executable image on the remote system" ::@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target" ::@env OPT_SSH_PATH:file="ssh" "ssh command" "The path to ssh on the local system. Omit the full path to resolve using the system PATH." @@ -21,6 +22,7 @@ ::@env OPT_GDB_PATH:str="gdb" "gdb command" "The path to gdb on the remote system. Omit the full path to resolve using the system PATH." ::@env OPT_START_CMD:StartCmd="starti" "Run command" "The gdb command to actually run the target." ::@env OPT_ARCH:str="i386:x86-64" "Architecture" "Target architecture" +::@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order" @echo off @@ -32,6 +34,7 @@ IF "%OPT_TARGET_IMG%" == "" ( -ex 'show version' ^ -ex 'python import ghidragdb' ^ -ex 'set architecture %OPT_ARCH%' ^ + ex 'set endian %OPT_ENDIAN%' ^ -ex 'ghidra trace connect \"localhost:%OPT_REMOTE_PORT%\"' ^ -ex 'ghidra trace start' ^ -ex 'ghidra trace sync-enable' ^ @@ -45,6 +48,7 @@ IF "%OPT_TARGET_IMG%" == "" ( -ex 'show version' ^ -ex 'python import ghidragdb' ^ -ex 'set architecture %OPT_ARCH%' ^ + ex 'set endian %OPT_ENDIAN%' ^ -ex 'file \"%OPT_TARGET_IMG%\"' ^ -ex 'set args %OPT_TARGET_ARGS%' ^ -ex 'ghidra trace connect \"localhost:%OPT_REMOTE_PORT%\"' ^ diff --git a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdb.sh b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdb.sh index 372460ed00..7a3505b5bb 100755 --- a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdb.sh +++ b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdb.sh @@ -28,6 +28,7 @@ #@icon icon.debugger #@help TraceRmiLauncherServicePlugin#gdb_ssh #@enum StartCmd:str run start starti +#@enum Endian:str auto big little #@arg :str "Image" "The target binary executable image on the remote system" #@args "Arguments" "Command-line arguments to pass to the target" #@env OPT_SSH_PATH:file!="ssh" "ssh command" "The path to ssh on the local system. Omit the full path to resolve using the system PATH." @@ -37,6 +38,7 @@ #@env OPT_GDB_PATH:str="gdb" "gdb command" "The path to gdb on the remote system. Omit the full path to resolve using the system PATH." #@env OPT_START_CMD:StartCmd="starti" "Run command" "The gdb command to actually run the target." #@env OPT_ARCH:str="i386:x86-64" "Architecture" "Target architecture" +#@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order" target_image="$1" shift @@ -51,6 +53,7 @@ then -ex 'show version' \ -ex 'python import ghidragdb' \ -ex 'set architecture $OPT_ARCH' \ + -ex 'set endian $OPT_ENDIAN' \ -ex 'ghidra trace connect \"localhost:$OPT_REMOTE_PORT\"' \ -ex 'ghidra trace start' \ -ex 'ghidra trace sync-enable' \ @@ -64,6 +67,7 @@ else -ex 'show version' \ -ex 'python import ghidragdb' \ -ex 'set architecture $OPT_ARCH' \ + -ex 'set endian $OPT_ENDIAN' \ -ex 'file \"$target_image\"' \ -ex 'set args $target_args' \ -ex 'ghidra trace connect \"localhost:$OPT_REMOTE_PORT\"' \ diff --git a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdbserver.bat b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdbserver.bat index e0f990455d..8859c56aea 100644 --- a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdbserver.bat +++ b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdbserver.bat @@ -11,6 +11,7 @@ ::@menu-group remote ::@icon icon.debugger ::@help TraceRmiLauncherServicePlugin#gdb_gdbserver_ssh +::@enum Endian:str auto big little ::@env OPT_TARGET_IMG:str!="" "Image" "The target binary executable image on the remote system" ::@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target" ::@env OPT_SSH_PATH:file="ssh" "ssh command" "The path to ssh on the local system. Omit the full path to resolve using the system PATH." @@ -19,6 +20,8 @@ ::@env OPT_GDBSERVER_PATH:str="gdbserver" "gdbserver command (remote)" "The path to gdbserver on the remote system. Omit the full path to resolve using the system PATH." ::@env OPT_EXTRA_GDBSERVER_ARGS:str="" "Extra gdbserver arguments" "Extra arguments to pass to gdbserver. Use with care." ::@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb on the local system. Omit the full path to resolve using the system PATH." +::@env OPT_ARCH:str="auto" "Architecture" "Target architecture" +::@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order" @echo off set PYTHONPATH0=%GHIDRA_HOME%\Ghidra\Debug\Debugger-agent-gdb\pypkg\src @@ -39,6 +42,8 @@ set PYTHONPATH=%PYTHONPATH1%;%PYTHONPATH0%;%PYTHONPATH% -ex "set confirm off" ^ -ex "show version" ^ -ex "python import ghidragdb" ^ + -ex "set architecture %OPT_ARCH%" ^ + ex "set endian %OPT_ENDIAN%" ^ -ex "target remote | '%OPT_SSH_PATH%' %OPT_EXTRA_SSH_ARGS% '%OPT_HOST%' '%OPT_GDBSERVER_PATH%' %OPT_EXTRA_GDBSERVER_ARGS% - '%OPT_TARGET_IMG%' %OPT_TARGET_ARGS%" ^ -ex "ghidra trace connect '%GHIDRA_TRACE_RMI_ADDR%'" ^ -ex "ghidra trace start" ^ diff --git a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdbserver.sh b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdbserver.sh index 23a686a375..809b64e77d 100755 --- a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdbserver.sh +++ b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/ssh-gdbserver.sh @@ -27,6 +27,7 @@ #@menu-group remote #@icon icon.debugger #@help TraceRmiLauncherServicePlugin#gdb_gdbserver_ssh +#@enum Endian:str auto big little #@arg :str! "Image" "The target binary executable image on the remote system" #@args "Arguments" "Command-line arguments to pass to the target" #@env OPT_SSH_PATH:file!="ssh" "ssh command" "The path to ssh on the local system. Omit the full path to resolve using the system PATH." @@ -35,6 +36,8 @@ #@env OPT_GDBSERVER_PATH:str="gdbserver" "gdbserver command (remote)" "The path to gdbserver on the remote system. Omit the full path to resolve using the system PATH." #@env OPT_EXTRA_GDBSERVER_ARGS:str="" "Extra gdbserver arguments" "Extra arguments to pass to gdbserver. Use with care." #@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb on the local system. Omit the full path to resolve using the system PATH." +#@env OPT_ARCH:str="auto" "Architecture" "Target architecture" +#@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order" if [ -d ${GHIDRA_HOME}/ghidra/.git ] then @@ -55,6 +58,8 @@ fi -ex "set confirm off" \ -ex "show version" \ -ex "python import ghidragdb" \ + -ex "set architecture $OPT_ARCH" \ + -ex "set endian $OPT_ENDIAN" \ -ex "target remote | '$OPT_SSH_PATH' $OPT_EXTRA_SSH_ARGS '$OPT_HOST' '$OPT_GDBSERVER_PATH' $OPT_EXTRA_GDBSERVER_ARGS - $@" \ -ex "ghidra trace connect \"$GHIDRA_TRACE_RMI_ADDR\"" \ -ex "ghidra trace start" \ diff --git a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/wine-gdb.sh b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/wine-gdb.sh index b5ea1cb570..762e5d4234 100755 --- a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/wine-gdb.sh +++ b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/wine-gdb.sh @@ -26,11 +26,13 @@ #@menu-group cross #@icon icon.debugger #@help TraceRmiLauncherServicePlugin#gdb_wine +#@enum Endian:str auto big little #@arg :file! "Image" "The target binary executable image" #@args "Arguments" "Command-line arguments to pass to the target" #@env OPT_WINE_PATH:file="/usr/lib/wine/wine64" "Path to wine binary" "The path to the wine executable for your target architecture." #@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb. Omit the full path to resolve using the system PATH." #@env OPT_ARCH:str="i386:x86-64" "Architecture" "Target architecture" +#@env OPT_ENDIAN:Endian="auto" "Endian" "Target byte order" #@env OPT_EXTRA_TTY:bool=false "Inferior TTY" "Provide a separate terminal emulator for the target." #@tty TTY_TARGET if env:OPT_EXTRA_TTY @@ -56,6 +58,7 @@ fi -ex "show version" \ -ex "python import ghidragdb.wine" \ -ex "set architecture $OPT_ARCH" \ + -ex "set endian $OPT_ENDIAN" \ -ex "file \"$OPT_WINE_PATH\"" \ -ex "set args $@" \ -ex "set inferior-tty $TTY_TARGET" \