# HG changeset patch # User "Yann E. MORIN" # Date 1220352464 0 # Node ID 4c073dd24c1d9b026f413db907dbac52ba2e55b0 # Parent d43c250051c7aa421e7445dc5700322972e34cdd 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 -r d43c250051c7 -r 4c073dd24c1d config/debug/gdb.in --- a/config/debug/gdb.in Mon Sep 01 17:54:39 2008 +0000 +++ b/config/debug/gdb.in Tue Sep 02 10:47:44 2008 +0000 @@ -29,6 +29,18 @@ 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 @@ bool prompt "snapshot (EXPERIMENTAL)" depends on EXPERIMENTAL + depends on ! GDB_CROSS_INSIGHT config GDB_V_6_4 bool diff -r d43c250051c7 -r 4c073dd24c1d scripts/build/debug/300-gdb.sh --- a/scripts/build/debug/300-gdb.sh Mon Sep 01 17:54:39 2008 +0000 +++ b/scripts/build/debug/300-gdb.sh Tue Sep 02 10:47:44 2008 +0000 @@ -17,11 +17,46 @@ esac } +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() { - 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} - if [ "${CT_GDB_NATIVE}" = "y" ]; then + 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_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 @@ 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} \