Can't Remotely Debug Ubuntu/Eclipse Ubuntu/BeagleBoneBlack

Thank you in advance for your help.

I have been trying to solve this problem non-stop for several days now. I am trying to set up remote debugging for a BeagleBone Blck from Eclpise 3.8.1 on Ubuntu 13.04. I have set up Eclipse to use arm-linux-gnueabihf-gcc etc., and can compile and run helloworld on the BBB.

I have set up Eclipse Debug Profile to use gdb-multiarch. My .gdbinit file contains
set sysroot /
set architecture arm

When I run Debug from Eclipse, it goes to 100% then gives me this message

‘Debug Source Display’ has encountered a problem. An internal error has occurred.
An internal error has occurred.
Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@5cdbf552 rejected from org.eclipse.cdt.dsf.concurrent.DefaultDsfExecutor@4d2aa175[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 956]

The Debug Window shows
[] hello Debug[c/c++ Remote Application]
[v] /home/ubuntu/hello [2012] [cores:0]
[v] Thread[1] 1969[core:0} (Suspended:Signal:SIGSEGV:Segmentation fault)
== 0x7e76
== 0xb6feb0ac
== 0xb6feb0ac
[>] Remote Shell
{Console output}
gdbserver :2345 /home/ubuntu/hello;exit
ubuntu@arm:~$
echo $PWD’>’
/home/ubuntu>
ubuntu@arm:~$ gdbserver :2345 /home/ubuntu/hello;exit
Process /home/ubuntu/hello created; pid = 1969
Listening on port 2345
Remote debugging from host 192.168.0.14

[>] gdb
{Console output}
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.

If I then execute ./hello on the BBB through the terminal window I get the expected !!! Hello World !!! result. If I ls -al I see that, indeed, this is the most recently downloaded program. So if I debug at 11PM, the file shows 11PM as the date of the file.

I have tried reinstalling all my tools, verified everything is the most recent version, etc… I am going crazy because this has to be a simple fix.

I suspect the problem is associated with
warning: Unable to find dynamic linker breakpoint function.

However I do not know for sure. Web searches give me general suggestions as to what I should add to the .gdbinit file, but I do not understand what these suggestions mean in my case.

Please help me.

Thank you

HI,

Which gdb are u using on your BBB ? And Version ?

Which gdb are u using on your ubuntu Machine ? Version ?

I had the same problem as u … really a pain in my ass ^^, but I found the solution here : : http://stackoverflow.com/questions/13269948/need-cross-gdb-for-device

The version running on the BBB is
ubuntu@arm:~$ gdb
GNU gdb (GDB) 7.5.91.20130417-cvs-ubuntu

However, the instructions I followed did not say to run or install gdb on the BBB but install gdbserver
The gdbserver running on the BBB is
GNU gdbserver (GDB) 7.5.91.20130417-cvs-ubuntu

The version running on the PC is
brian@brian-HP-Pavilion-g6-Notebook-PC:~$ gdb-multiarch
GNU gdb (GDB) 7.5.91.20130417-cvs-ubuntu

Thanks

Thank you I am going to try that.

Well,

i wanted to say gdb-server …

Well, I’ve the same version of gdb-server , but i’m not using gdb-multiarch, and i think that is your problem.

mine is :

arm-linux-gnueabihf-gdb --version
GNU gdb (crosstool-NG linaro-1.13.1-4.7-2012.10-20121022 - Linaro GCC 2012.10) 7.5-2012.09
Copyright © 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “–host=i686-build_pc-linux-gnu --target=arm-linux-gnueabihf”.
For bug reporting instructions, please see:
<https://bugs.launchpad.net/gcc-linaro>.

which u can find it here : https://launchpad.net/linaro-toolchain-binaries/trunk/2012.10

Michael Musset,

Thanks for you patience and your help

I downloaded and extracted the files to my usr directory. I did not see an “intall” or “readme” file and I followed the instructions on http://stackoverflow.com/questions/13269948/need-cross-gdb-for-device - I copied the gdbserver file to my BBB and I pointed the debugger to gcc-linaro-arm-linux-gnueabihf-4.7-2012.10-20121022_linux/bin/arm-linux-gnueabihf-gdb

Now, when I try debug, the progress basically hangs at 84%.

When I go to gcc-linaro-arm-linux-gnueabihf-4.7-2012.10-20121022_linux/bin/ and enter ``arm-linux-gnueabihf-gdb I get “command not found”, however when I enter gdb or gdb-multiarch these respective commands work.

Now I know arm-linux-gnueabihf-gdb is there and ls -al shows it is executable.

I am a linux newbie (even though I have a lot of development experience) so I wonder if maybe the debug is not finding it. Is there something I have to do to tell linux this is a valid command path or something?

Thanks again …

Sorry if this is a repeat, but my reply dud not show up for a couple hours.

I think I have done as per directions. I unpacked the files into /usr/gcc-linaro-arm-linux-gnueabihf-4.7-2012.10-20121022_linux and copied gdbserver to the BBB. I know it runs ok on the BBB (I can revert to the prior version if I have to).

I set the debugger path to /usr/gcc-linaro-arm-linux-gnueabihf-4.7-2012.10-20121022_linux/bin/arm-linux-gnueabihf-gdb . Now the system ‘hangs’ at 84%. Here is what is interesting: when I open a shell and type gdb or gdb-multiarch I get the appropriate action, however when I go to /usr/gcc-linaro-arm-linux-gnueabihf-4.7-2012.10-20121022_linux/bin/ and type
arm-linux-gnueabihf-gdb --version
I get
arm-linux-gnueabihf-gdb: command not found

even though I can see it with ls -al
-rwxr-xr-x 1 root root 4258340 Oct 22 2012 ./arm-linux-gnueabihf-gdb

However, when I type
arm-linux-gnueabihf-gcc --version
I get
arm-linux-gnueabihf-gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3

When I do ls -al on -gcc I get
lrwxrwxrwx 1 root root 29 Aug 19 10:32 arm-linux-gnueabihf-gcc → arm-linux-gnueabihf-gcc-4.7.3

The permission for execution on gdb seem ok, but it won’t execute.

This is probably a super-newbie issue

Thanks for your patience …

That is because you are not registered All posts from non members are moderated. If you are expecting fast posting, then please take the time to register. Once you registered, your first post will be moderated and once approved, all further posts will be posted as fast a Google allows it to happen.

Gerald

I think solved my problem!!!

Thank you Thank you Thank you!

I needed to perform additional steps as per https://releases.linaro.org/12.10/components/toolchain/binaries

I had to

sudo apt-get install lsb
sudo apt-get install ia32-libs

in order to get /usr/gcc-linaro-arm-linux-gnueabihf-4.7-2012.10-20121022_linux/bin/arm-linux-gnueabihf-gdb to run.

(perhaps I needed to do only one of those, but I did both)

Once I saw arm-linux-gnueabihf-gdb that ran on the host PC from the terminal, I closed Eclipse, and ran the debug configuration.

It completed with no errors and I ended up with the debugger stopped (with a green bar) after main(). Unfortunately I crash when I step the program, but I now have a different problem to solve than the one I have been working on for several days.

Thank you again.

Once I figure this all out, I will make a complete post of my journey for the next poor newbie.

Thanks! I though I was registered. Will do immediately!

I think I registered by joining this group through my Google account

Yes you do. Sorry i was not there to answer your three posts as fast as you would like. I was busy answering other people’s posts.

Please accept my apology.

Gerald

No problem at all, I just wasn’t sure if I had done something stupid like not clicked post or whatever.

Perhaps the message should be “… moderation - you can speed things up by joining this group” so dopes like me will get the hint :slight_smile:

I will work on my wording. If you read the forum page it says the same thing, of course that is Google’s wording and I can’t change that.

Gerald

Also about that :

I suspect the problem is associated with
warning: Unable to find dynamic linker breakpoint function.

Nop, that is a different story, it’s about linking library information with the debugger ( if you want to debug inside library), but you can let it like that.

I tried to make it work, but looks like that this function is broken, if you want to try: on eclipse you go the the debugger windows configuration, then on the debugger tab, there is the shared libraries tab, click on it, and you will be able to add library.

Michael Musset,

Thank you for the follow up and thanks again for the help.

I have one outstanding and probably minor issue

When I try to execute a function which needs sudo (like fopen() ) I get a NULL pointer. I have been following Dereck Malloy’s video on setting up the Eclipse platform on BBB and he invokes gdbserver manually on the BBB. He gets around that problem by manually invoking

sudo gdbserver …

When I do this, and set Eclipse to use Manual Remote Debugging Launcher everything seems to work ok.

Is this how it should be, or is there a way to configure things so that sudo gdbserver works automatically?

Like I said, this is a minor issue and I deeply appreciate the fact you in a few minutes solved a problem which I spent days on

Thanks again