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(-)
1.1 --- a/config/debug/gdb.in Mon Sep 01 17:54:39 2008 +0000
1.2 +++ b/config/debug/gdb.in Tue Sep 02 10:47:44 2008 +0000
1.3 @@ -29,6 +29,18 @@
1.4 That way, you can share the cross-gdb without installing a toolchain
1.5 on every machine that will be used to debug target programs.
1.6
1.7 +config GDB_CROSS_INSIGHT
1.8 + bool
1.9 + prompt "Use Insight instead (EXPERIMENTAL)"
1.10 + default n
1.11 + depends on GDB_CROSS
1.12 + depends on EXPERIMENTAL
1.13 + help
1.14 + If you say 'Y' here, then Insight will be used to build the cross
1.15 + debugger, instead of the plain gdb.
1.16 +
1.17 + Insight is gdb plus a TCL/TK GUI: http://sourceware.org/insight/
1.18 +
1.19 config GDB_NATIVE
1.20 bool
1.21 prompt "Native gdb"
1.22 @@ -88,6 +100,7 @@
1.23 bool
1.24 prompt "snapshot (EXPERIMENTAL)"
1.25 depends on EXPERIMENTAL
1.26 + depends on ! GDB_CROSS_INSIGHT
1.27
1.28 config GDB_V_6_4
1.29 bool
2.1 --- a/scripts/build/debug/300-gdb.sh Mon Sep 01 17:54:39 2008 +0000
2.2 +++ b/scripts/build/debug/300-gdb.sh Tue Sep 02 10:47:44 2008 +0000
2.3 @@ -17,11 +17,46 @@
2.4 esac
2.5 }
2.6
2.7 +do_debug_gdb_parts() {
2.8 + do_gdb=
2.9 + do_insight=
2.10 + do_ncurses=
2.11 +
2.12 + if [ "${CT_GDB_CROSS}" = y ]; then
2.13 + if [ "${CT_GDB_CROSS_INSIGHT}" = "y" ]; then
2.14 + do_insight=y
2.15 + else
2.16 + do_gdb=y
2.17 + fi
2.18 + fi
2.19 +
2.20 + if [ "${CT_GDB_GDBSERVER}" = "y" ]; then
2.21 + do_gdb=y
2.22 + fi
2.23 +
2.24 + if [ "${CT_GDB_NATIVE}" = "y" ]; then
2.25 + do_gdb=y
2.26 + do_ncurses=y
2.27 + fi
2.28 +}
2.29 +
2.30 do_debug_gdb_get() {
2.31 - CT_GetFile "gdb$(do_debug_gdb_suffix)" \
2.32 - {ftp,http}://ftp.gnu.org/pub/gnu/gdb \
2.33 - ftp://sources.redhat.com/pub/gdb/{{,old-}releases,snapshots/current}
2.34 - if [ "${CT_GDB_NATIVE}" = "y" ]; then
2.35 + do_debug_gdb_parts
2.36 +
2.37 + if [ "${do_gdb}" = "y" ]; then
2.38 + CT_GetFile "gdb$(do_debug_gdb_suffix)" \
2.39 + {ftp,http}://ftp.gnu.org/pub/gnu/gdb \
2.40 + ftp://sources.redhat.com/pub/gdb/{{,old-}releases,snapshots/current}
2.41 + fi
2.42 +
2.43 + if [ "${do_insight}" = "y" ]; then
2.44 + CT_GetFile "insight-${CT_GDB_VERSION}" \
2.45 + ftp://sourceware.org/pub/insight/releases \
2.46 + {ftp,http}://ftp.twaren.net/Unix/Sourceware/insight/releases \
2.47 + {ftp,http}://ftp.gwdg.de/pub/linux/sources.redhat.com/insight/releases
2.48 + fi
2.49 +
2.50 + if [ "${do_ncurses}" = "y" ]; then
2.51 CT_GetFile "ncurses-${CT_NCURSES_VERSION}" \
2.52 {ftp,http}://ftp.gnu.org/pub/gnu/ncurses \
2.53 ftp://invisible-island.net/ncurses
2.54 @@ -29,14 +64,24 @@
2.55 }
2.56
2.57 do_debug_gdb_extract() {
2.58 - CT_ExtractAndPatch "gdb$(do_debug_gdb_suffix)"
2.59 - if [ "${CT_GDB_NATIVE}" = "y" ]; then
2.60 + do_debug_gdb_parts
2.61 +
2.62 + if [ "${do_gdb}" = "y" ]; then
2.63 + CT_ExtractAndPatch "gdb$(do_debug_gdb_suffix)"
2.64 + fi
2.65 +
2.66 + if [ "${do_insight}" = "y" ]; then
2.67 + CT_ExtractAndPatch "insight-${CT_GDB_VERSION}"
2.68 + fi
2.69 +
2.70 + if [ "${do_ncurses}" = "y" ]; then
2.71 CT_ExtractAndPatch "ncurses-${CT_NCURSES_VERSION}"
2.72 fi
2.73 }
2.74
2.75 do_debug_gdb_build() {
2.76 gdb_src_dir="${CT_SRC_DIR}/gdb$(do_debug_gdb_suffix)"
2.77 + insight_src_dir="${CT_SRC_DIR}/insight-${CT_GDB_VERSION}"
2.78
2.79 extra_config=
2.80 # Version 6.3 and below behave badly with gdbmi
2.81 @@ -67,12 +112,15 @@
2.82 LD_for_gdb="ld -static"
2.83 fi
2.84
2.85 + gdb_cross_configure="${gdb_src_dir}/configure"
2.86 + [ "${CT_GDB_CROSS_INSIGHT}" = "y" ] && gdb_cross_configure="${insight_src_dir}/configure"
2.87 +
2.88 CT_DoLog DEBUG "Extra config passed: '${cross_extra_config# }'"
2.89
2.90 CC="${CC_for_gdb}" \
2.91 LD="${LD_for_gdb}" \
2.92 CT_DoExecLog ALL \
2.93 - "${gdb_src_dir}/configure" \
2.94 + "${gdb_cross_configure}" \
2.95 --build=${CT_BUILD} \
2.96 --host=${CT_HOST} \
2.97 --target=${CT_TARGET} \