* [Buildroot] gdbserver with external crosstool
@ 2012-08-23 8:45 Aras Vaichas
2012-08-24 9:34 ` Thomas Petazzoni
0 siblings, 1 reply; 3+ messages in thread
From: Aras Vaichas @ 2012-08-23 8:45 UTC (permalink / raw)
To: buildroot
I've got a question about building gdbserver when an external
toolchain is selected.
in toolchain/gdb/Config.in:
config BR2_PACKAGE_GDB_SERVER
bool "Build gdb server for the Target"
depends on !BR2_TOOLCHAIN_EXTERNAL
help
Build the gdbserver stub to run on the target.
A full gdb is needed to debug the progam.
Why doesn't Buildroot build gdbserver when an external toolchain is selected?
I noticed that both gdbserver and gdb are built (with the external
toolchain) by Buildroot, but only gdb is copied over to the target.
I see that BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY allows the gdbserver
from the external toolchain to be copied over.
So why doesn't Buildroot allow me to copy over the gdbserver that I
built within Buildroot?
Aras Vaichas
^ permalink raw reply [flat|nested] 3+ messages in thread* [Buildroot] gdbserver with external crosstool 2012-08-23 8:45 [Buildroot] gdbserver with external crosstool Aras Vaichas @ 2012-08-24 9:34 ` Thomas Petazzoni 2012-08-24 10:22 ` Aras Vaichas 0 siblings, 1 reply; 3+ messages in thread From: Thomas Petazzoni @ 2012-08-24 9:34 UTC (permalink / raw) To: buildroot Hello, Le Thu, 23 Aug 2012 09:45:35 +0100, Aras Vaichas <aras.vaichas@gmail.com> a ?crit : > I've got a question about building gdbserver when an external > toolchain is selected. > > in toolchain/gdb/Config.in: > > config BR2_PACKAGE_GDB_SERVER > bool "Build gdb server for the Target" > depends on !BR2_TOOLCHAIN_EXTERNAL > help > Build the gdbserver stub to run on the target. > A full gdb is needed to debug the progam. > > Why doesn't Buildroot build gdbserver when an external toolchain is selected? Because for external toolchains, we assume that the gdbserver must be provided by the external toolchain, together with the cross-gdb. There are two reasons: 1. Most pre-built external toolchains available out there provide both their own cross-gdb and gdbserver, so it makes sense to use them. 2. Experience has shown that if there is a version difference between the cross-gdb and the gdbserver, there are often problems. Therefore, we really want people using external toolchains to use the provided gdbserver with their external toolchain rather than build their own. > I noticed that both gdbserver and gdb are built (with the external > toolchain) by Buildroot, but only gdb is copied over to the target. I'm a bit confused: are you talking about the cross gdb or the target gdb? When using an external toolchain, what we except people to do is: *) Use the cross-gdb provided pre-built by their external toolchain *) Use the BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY option so that the gdbserver provided pre-built by their external toolchain is copied to the target filesystem *) Optionally (but not really useful or recommended), they can enable the gdb package, which will build a full-blown gdb for the target, installed in the target filesystem. But that's a completely different thing than cross-gdb+gdbserver. > I see that BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY allows the gdbserver > from the external toolchain to be copied over. Yes. > So why doesn't Buildroot allow me to copy over the gdbserver that I > built within Buildroot? I'm confused again. Can you explain what you're doing exactly? In the previous paragraph, you precisely said that there was an option to copy gdbserver to the target filesystem, and now you're saying that there isn't such an option. Are you talking about two different configurations maybe? Best 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] 3+ messages in thread
* [Buildroot] gdbserver with external crosstool 2012-08-24 9:34 ` Thomas Petazzoni @ 2012-08-24 10:22 ` Aras Vaichas 0 siblings, 0 replies; 3+ messages in thread From: Aras Vaichas @ 2012-08-24 10:22 UTC (permalink / raw) To: buildroot On 24 August 2012 10:34, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote: > Hello, > > Le Thu, 23 Aug 2012 09:45:35 +0100, > Aras Vaichas <aras.vaichas@gmail.com> a ?crit : > >> I've got a question about building gdbserver when an external >> toolchain is selected. >> >> in toolchain/gdb/Config.in: >> >> config BR2_PACKAGE_GDB_SERVER >> bool "Build gdb server for the Target" >> depends on !BR2_TOOLCHAIN_EXTERNAL >> help >> Build the gdbserver stub to run on the target. >> A full gdb is needed to debug the progam. >> >> Why doesn't Buildroot build gdbserver when an external toolchain is selected? > > Because for external toolchains, we assume that the gdbserver must be > provided by the external toolchain, together with the cross-gdb. OK, I think I see my confusion here. I'm new to using gdb and I didn't realise there was a cross-gdb (that runs on the host). I thought that gdb transferred machine-agnostic debug information via the network connection therefore I could use any gdb. > There are two reasons: > > 1. Most pre-built external toolchains available out there provide both > their own cross-gdb and gdbserver, so it makes sense to use them. OK, I will rebuild my external toolchain to include gdbserver and gdb. >> So why doesn't Buildroot allow me to copy over the gdbserver that I >> built within Buildroot? > > I'm confused again. Can you explain what you're doing exactly? In the > previous paragraph, you precisely said that there was an option to copy > gdbserver to the target filesystem, and now you're saying that there > isn't such an option. Are you talking about two different > configurations maybe? I have used Buildroot to create a cross toolchain .config. Then I used that configuration to build an external toolchain which I refer to in Buildroot (`make clean; make` is quicker, etc). Target is 486, host is 686. Sorry, I was confused between the two gdb executables. Since both my target and host are x86, it wasn't obvious to me that one was different. Thank you for the help. Aras Vaichas ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-24 10:22 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-08-23 8:45 [Buildroot] gdbserver with external crosstool Aras Vaichas 2012-08-24 9:34 ` Thomas Petazzoni 2012-08-24 10:22 ` Aras Vaichas
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox