Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] gdb and external toolchain
@ 2010-09-13 13:30 William Wagner
  2010-09-13 14:01 ` Thomas Petazzoni
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: William Wagner @ 2010-09-13 13:30 UTC (permalink / raw)
  To: buildroot

  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

-- 
------------------------------------------------------------------------
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
------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] gdb and external toolchain
  2010-09-13 13:30 [Buildroot] gdb and external toolchain William Wagner
@ 2010-09-13 14:01 ` Thomas Petazzoni
  2010-09-13 14:32 ` Grant Edwards
  2010-09-13 18:37 ` Anders Darander
  2 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2010-09-13 14:01 UTC (permalink / raw)
  To: buildroot

On Mon, 13 Sep 2010 14:30:31 +0100
William Wagner <will_wagner@carallon.com> wrote:

> 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.

> 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
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] gdb and external toolchain
  2010-09-13 13:30 [Buildroot] gdb and external toolchain William Wagner
  2010-09-13 14:01 ` Thomas Petazzoni
@ 2010-09-13 14:32 ` Grant Edwards
  2010-09-13 18:37 ` Anders Darander
  2 siblings, 0 replies; 6+ messages in thread
From: Grant Edwards @ 2010-09-13 14:32 UTC (permalink / raw)
  To: buildroot

On 2010-09-13, William Wagner <will_wagner@carallon.com> wrote:

> 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.

> 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?

-- 
Grant

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] gdb and external toolchain
  2010-09-13 13:30 [Buildroot] gdb and external toolchain William Wagner
  2010-09-13 14:01 ` Thomas Petazzoni
  2010-09-13 14:32 ` Grant Edwards
@ 2010-09-13 18:37 ` Anders Darander
  2010-09-14 13:38   ` William Wagner
  2 siblings, 1 reply; 6+ messages in thread
From: Anders Darander @ 2010-09-13 18:37 UTC (permalink / raw)
  To: buildroot

On Mon, Sep 13, 2010 at 15:30, William Wagner <will_wagner@carallon.com> wrote:
> 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.

> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] gdb and external toolchain
  2010-09-13 18:37 ` Anders Darander
@ 2010-09-14 13:38   ` William Wagner
  2010-09-14 14:20     ` Grant Edwards
  0 siblings, 1 reply; 6+ messages in thread
From: William Wagner @ 2010-09-14 13:38 UTC (permalink / raw)
  To: buildroot

  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

-- 
------------------------------------------------------------------------
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
------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] gdb and external toolchain
  2010-09-14 13:38   ` William Wagner
@ 2010-09-14 14:20     ` Grant Edwards
  0 siblings, 0 replies; 6+ messages in thread
From: Grant Edwards @ 2010-09-14 14:20 UTC (permalink / raw)
  To: buildroot

On 2010-09-14, William Wagner <will_wagner@carallon.com> wrote:

[...]
> 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.

The latter.  I've never had any issues debugging stripped libraries 
and binaries on the target.

> Currently buildroot strips the libraries on the target.

That should work fine.

> 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.

> 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).

-- 
Grant Edwards               grant.b.edwards        Yow! I have seen these EGG
                                  at               EXTENDERS in my Supermarket
                              gmail.com            ... I have read the
                                                   INSTRUCTIONS ...

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-09-14 14:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-13 13:30 [Buildroot] gdb and external toolchain William Wagner
2010-09-13 14:01 ` Thomas Petazzoni
2010-09-13 14:32 ` Grant Edwards
2010-09-13 18:37 ` Anders Darander
2010-09-14 13:38   ` William Wagner
2010-09-14 14:20     ` Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox