gdb and external toolchain
Hello,
I'm using an external toolchain and want to get gdbserver onto my target. I've seen the patch by Thomas that says that gdb host and gdbserver should be provided by the external toolchain and I have set crosstools-ng to build them both.
The question I have is is there any mechanism to copy the gdbserver executable built with crosstools into the target directory. I can't find anything that should be doing this. I can just copy the file over manually but was thinking I should add support for this to buildroot. Any suggestions on how to do this?
Thanks
Will
Signature · 5 lines
------------------------------------------------------------------------ Will Wagner will_wagner at carallon.com Development Manager Office Tel: +44 (0)20 7371 2032 Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA ------------------------------------------------------------------------
Quoted 7 lines · On Mon, 13 Sep 2010 14:30:31 +0100 William Wagner <[email protected]>…
I'm using an external toolchain and want to get gdbserver onto my target. I've seen the patch by Thomas that says that gdb host and gdbserver should be provided by the external toolchain and I have set crosstools-ng to build them both.
The question I have is is there any mechanism to copy the gdbserver executable built with crosstools into the target directory.
Not today.
Quoted 3 lines
I can't find anything that should be doing this. I can just copy the file over manually but was thinking I should add support for this to buildroot. Any suggestions on how to do this?
Doing this is on my todo list (with a few other improvements related to debugging), but I haven't yet thought on how to implement this.
Regards,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Quoted 4 lines · William Wagner
I'm using an external toolchain and want to get gdbserver onto my target. I've seen the patch by Thomas that says that gdb host and gdbserver should be provided by the external toolchain and I have set crosstools-ng to build them both.
As long as they're built from compatible versions of GDB source, it doens't matter who provides what. I use gdbserver built by Buildroot and gdb built by crosstool-ng.
Quoted 5 lines
The question I have is is there any mechanism to copy the gdbserver executable built with crosstools into the target directory. I can't find anything that should be doing this. I can just copy the file over manually but was thinking I should add support for this to buildroot. Any suggestions on how to do this?
Add gdbserver to the files copied in toolchain/external-toolchain/ext-tool.mk?
Signature · 1 line
Grant
Quoted 4 lines · William Wagner
I'm using an external toolchain and want to get gdbserver onto my target. I've seen the patch by Thomas that says that gdb host and gdbserver should be provided by the external toolchain and I have set crosstools-ng to build them both.
Well, the important thing is that they are built using compatible versions. In my opinion, the
easiest way to ensure this, is to have them built together.
Quoted 5 lines
The question I have is is there any mechanism to copy the gdbserver executable built with crosstools into the target directory. I can't find anything that should be doing this. I can just copy the file over manually but was thinking I should add support for this to buildroot. Any suggestions on how to do this?
Thomas and Grant have already given some hints. I've got an old attempt myself, at
http://comments.gmane.org/gmane.comp.lib.uclibc.buildroot/17747, which I've been using ever since in a project. However, there were some valid remarks, especially by Yann in that thread. Remember though, that that patch is for an older version of buildroot.
Regards,
Anders
Thanks for the help. I basically did the same to copy over gdbserver.
I now have a problem where gdb is unable to debug thread creation, it hangs when stepping over pthread_create. Searching on the web I have found various comments that refer you to point 6 in the FAQ at
http://sourceware.org/gdb/wiki/FAQ
It says that gdb needs un stripped libpthread and libthread_db libraries to work. I'm not sure if this is on the target with gdbserver or on the host running gdb. Currently buildroot strips the libraries on the target.
I've never had a problem debugging with an internal buildroot toolchain so presumably buildroot is correct in stripping the libraries on the target. Has anyone seen this before and able to point me in the right direction?
Thanks
Will
Signature · 5 lines
------------------------------------------------------------------------ Will Wagner will_wagner at carallon.com Development Manager Office Tel: +44 (0)20 7371 2032 Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA ------------------------------------------------------------------------
On 2010-09-14, William Wagner <[email protected]> wrote:
[...]
Quoted 5 lines
http://sourceware.org/gdb/wiki/FAQ
It says that gdb needs un stripped libpthread and
libthread_dblibraries to work. I'm not sure if this is on the target with gdbserver or on the host running gdb.
The latter. I've never had any issues debugging stripped libraries and binaries on the target.
Quoted 1 line
Currently buildroot strips the libraries on the target.
That should work fine.
Quoted 3 lines
I've never had a problem debugging with an internal buildroot toolchain so presumably buildroot is correct in stripping the libraries on the target.
Yes.
Quoted 2 lines
Has anyone seen this before and able to point me in the right direction?
The only two things I know about are making sure the libraries are built with debugging symbols, and then making sure gdb can find them (by setting the solib-absolute-prefix option in gdb).
Signature · 4 lines
Grant Edwards grant.b.edwards Yow! I have seen these EGG
at EXTENDERS in my Supermarket
gmail.com ... I have read the
INSTRUCTIONS ...