diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-07-24 20:30:52 +0200 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-07-24 20:30:52 +0200 |
commit | 82ba904b905f1491d71f49cdea5d892bb0a46027 (patch) | |
tree | f333f6ccf88fa8f2ffee4e95019773f9965f19f8 | |
parent | 4d85f4389d6e6c7640430cea90d1047bb046e7d7 (diff) | |
download | crosstool-ng-82ba904b905f1491d71f49cdea5d892bb0a46027.tar.gz crosstool-ng-82ba904b905f1491d71f49cdea5d892bb0a46027.tar.bz2 crosstool-ng-82ba904b905f1491d71f49cdea5d892bb0a46027.zip |
debug/gdb: install gdbinit sample file
gdb needs to know where to find the libstdc++ helper python script
to do, well, whatever it has to do with it...
We can't install that in the user's ~/.gdbinit, it's too complex to
handle all the cases. Moreover, if the user is using more than one
toolchain, we can't put all that stuff in there...
Just provide a sample config file the user can adapt to his/her
own needs.
Thanks go to Khem RAJ for providing such a hint:
http://sourceware.org/ml/crossgcc/2011-07/msg00026.html
Reported-by: ANDY KENNEDY <ANDY.KENNEDY@adtran.com>
CC: Khem Raj <raj.khem@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
-rw-r--r-- | scripts/build/debug/300-gdb.sh | 16 | ||||
-rw-r--r-- | scripts/build/debug/gdbinit.in | 6 |
2 files changed, 22 insertions, 0 deletions
diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index 6f93cdd4..66bd7b6b 100644 --- a/scripts/build/debug/300-gdb.sh +++ b/scripts/build/debug/300-gdb.sh @@ -105,6 +105,7 @@ do_debug_gdb_build() { if [ "${CT_GDB_CROSS}" = "y" ]; then local -a cross_extra_config + local gcc_version CT_DoStep INFO "Installing cross-gdb" CT_DoLog EXTRA "Configuring cross-gdb" @@ -149,6 +150,21 @@ do_debug_gdb_build() { CT_DoLog EXTRA "Installing cross-gdb" CT_DoExecLog ALL make install + CT_DoLog EXTRA "Install '.gdbinit' template" + # See in scripts/build/internals.sh for why we do this + if [ -f "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" ]; then + gcc_version=$( cat "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/BASE-VER" ) + else + gcc_version=$( sed -r -e '/version_string/!d; s/^.+= "([^"]+)".*$/\1/;' \ + "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/gcc/version.c" \ + ) + fi + ${sed} -r \ + -e "s:@@PREFIX@@:${CT_PREFIX_DIR}:;" \ + -e "s:@@VERSION@@:${gcc_version}:;" \ + "${CT_LIB_DIR}/scripts/build/debug/gdbinit.in" \ + >"${CT_PREFIX_DIR}/share/gdb/gdbinit" + CT_EndStep fi diff --git a/scripts/build/debug/gdbinit.in b/scripts/build/debug/gdbinit.in new file mode 100644 index 00000000..39500996 --- /dev/null +++ b/scripts/build/debug/gdbinit.in @@ -0,0 +1,6 @@ +python +import sys +sys.path.insert(0, '@@PREFIX@@/share/gcc-@@VERSION@@/python') +from libstdcxx.v6.printers import register_libstdcxx_printers +register_libstdcxx_printers (None) +end |