Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Remote debugging chicken/egg/one-behind problem
Remote debugging chicken/egg/one-behind problem [message #1220903] Mon, 16 December 2013 03:31 Go to next message
Jim Stoll is currently offline Jim StollFriend
Messages: 2
Registered: December 2013
Junior Member
I am using CDT with GDB (gdb-multiarch, specifically) on an Ubuntu host to remotely debug a cross-compiled (using arm-linux-gnueabi) application running on a BeagleBone Black (aka, BBB, running gdbserver on the BBB). I based my config on Derek Molloy's amazing YouTube tutorial, as well as Jason Alexon's incredibliy helpful page.

Things are working (ie, I can upload a cross-compiled binary to the BBB and can remotely step through my program code on the BBB), but I had to do a little script hack to get it to work, and I've not seen reports of anyone else needing to do this, so I'm thinking I must be making it more complicated than it needs to be. I'm using Remote System Explorer to define and use an SSH connection to the BBB for the purpose of uploading the files (integrated in my debug config).

My little 2-line script does a chmod 777 on the uploaded file, then starts the gdbserver process on the BBB, after the file is uploaded and chmod'ed. If I don't invoke this little script (via the 'commands to execute before application' part of my debug config), and instead manually start the gdbserver process on the BBB before trying to debug (which seems to be what everyone else successfully does), I get a message about a failure to upload the file. This is because starting the gdbserver process on the BBB locks the file (verified w/ 'fuser'), and the upload to the BBB fails.

I can start gdbserver on the BBB, *then* delete the binary, which allows the upload from CDT to occur, but of course, gdbserver is already off and running with the old version (ie, before this latest upload) of the program, and the running version of the program doesn't match the version that's been uploaded, and that I'm trying to debug. (This makes perfect sense, but again, I don't see reports of others having this problem.) In this mode, I'm always a version behind, with regard to what's running on the BBB, and what I've uploaded and was hoping to debug from CDT running in my Ubuntu environment.

With the little script, all runs great (at least so far - I haven't tried anything more complicated than stepping through a very basic program, but I can verify that the same version is running that is being debugged! :-)

Thoughts? Suggestions? Am I missing a step or a concept? Am I making things more complicated than they need to be?

If any additional info is needed, and/or if this is the wrong forum in which to ask this question, please let me know.

Thanks!!
Re: Remote debugging chicken/egg/one-behind problem [message #1221053 is a reply to message #1220903] Mon, 16 December 2013 19:27 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
You can use CDT's automatic remote launch, which will upload your binary then start gdbserver for you and connect to it, all in one launch:
http://wiki.eclipse.org/CDT/User/FAQ#How_do_I_debug_a_remote_application.3F

Marc
Re: Remote debugging chicken/egg/one-behind problem [message #1221135 is a reply to message #1221053] Tue, 17 December 2013 00:45 Go to previous message
Jim Stoll is currently offline Jim StollFriend
Messages: 2
Registered: December 2013
Junior Member
Ah, thanks for the prod on that, Marc. I was using that feature, but I'd incorrectly specified the gdbserver name in the debug config - I'd specified the IP of the device, *not* the path of the gdbserver binary on the device. <:-) Your link made me reexamine my settings, and I found the error. Thanks a bunch - working like a charm now!!
Previous Topic:Eclipse cannot be opened...
Next Topic:Complete help files for creating a custom project creation wizard
Goto Forum:
  


Current Time: Fri Apr 26 03:46:20 GMT 2024

Powered by FUDForum. Page generated in 0.03213 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top