From 90f37252466af8b5a64ba2d9032bf090c34c605f Mon Sep 17 00:00:00 2001 From: Dan <46821332+nsadeveloper789@users.noreply.github.com> Date: Thu, 23 May 2024 09:01:30 -0400 Subject: [PATCH] GP-4617: Moving most documentation from connectors to Help. --- .../data/debugger-launchers/local-dbgeng.bat | 13 +- .../data/debugger-launchers/local-ttd.bat | 13 +- .../data/debugger-launchers/local-gdb.sh | 9 +- .../data/debugger-launchers/qemu-gdb.sh | 14 +- .../data/debugger-launchers/raw-gdb.sh | 12 +- .../data/debugger-launchers/remote-gdb.sh | 17 +- .../data/debugger-launchers/ssh-gdb.sh | 19 +- .../data/debugger-launchers/ssh-gdbserver.sh | 18 +- .../data/debugger-launchers/wine-gdb.sh | 19 +- .../data/debugger-launchers/local-lldb.sh | 9 +- .../data/debugger-launchers/remote-lldb.sh | 15 +- .../data/debugger-launchers/raw-python3.sh | 9 +- .../TraceRmiLauncherServicePlugin.html | 359 ++++++++++++++---- .../images/GdbLauncher.png | Bin 17742 -> 14541 bytes .../launcher/AbstractTraceRmiLaunchOffer.java | 3 +- .../launcher/LaunchFailureDialog.java | 8 +- 16 files changed, 360 insertions(+), 177 deletions(-) diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/data/debugger-launchers/local-dbgeng.bat b/Ghidra/Debug/Debugger-agent-dbgeng/data/debugger-launchers/local-dbgeng.bat index 4ce4b27a3a3..171590c9613 100644 --- a/Ghidra/Debug/Debugger-agent-dbgeng/data/debugger-launchers/local-dbgeng.bat +++ b/Ghidra/Debug/Debugger-agent-dbgeng/data/debugger-launchers/local-dbgeng.bat @@ -1,21 +1,20 @@ ::@title dbgeng ::@desc ::@desc

Launch with dbgeng (in a Python interpreter)

-::@desc

This will launch the target on the local machine using dbgeng.dll. Typically, -::@desc Windows systems have this library pre-installed, but it may have limitations, e.g., you -::@desc cannot use .server. For the full capabilities, you must install WinDbg.

-::@desc

Furthermore, you must have Python 3 installed on your system, and it must have the -::@desc pybag and protobuf packages installed.

+::@desc

+::@desc This will launch the target on the local machine using dbgeng.dll. +::@desc For setup instructions, press F1. +::@desc

::@desc ::@menu-group local ::@icon icon.debugger ::@help TraceRmiLauncherServicePlugin#dbgeng -::@env OPT_PYTHON_EXE:str="python" "Path to python" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH." +::@env OPT_PYTHON_EXE:str="python" "Python command" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH." :: Use env instead of args, because "all args except first" is terrible to implement in batch ::@env OPT_TARGET_IMG:str="" "Image" "The target binary executable image" ::@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target" ::@env OPT_USE_DBGMODEL:bool=true "Use dbgmodel" "Load and use dbgmodel.dll if it is available." -::@env WINDBG_DIR:str="" "Path to dbgeng" "Path to dbgeng and associated DLLS (if not Windows Kits)." +::@env WINDBG_DIR:str="" "Path to dbgeng.dll directory" "Path containing dbgeng and associated DLLS (if not Windows Kits)." @echo off diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/data/debugger-launchers/local-ttd.bat b/Ghidra/Debug/Debugger-agent-dbgeng/data/debugger-launchers/local-ttd.bat index 37cfc06fbb0..693f7c67c88 100644 --- a/Ghidra/Debug/Debugger-agent-dbgeng/data/debugger-launchers/local-ttd.bat +++ b/Ghidra/Debug/Debugger-agent-dbgeng/data/debugger-launchers/local-ttd.bat @@ -1,21 +1,20 @@ ::@title ttd ::@desc ::@desc

Launch with ttd (in a Python interpreter)

-::@desc

This will launch the target on the local machine using dbgeng.dll. Typically, -::@desc Windows systems have this library pre-installed, but it may have limitations, e.g., you -::@desc cannot use .server. For the full capabilities, you must install WinDbg.

-::@desc

Furthermore, you must have Python 3 installed on your system, and it must have the -::@desc pybag and protobuf packages installed.

+::@desc

+::@desc This will launch the target on the local machine for time-travel debugging. +::@desc For setup instructions, press F1. +::@desc

::@desc ::@menu-group local ::@icon icon.debugger ::@help TraceRmiLauncherServicePlugin#dbgeng_ttd -::@env OPT_PYTHON_EXE:str="python" "Path to python" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH." +::@env OPT_PYTHON_EXE:str="python" "Python command" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH." :: Use env instead of args, because "all args except first" is terrible to implement in batch ::@env OPT_TARGET_IMG:str="" "Trace (.run)" "A trace associated with the target binary executable" ::@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target" ::@env OPT_USE_DBGMODEL:bool=true "Use dbgmodel" "Load and use dbgmodel.dll if it is available." -::@env OPT_DBGMODEL_PATH:str="" "Path to dbgeng & \\ttd" "Path to dbgeng and associated DLLS (if not Windows Kits)." +::@env OPT_DBGMODEL_PATH:str="" "Path to dbgeng.dll & \\ttd" "Path containing dbgeng and associated DLLS (if not Windows Kits)." @echo off 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 74a4099743f..9f9f91374a3 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 @@ -17,9 +17,10 @@ #@title gdb #@desc #@desc

Launch with gdb

-#@desc

This will launch the target on the local machine using gdb. GDB must already -#@desc be installed on your system, and it must embed the Python 3 interpreter. You will also -#@desc need protobuf and psutil installed for Python 3.

+#@desc

+#@desc This will launch the target on the local machine using gdb. +#@desc For setup instructions, press F1. +#@desc

#@desc #@menu-group local #@icon icon.debugger @@ -27,7 +28,7 @@ #@enum StartCmd:str run start starti #@arg :str "Image" "The target binary executable image" #@args "Arguments" "Command-line arguments to pass to the target" -#@env OPT_GDB_PATH:str="gdb" "Path to gdb" "The path to gdb. Omit the full path to resolve using the system PATH." +#@env OPT_GDB_PATH:str="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_EXTRA_TTY:bool=false "Inferior TTY" "Provide a separate terminal emulator for the target." #@tty TTY_TARGET if env:OPT_EXTRA_TTY 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 ed484193579..924a151d0e6 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 @@ -17,21 +17,21 @@ #@title qemu + gdb #@desc #@desc

Launch with qemu and connect with gdb

-#@desc

This will launch the target on the local machine using qemu. Then in a second -#@desc terminal, it will connect gdb to QEMU's GDBstub. -#@desc GDB must already be installed on your system, it must support your target architecture -#@desc (you may install gdb-multiarch), and it must embed the Python 3 interpreter. You -#@desc will also need protobuf installed for Python 3. +#@desc

+#@desc This will launch the target on the local machine using qemu. +#@desc Then in a second terminal, it will connect gdb to QEMU's GDBstub. +#@desc For setup instructions, press F1. +#@desc

#@desc #@menu-group cross #@icon icon.debugger #@help TraceRmiLauncherServicePlugin#gdb_qemu #@arg :str "Image" "The target binary executable image" #@args "Arguments" "Command-line arguments to pass to the target" -#@env GHIDRA_LANG_EXTTOOL_qemu:str="" "Path to qemu" "The path to qemu for the target architecture." +#@env GHIDRA_LANG_EXTTOOL_qemu:str="" "QEMU command" "The path to qemu for the target architecture." #@env QEMU_GDB:int=12345 "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:str="gdb-multiarch" "Path to gdb" "The path to gdb. Omit the full path to resolve using the system PATH." +#@env OPT_GDB_PATH:str="gdb-multiarch" "gdb command" "The path to gdb. Omit the full path to resolve using the system PATH." #@env OPT_EXTRA_TTY:bool=false "QEMU TTY" "Provide a separate terminal emulator for the target." #@tty TTY_TARGET if env:OPT_EXTRA_TTY diff --git a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/raw-gdb.sh b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/raw-gdb.sh index 37779af3e3f..5b572354e57 100755 --- a/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/raw-gdb.sh +++ b/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/raw-gdb.sh @@ -18,16 +18,16 @@ #@no-image #@desc #@desc

Start gdb

-#@desc

This will start gdb and connect to it. It will not launch -#@desc a target, so you can (must) set up your target manually. -#@desc GDB must already -#@desc be installed on your system, and it must embed the Python 3 interpreter. You will also -#@desc need protobuf and psutil installed for Python 3.

+#@desc

+#@desc This will start gdb and connect to it. +#@desc It will not launch a target, so you can (must) set up your target manually. +#@desc For setup instructions, press F1. +#@desc

#@desc #@menu-group raw #@icon icon.debugger #@help TraceRmiLauncherServicePlugin#gdb_raw -#@env OPT_GDB_PATH:str="gdb" "Path to gdb" "The path to gdb. Omit the full path to resolve using the system PATH." +#@env OPT_GDB_PATH:str="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" if [ -d ${GHIDRA_HOME}/ghidra/.git ] 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 76af6bdcfd2..29d80336abe 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 @@ -18,25 +18,20 @@ #@no-image #@desc #@desc

Launch with local gdb and connect to a stub (e.g., gdbserver)

-#@desc

This will start gdb on the local system and then use it to connect to the remote system. -#@desc The actual command used is, e.g:

-#@desc
target remote host:port
-#@desc

It may be worth testing this manually to ensure everything is configured correctly. -#@desc GDB must be installed on your local system, it must be compatible with the remote system, -#@desc and it must embed the Python 3 interpreter. You will also need protobuf installed -#@desc for Python 3 on the local system. There are no Python requirements for the remote system. -#@desc Please ensure that Ghidra's current program and the target's image match. Otherwise, the -#@desc modules may not map.

+#@desc

+#@desc This will start gdb on the local system and then use it to connect to the remote system. +#@desc For setup instructions, press F1. +#@desc

#@desc #@menu-group remote #@icon icon.debugger -#@help TraceRmiLauncherServicePlugin#gdb +#@help TraceRmiLauncherServicePlugin#gdb_remote #@enum TargetType:str remote extended-remote #@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:str="9999" "Port" "The host's listening port" #@env OPT_ARCH:str="" "Architecture (optional)" "Target architecture override" -#@env OPT_GDB_PATH:str="gdb" "Path to gdb" "The path to gdb on the local system. Omit the full path to resolve using the system PATH." +#@env OPT_GDB_PATH:str="gdb" "gdb command" "The path to gdb on the local system. Omit the full path to resolve using the system PATH." if [ -d ${GHIDRA_HOME}/ghidra/.git ] then 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 6ccb89e34b4..9c455de2277 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 @@ -18,19 +18,10 @@ #@title gdb via ssh #@desc #@desc

Launch with gdb via ssh

-#@desc

This will launch the target on a remote machine using gdb via ssh. -#@desc GDB and an SSH server must already be installed and operational on the remote system, and -#@desc GDB must embed the Python 3 interpreter. The remote SSH server must be configured to allow -#@desc remote port forwarding. You will also need to install the following for GDB's embedded -#@desc version of Python:

-#@desc +#@desc

+#@desc This will launch the target on a remote machine using gdb via ssh. +#@desc For setup instructions, press F1. +#@desc

#@desc #@menu-group remote #@icon icon.debugger @@ -41,7 +32,7 @@ #@env OPT_HOST:str="localhost" "[User@]Host" "The hostname or user@host" #@env OPT_REMOTE_PORT:int=12345 "Remote Trace RMI Port" "A free port on the remote end to receive and forward the Trace RMI connection." #@env OPT_EXTRA_SSH_ARGS:str="" "Extra ssh arguments" "Extra arguments to pass to ssh. Use with care." -#@env OPT_GDB_PATH:str="gdb" "Path to gdb" "The path to gdb on the remote system. Omit the full path to resolve using the system PATH." +#@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="start" "Run command" "The gdb command to actually run the target." target_image="$1" 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 4185dac8c0f..cf47498d806 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 @@ -18,16 +18,10 @@ #@title gdb + gdbserver via ssh #@desc #@desc

Launch with local gdb and gdbserver via ssh

-#@desc

This will start gdb on the local system and then use it to connect and launch -#@desc the target in gdbserver on the remote system via ssh. The actual command -#@desc used is, e.g:

-#@desc
target remote | ssh user@host gdbserver - /path/to/image
-#@desc

It may be worth testing this manually to ensure everything is configured correctly. An -#@desc SSH server and gdbserver must already be installed and operational on the remote -#@desc system. GDB must be installed on your local system, it must be compatible with the -#@desc gdbserver on the remote system, and it must embed the Python 3 interpreter. You -#@desc will also need protobuf installed for Python 3 on the local system. There are no -#@desc Python requirements for the remote system.

+#@desc

+#@desc This will start gdb on the local system and then use it to connect and launch the target in gdbserver on the remote system via ssh. +#@desc For setup instructions, press F1. +#@desc

#@desc #@menu-group remote #@icon icon.debugger @@ -36,9 +30,9 @@ #@args "Arguments" "Command-line arguments to pass to the target" #@env OPT_HOST:str="localhost" "[User@]Host" "The hostname or user@host" #@env OPT_EXTRA_SSH_ARGS:str="" "Extra ssh arguments" "Extra arguments to pass to ssh. Use with care." -#@env OPT_GDBSERVER_PATH:str="gdbserver" "Path to gdbserver (remote)" "The path to gdbserver on the remote system. Omit the full path to resolve using the system PATH." +#@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:str="gdb" "Path to gdb" "The path to gdb on the local system. Omit the full path to resolve using the system PATH." +#@env OPT_GDB_PATH:str="gdb" "gdb command" "The path to gdb on the local system. Omit the full path to resolve using the system PATH." if [ -d ${GHIDRA_HOME}/ghidra/.git ] then 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 f1eaf81905a..5a37621166e 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 @@ -17,19 +17,10 @@ #@title wine + gdb #@desc #@desc

Launch with gdb and wine

-#@desc

This will launch the target on the local machine using gdb and wine. -#@desc GDB and Wine must already be installed on your system, and GDB must embed the Python 3 -#@desc interpreter. You will also need protobuf and psutil installed for Python -#@desc 3.

-#@desc

This operates by starting GDB on the Wine executable and passing arguments to launch a -#@desc Windows target. This may prevent GDB from processing the object file, because it is a PE -#@desc file, and most copies of GDB for UNIX will support only ELF. Nevertheless, Ghidra should -#@desc recognize the target and map it, giving you symbols and debug info in the front end, even -#@desc if not in the GDB CLI.

-#@desc

You will need to locate the wine executable, not the script, on your system. To -#@desc find it, either dissect the wine script or consult online documentation for your -#@desc distribution of Wine. There are often two executables, one for 32-bit targets and one for -#@desc 64-bit targets. You must select the correct one.

+#@desc

+#@desc This will launch the target on the local machine using gdb and wine. +#@desc For setup instructions, press F1. +#@desc

#@desc #@menu-group cross #@icon icon.debugger @@ -37,7 +28,7 @@ #@arg :str "Image" "The target binary executable image" #@args "Arguments" "Command-line arguments to pass to the target" #@env OPT_WINE_PATH:str="/usr/lib/wine/wine64" "Path to wine binary" "The path to the wine executable for your target architecture." -#@env OPT_GDB_PATH:str="gdb" "Path to gdb" "The path to gdb. Omit the full path to resolve using the system PATH." +#@env OPT_GDB_PATH:str="gdb" "gdb command" "The path to gdb. Omit the full path to resolve using the system PATH." #@env OPT_EXTRA_TTY:bool=false "Inferior TTY" "Provide a separate terminal emulator for the target." #@tty TTY_TARGET if env:OPT_EXTRA_TTY diff --git a/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/local-lldb.sh b/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/local-lldb.sh index 3b6f364c577..d94d836d103 100755 --- a/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/local-lldb.sh +++ b/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/local-lldb.sh @@ -17,9 +17,10 @@ #@title lldb #@desc #@desc

Launch with lldb

-#@desc

This will launch the target on the local machine using lldb. LLDB must already -#@desc be installed on your system, and it must embed the Python 3 interpreter. You will also -#@desc need protobuf and psutil installed for Python 3.

+#@desc

+#@desc This will launch the target on the local machine using lldb. +#@desc For setup instructions, press F1. +#@desc

#@desc #@menu-group local #@icon icon.debugger @@ -27,7 +28,7 @@ #@enum StartCmd:str "process launch" "process launch --stop-at-entry" #@arg :str "Image" "The target binary executable image" #@args "Arguments" "Command-line arguments to pass to the target" -#@env OPT_LLDB_PATH:str="lldb" "Path to lldb" "The path to lldb. Omit the full path to resolve using the system PATH." +#@env OPT_LLDB_PATH:str="lldb" "lldb command" "The path to lldb. Omit the full path to resolve using the system PATH." #@env OPT_START_CMD:StartCmd="process launch" "Run command" "The lldb command to actually run the target." #@env OPT_EXTRA_TTY:bool=false "Target TTY" "Provide a separate terminal emulator for the target." #@tty TTY_TARGET if env:OPT_EXTRA_TTY diff --git a/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/remote-lldb.sh b/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/remote-lldb.sh index 84d0b3f94ac..c7ac062620f 100755 --- a/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/remote-lldb.sh +++ b/Ghidra/Debug/Debugger-agent-lldb/data/debugger-launchers/remote-lldb.sh @@ -18,15 +18,10 @@ #@no-image #@desc #@desc

Launch with local lldb and connect to a stub (e.g., gdbserver)

-#@desc

This will start lldb on the local system and then use it to connect to the remote system. -#@desc The actual command used is, e.g:

-#@desc
gdb-remote host:port
-#@desc

It may be worth testing this manually to ensure everything is configured correctly. -#@desc LLDB must be installed on your local system, it must be compatible with the remote system, -#@desc and it must embed the Python 3 interpreter. You will also need protobuf installed -#@desc for Python 3 on the local system. There are no Python requirements for the remote system. -#@desc Please ensure that Ghidra's current program and the target's image match. Otherwise, the -#@desc modules may not map.

+#@desc

+#@desc This will start lldb on the local system and then use it to connect to the remote system. +#@desc For setup instructions, press F1. +#@desc

#@desc #@menu-group remote #@icon icon.debugger @@ -34,7 +29,7 @@ #@env OPT_HOST:str="localhost" "Host" "The hostname of the target" #@env OPT_PORT:str="9999" "Port" "The host's listening port" #@env OPT_ARCH:str="" "Architecture" "Target architecture override" -#@env OPT_LLDB_PATH:str="lldb" "Path to lldb" "The path to lldb on the local system. Omit the full path to resolve using the system PATH." +#@env OPT_LLDB_PATH:str="lldb" "lldb command" "The path to lldb on the local system. Omit the full path to resolve using the system PATH." if [ -d ${GHIDRA_HOME}/ghidra/.git ] then diff --git a/Ghidra/Debug/Debugger-rmi-trace/data/debugger-launchers/raw-python3.sh b/Ghidra/Debug/Debugger-rmi-trace/data/debugger-launchers/raw-python3.sh index 823881931d6..bdc3eb8ac10 100755 --- a/Ghidra/Debug/Debugger-rmi-trace/data/debugger-launchers/raw-python3.sh +++ b/Ghidra/Debug/Debugger-rmi-trace/data/debugger-launchers/raw-python3.sh @@ -19,14 +19,15 @@ #@no-image #@desc #@desc

Start gdb

-#@desc

This will start python, import ghidratrace and connect to it. -#@desc This connector is made for those wanting to explore the TraceRMI API and possibly develop -#@desc a new connector. You will need protobuf installed for Python 3.

+#@desc

+#@desc This will start python, import ghidratrace and connect to it for development purposes. +#@desc For setup instructions, press F1. +#@desc

#@desc #@menu-group raw #@icon icon.debugger #@help TraceRmiLauncherServicePlugin#python_raw -#@env OPT_PYTHON_EXE:str="python" "Path to python" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH." +#@env OPT_PYTHON_EXE:str="python" "python command" "The path to the Python 3 interpreter. Omit the full path to resolve using the system PATH." #@env OPT_LANG:str="DATA:LE:64:default" "Ghidra Language" "The Ghidra LanguageID for the trace" #@env OPT_COMP:str="pointer64" "Ghidra Compiler" "The Ghidra CompilerSpecID for the trace" diff --git a/Ghidra/Debug/Debugger-rmi-trace/src/main/help/help/topics/TraceRmiLauncherServicePlugin/TraceRmiLauncherServicePlugin.html b/Ghidra/Debug/Debugger-rmi-trace/src/main/help/help/topics/TraceRmiLauncherServicePlugin/TraceRmiLauncherServicePlugin.html index cc90ae864a8..ca64099f65d 100644 --- a/Ghidra/Debug/Debugger-rmi-trace/src/main/help/help/topics/TraceRmiLauncherServicePlugin/TraceRmiLauncherServicePlugin.html +++ b/Ghidra/Debug/Debugger-rmi-trace/src/main/help/help/topics/TraceRmiLauncherServicePlugin/TraceRmiLauncherServicePlugin.html @@ -105,21 +105,57 @@

GDB

properly-configured build of GDB for your target. If you are working with an embedded system, it is probably safest to install the "multiarch" build of GDB from your package manager.

-

Once running, you are presented with GDB's command-line interface in Ghidra's Terminal. This - is the bona fide GDB command-line interface, so it has all the functionality you would - expect. If you command GDB from this shell, the plugin will keep Ghidra in sync. The terminal - can also be used to interact with the target application when it is running. The plugin - provides an additional set of commands for managing the connection to Ghidra, as well as - controlling trace synchronization. These are all in the "ghidra" command prefix. You - can use tab completion to enumerate the available commands and GDB's "help" command to - examine their documentation.

+

Setup

+ +

You must have GDB installed on the local system, and it must embed the Python 3 interpreter. + If you have access to PyPI, setting up your Python 3 environment is done using Pip. Please note + the version specifier for Protobuf.

+ + + +

If you are offline, or would like to use our provided packages, we still use Pip, but with a + more complicated invocation:

+ + + +

Beware that GDB may embed a different Python interpreter than your system's default. If you + are still getting import errors, check the version that GDB embeds:

+ + + +

Note the version and ensure that you are invoking Pip with that version. Supposing + sys.version indicates 3.10, you should invoke Pip using python3.10 -m + pip.

+ +

Options

-

Options

- +

Once running, you are presented with GDB's command-line interface in Ghidra's Terminal. This + is the bona fide GDB command-line interface, so it has all the functionality you would + expect. If you command GDB from this shell, the plugin will keep Ghidra in sync. The terminal + can also be used to interact with the target application when it is running. The plugin + provides an additional set of commands for managing the connection to Ghidra, as well as + controlling trace synchronization. These are all in the "ghidra" command prefix. You + can use tab completion to enumerate the available commands and GDB's "help" command to + examine their documentation.

+

GDB via SSH

This works the same as the GDB launcher, but runs gdb on a remote system via @@ -152,10 +197,30 @@

GDB via SSH

launcher uses the ssh command on the local system. Thus, it should have broader compatibility with remote systems, and it should use the same configuration files as you are accustomed to. That said, we developed it using OpenSSH, so your experience will be best if - your copy understands the same command-line arguments. It will need to be capable of port - forwarding. The remote server must permit remote port forwarding (-R option) and terminal - allocation (-t option). You will also need to manually install the required Python - packages on the target host, comprising our plugin for GDB and its dependencies.

+ your copy understands the same command-line arguments.

+ +

Setup

+ +

You must install GDB and an SSH server onto the target host. Your local SSH client must + support remote port forwarding (-R option) and terminal allocation (-t option), and + the remote server must be configured to permit them.

+ +

You will need to manually install the required Python packages on the target host, + comprising our plugin for GDB and its dependencies. Copy all of the Python packages from + Ghidra/Debug/Debugger-rmi-trace/pypkg/dist/ and + Ghidra/Debug/Debugger-agent-gdb/pypkg/dist/ to the remote system. It is easiest to put + them all in one directory, e.g., ~/ghidra-pypgk/. Then install them:

+ + + +

Please see GDB Setup for notes about embedded Python interpreter + versions.

Options

@@ -184,7 +249,7 @@

Options

that syntax errors may cause strange behavior, and that not all features may be compatible with this launcher. -
  • Path to gdb: This works the same as in GDB, but with respect to the +
  • gdb command: This works the same as in GDB, but with respect to the remote file system.
  • Run command: This works the same as in GDB.
  • @@ -195,8 +260,9 @@

    Options

    GDB + gdbserver via SSH

    This works similarly to the GDB via SSH launcher, but instead of tunneling the Trace RMI - connection, tunnels the RSP (gdbserver) connection. There is actually a fairly elegant method - of doing this straight from within gdb, which is exactly what this launcher does:

    + connection, tunnels the RSP (gdbserver) connection. There is actually a fairly elegant + method of doing this straight from within gdb, which is exactly what this launcher + does: