ghidra
ghidra copied to clipboard
Spaces brake GADP attaching
Describe the bug If there' spaces in the path for the command line, you'll be unable to start the process because it will not find the path.
To Reproduce Steps to reproduce the behavior: 0. Have a path with spaces in it
- Go to the debugger
- Click on debug locally using GADP (I assume the same thing is happening with IN-VM
- See error
Expected behavior It should be able to handle spaces
Attachments If applicable, please attach any files that caused problems or log files generated by the software.
launch_request {
path {
e: "Inferiors"
e: "[1]"
}
argument {
name: "args"
value {
string_value: "/home/viktorh/.steam/debian-installation/steamapps/common/Old School RuneScape/bin/win64/osclient.exe"
}
}
argument {
name: "starti"
value {
bool_value: false
}
}
}
: java.util.concurrent.CompletionException: agent.gdb.manager.impl.cmd.GdbCommandError: <GDB/MI2 -file-exec-and-symbols "/home/viktorh/.steam/debian-installation/steamapps/common/Old"> caused '{msg=[/home/viktorh/.steam/debian-installation/steamapps/common/Old: No such file or directory.]}'
Environment (please complete the following information):
- OS: Ubuntu 22.04
- Java Version: ```openjdk 19.0.2 2023-01-17 OpenJDK Runtime Environment (build 19.0.2+7-Ubuntu-0ubuntu322.04) OpenJDK 64-Bit Server VM (build 19.0.2+7-Ubuntu-0ubuntu322.04, mixed mode, sharing)
- Ghidra Version: 10.3
- Ghidra Origin: GH
@vikke1234 Putting the path in quotes should work. (We could modify the dialog parser to handles spaces, but I don't know how we would distinguish between path spaces and arguments.)
@d-millar I'm not familiar with how Ghidra does this behind the scenes but an idea could be to have two different input fields. One for the path to the program and one for the arguments.
Using double quotes got rid of the error (I had used single quotes earlier which did not work).
Hmmmm, looking back through our git logs, I think we attempted a fix at this problem once before. I will re-open that ticket.
This was addressed in #5203, and I'd argue the double quotes thing is working as designed. I think the problem is that when we construct the command line for the "Quick Launch" button or for the default "Launch" arguments, we're not adding the double quotes ourselves.