-
Notifications
You must be signed in to change notification settings - Fork 499
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
SOLUTION FOUND - support remote debug from x86_64 based PC gdb client with gdbgui, to ARM arch gdbserver (multiarch) #237
Comments
@nerael |
I updated gdbgui's docs to be easier to modify for the community. They are all hosted in this repository under |
This solution is somewhat out of date. The API for gdbgui has changed.
trying to modify the tutorial here to match the current API. Here is the command I ultimately end up running.
Here is the content of my
The gui launches but gdb does not load the microprocessor. I think it is because the script does not have the binary being passed to it. GDB input terminal
|
If you want to make a target with cmake that runs the
The above code will call this small script This is the
The above script will call
The last task is to actually create the target that is related to you binary in Cmake.
I don't know if that made any sense.. But at least it might give you an idea of how to do it ... The above code is a bit of a (late afternoon) hack , but it works... |
TLDR - I found a way to make gdbgui work for my usecase described! I'll put the fix at the bottom of the post
Is your feature request related to a problem? Please describe.
I really want to be able to use gdbgui frontend for a multiarch remote debugging usecase. My target system is running gdbserver on an ARM based device. If I try to run
gdbgui
then connect to gdbserver by any means (target remote 192.168.0.212:9091
) I get the following issue:So I believe this issue is that my desktop machine's
gdb
binary is not sufficient for multiarch debugging, so I did:sudo apt-get install gdb-multiarch
on my Ubuntu system. I tried it out just with commandline first, and it works like a charm:gdb-multiarch --eval-command="target remote 192.168.0.212:9091"
Now though, I want to use gdb-multiarch as the debugger binary for gdbgui
gdbgui --gdb gdb-multiarch --gdb-args='--eval-command="target remote 192.168.0.212:9091"'
OR
gdbgui --gdb gdb-multiarch
This method sadly also doesn't work, giving me a different error though:
Describe the solution you'd like
I am not picky, but so long as there's a way to use
gdbgui
to debug a remote gdbserver that's actually running ARM arch instead of matching the desktop architecture would be an absolute dream! (I'd even take a solution from any similar tool to gdbgui, but this one is really quite nice).Describe alternatives you've considered
The closest I've gotten (aside from just using
gdb-multiarch
commandline) is usingddd
but it's ancient and buggy on my modern system.ddd --eval-command="target remote $ADOLOCAL:9091" --debugger gdb-multiarch
This gives some sort of minimal GUI and I've been able to set breakpoints and step through (so it gets further than gdbgui at the moment) -- but it's really clunky, and freezes up constantly.
Additional context
TLDR Solution:
I was trying to rely on a prebuild gdb-multiarch from ubuntu apt repos, which didn't work. When I decided to download gdb and rebuild from source while configuring for arm-linux-gnuabi target arch.
Build method:
arm-linux-gnuabi-gdb
is installed by default to /usr/local/bin ... but you can instead provideprefix=<path>
to where you want it to install in./configure
script aboveUsing this, I was able to build a secondary copy of gdb called
arm-linux-gnuabi-gdb
which i could feed to gdbgui like this:gdbgui -g arm-linux-gnuabi-gdb
Works great! This is leaps and bounds better than running gdb on commandline on my remote target.
Relevant link for building gdb:
https://sourceware.org/gdb/wiki/BuildingCrossGDBandGDBserver
http://www.brain-dump.org/blog/entry/138/Cross_Arch_Remote_Debugging_with_gdb_and_gdbserver
The text was updated successfully, but these errors were encountered: