ghidra: IN-VM GDB local debugger crashes for ARM toolchain on Windows

Describe the bug The “IN-VM GNU gdb local debugger” option on Windows throws an uncaught exception and does not continue when supplied with the official GNU Arm Embedded Toolchain version of GDB.

To Reproduce Steps to reproduce the behavior:

  1. Install the GNU Arm Embedded Toolchain from the developer.arm.com website. The gcc-arm-none-eabi-10.3-2021.10-win32.exe installer was used. (Link to downloads page, Direct Download Link to installer).
  2. Launch Ghidra.
  3. Import an arm-compiled ELF file into the Ghidra project.
  4. Analyze the ELF using the Ghidra CodeBrowser tool.
  5. Open the analyzed ELF in the Ghidra Debugger tool.
  6. In the “Debugger Targets” pane, click the icon to “Create a new connection to a debugging agent.”
  7. Select “IN-VM GNU gdb local debugger” in the main dropdown.
  8. In the “GDB launch command” entry, type "C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin\arm-none-eabi-gdb.exe" (with quotes)
  9. Leave the “Use existing session via new-ui” box unchecked.
  10. Click Connect.
  11. Ghidra throws “Uncaught Exception! UnsatisfiedLinkError - The specified procedure could not be found.”

Expected behavior The ARM-specific GDB executable should launch within Ghidra, which allows the Debugger tool to debug the binary. (Note, a remote GDB server will be necessary to interface with an arm processor. The command target remote hostname:port would then be given to GDB. However, GDB fails to even launch in this scenario.)

Screenshots Screen Shot 2021-10-29 at 11 37 09 AM

The screenshot above shows the error message. A text file containing the entire contents of the error message is included in the Attachments section below.

Attachments error-output.txt This text file contains the complete text of the error given.

Environment (please complete the following information):

  • OS: Windows 10
  • Java Version: 17.0.1
  • Ghidra Version: 10.0.4
  • Ghidra Origin: official ghidra-sre.org distro

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 27 (14 by maintainers)

Most upvoted comments

Good, I guess - I’d hate to be burned by my own trick. Will drag some extra eyes on the log file tomorrow; see if anyone has a brilliant insight into the current problem.

Interesting - all of that is basically good news, i.e. the necessary commands are supported. So, the initial connection must be failing in some less-than-obvious way that is getting masked by the “show” errors. I will dig into the code some more tomorrow - see if I can re-create your issue.

Yes, we should probably try to validate the input for this. As noted, double-backslashes (or forward slashes) will work.