-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ghidra Debugger GDB IN VM and GDB via GADB #5766
Comments
@MinhPham123456789 We might need a little more context on this one.... You said running gdb directly in the terminal works - am assuming you're doing something like "gdb"/"file mytarget"/"run", yes? When you run your target in Ghidra, how are you doing it? Are you launching from the main toolbar or from Objects? Is the target launching? Where are you seeing that error - DebugConsole, Interpreter window, terminal where Ghidra is executing? Does the error terminate the process, the debugging session, etc.? Have you tried starting the IN-VM version and then doing "file mytarget"/"run" from thr Interpreter? |
When I debug the program directly using GDB via a terminal, it works normally so yes the commands were
When I switched to Ghidra, I imported the program and opened it in Debugger mode. Then I tried both GDB IN VM and via GADB, and they gave the same error as mentioned earlier. The error was in the Interpreter window, where the gdb displayed the result. The target program was launched and printed out some output before the error. The error terminates the process in gdb in the interpreter window. |
@MinhPham123456789 Ah, you hit the nail on the head. The Pty used by the Interpreter doesn't really share well with others. So, several approaches: First, @nsadeveloper789 recommends reading the Debugger Course, Section B1, for what is definitely a better description of the debugger workings than I am about to provide. He also recommends the following options in order of preference/ease-of-use/lack-of-hackiness. Option 1: Use the debugger to attach to the process, rather than launch it directly. The benefits here are probably obvious, and, given the target waits for input, attaching shouldn't be difficult. Option 2: Use the "new-ui" feature of gdb.
Option 3: Run your target using gdbserver and "target remote" to connect to the server. This may result in duplicate modules in the GUI, so it's less than ideal. Let us know if you need more details on any of these options or are having trouble getting them to work! |
Thank you very much @d-millar |
I am trying to run a program in Ghidra debugger using GDB via IN VM or GADB.
At first, there is an error like this:
Then I use the
dir
command in "gdb" to add the path to glibc source code I installed separately on my computer so it can go to the read.c. However, there is another error appearsI thought this may be because the program being drugged so I ran gdb directly in the terminal and launch the program but it works normally
I am using Kali Linux 2022 as the OS and Ghidra is the latest one 10.3.3
Does anyone know how to resolve this one?
Thank you very much
The text was updated successfully, but these errors were encountered: