aboutsummaryrefslogtreecommitdiff
path: root/toolchain/toolchain-external/toolchain-external.mk
diff options
context:
space:
mode:
authorGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-05-05 11:25:50 +0200
committerGravatar Peter Korsgaard <peter@korsgaard.com>2014-05-05 13:31:30 +0200
commit7130ceb267b587b97fb5baa005521709e2b415d1 (patch)
tree97aca1e7a66d4a2ee3b71c0ef951c375d5483ee3 /toolchain/toolchain-external/toolchain-external.mk
parent948b963d1bbba6ad3cdca7d68a3bd02eadaadbb8 (diff)
downloadbuildroot-7130ceb267b587b97fb5baa005521709e2b415d1.tar.gz
buildroot-7130ceb267b587b97fb5baa005521709e2b415d1.tar.bz2
toolchain: generate a gdbinit file
This commit slightly improves the external toolchain backend, and the gdb build logic to create a file named $(STAGING_DIR)/usr/share/buildroot/gdbinit which can be used as a gdbinit file using gdb -x option. This allows gdb to automatically use the proper sysroot to find libraries. The initial insight for this patch comes from the report of Oded Hanson <OHanson@xsightsys.com>, who found an issue with the Eclipse Buildroot plugin, which was setting a solib-path in gdb, but not a sysroot. Setting a solib-path was enough to find shared libraries, but not the dynamic linker. And since Eclipse doesn't allow to set the sysroot in any other way than giving a gdbinit file, it makes sense to have Buildroot generate a gdbinit file (which can be used in other situations than Eclipse). To achieve this, this commit introduces a gen_gdbinit_file helper in toolchain/helpers.mk, and uses it for the internal toolchain and external toolchain backends. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> [ThomasDS: minor updates in commit message] Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'toolchain/toolchain-external/toolchain-external.mk')
-rw-r--r--toolchain/toolchain-external/toolchain-external.mk7
1 files changed, 7 insertions, 0 deletions
diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index b40f54dd7e..05d8867a81 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -651,6 +651,12 @@ define TOOLCHAIN_EXTERNAL_SANITIZE_KERNEL_HEADERS
-e 's@#(ifndef|define|endif[ \t]*/[*])[ \t]*_UAPI@#\1 @'
endef
+define TOOLCHAIN_EXTERNAL_INSTALL_GDBINIT
+ if test -f $(TARGET_CROSS)gdb ; then \
+ $(call gen_gdbinit_file) ; \
+ fi
+endef
+
# Even though we're installing things in both the staging, the host
# and the target directory, we do everything within the
# install-staging step, arbitrarily.
@@ -659,6 +665,7 @@ define TOOLCHAIN_EXTERNAL_INSTALL_STAGING_CMDS
$(TOOLCHAIN_EXTERNAL_INSTALL_BFIN_FDPIC)
$(TOOLCHAIN_EXTERNAL_INSTALL_BFIN_FLAT)
$(TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER)
+ $(TOOLCHAIN_EXTERNAL_INSTALL_GDBINIT)
endef
$(eval $(generic-package))