Remote debugging chicken/egg/one-behind problem [message #1220903] |
Mon, 16 December 2013 03:31 |
Jim Stoll 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!!
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03213 seconds