From 3d4bc007196425f4ca01074d390facd292767222 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Tue, 2 Sep 2008 10:47:44 +0000 Subject: Add support for building Insight instead of gdb (only for the cross-gdb). /trunk/scripts/build/debug/300-gdb.sh | 62 55 7 0 ++++++++++++++++++++++++++++++++++++----- /trunk/config/debug/gdb.in | 13 13 0 0 +++++++++ 2 files changed, 68 insertions(+), 7 deletions(-) diff --git a/config/debug/gdb.in b/config/debug/gdb.in index 21978a2..6ee5bc5 100644 --- a/config/debug/gdb.in +++ b/config/debug/gdb.in @@ -29,6 +29,18 @@ config GDB_CROSS_STATIC That way, you can share the cross-gdb without installing a toolchain on every machine that will be used to debug target programs. +config GDB_CROSS_INSIGHT + bool + prompt "Use Insight instead (EXPERIMENTAL)" + default n + depends on GDB_CROSS + depends on EXPERIMENTAL + help + If you say 'Y' here, then Insight will be used to build the cross + debugger, instead of the plain gdb. + + Insight is gdb plus a TCL/TK GUI: http://sourceware.org/insight/ + config GDB_NATIVE bool prompt "Native gdb" @@ -88,6 +100,7 @@ config GDB_V_snapshot bool prompt "snapshot (EXPERIMENTAL)" depends on EXPERIMENTAL + depends on ! GDB_CROSS_INSIGHT config GDB_V_6_4 bool diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index 2cdb5d8..e00841b 100644 --- a/scripts/build/debug/300-gdb.sh +++ b/scripts/build/debug/300-gdb.sh @@ -17,11 +17,46 @@ do_debug_gdb_suffix() { esac } -do_debug_gdb_get() { - CT_GetFile "gdb$(do_debug_gdb_suffix)" \ - {ftp,http}://ftp.gnu.org/pub/gnu/gdb \ - ftp://sources.redhat.com/pub/gdb/{{,old-}releases,snapshots/current} +do_debug_gdb_parts() { + do_gdb= + do_insight= + do_ncurses= + + if [ "${CT_GDB_CROSS}" = y ]; then + if [ "${CT_GDB_CROSS_INSIGHT}" = "y" ]; then + do_insight=y + else + do_gdb=y + fi + fi + + if [ "${CT_GDB_GDBSERVER}" = "y" ]; then + do_gdb=y + fi + if [ "${CT_GDB_NATIVE}" = "y" ]; then + do_gdb=y + do_ncurses=y + fi +} + +do_debug_gdb_get() { + do_debug_gdb_parts + + if [ "${do_gdb}" = "y" ]; then + CT_GetFile "gdb$(do_debug_gdb_suffix)" \ + {ftp,http}://ftp.gnu.org/pub/gnu/gdb \ + ftp://sources.redhat.com/pub/gdb/{{,old-}releases,snapshots/current} + fi + + if [ "${do_insight}" = "y" ]; then + CT_GetFile "insight-${CT_GDB_VERSION}" \ + ftp://sourceware.org/pub/insight/releases \ + {ftp,http}://ftp.twaren.net/Unix/Sourceware/insight/releases \ + {ftp,http}://ftp.gwdg.de/pub/linux/sources.redhat.com/insight/releases + fi + + if [ "${do_ncurses}" = "y" ]; then CT_GetFile "ncurses-${CT_NCURSES_VERSION}" \ {ftp,http}://ftp.gnu.org/pub/gnu/ncurses \ ftp://invisible-island.net/ncurses @@ -29,14 +64,24 @@ do_debug_gdb_get() { } do_debug_gdb_extract() { - CT_ExtractAndPatch "gdb$(do_debug_gdb_suffix)" - if [ "${CT_GDB_NATIVE}" = "y" ]; then + do_debug_gdb_parts + + if [ "${do_gdb}" = "y" ]; then + CT_ExtractAndPatch "gdb$(do_debug_gdb_suffix)" + fi + + if [ "${do_insight}" = "y" ]; then + CT_ExtractAndPatch "insight-${CT_GDB_VERSION}" + fi + + if [ "${do_ncurses}" = "y" ]; then CT_ExtractAndPatch "ncurses-${CT_NCURSES_VERSION}" fi } do_debug_gdb_build() { gdb_src_dir="${CT_SRC_DIR}/gdb$(do_debug_gdb_suffix)" + insight_src_dir="${CT_SRC_DIR}/insight-${CT_GDB_VERSION}" extra_config= # Version 6.3 and below behave badly with gdbmi @@ -67,12 +112,15 @@ do_debug_gdb_build() { LD_for_gdb="ld -static" fi + gdb_cross_configure="${gdb_src_dir}/configure" + [ "${CT_GDB_CROSS_INSIGHT}" = "y" ] && gdb_cross_configure="${insight_src_dir}/configure" + CT_DoLog DEBUG "Extra config passed: '${cross_extra_config# }'" CC="${CC_for_gdb}" \ LD="${LD_for_gdb}" \ CT_DoExecLog ALL \ - "${gdb_src_dir}/configure" \ + "${gdb_cross_configure}" \ --build=${CT_BUILD} \ --host=${CT_HOST} \ --target=${CT_TARGET} \ -- cgit v0.10.2-6-g49f6