This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Insight debugger


I have added support to build the insight GUI for gdb
within crosstool. The building is enabled by the
--insight switch (just like --gbd builds the gdb debugger.)

Notice that because insight already contains gdb,
the --gdb switch is not needed to compile insight.

The default version for gdb has also been bumped up to
6.8 from 6.3.

Cheers!
Anthony Tonizzo
diff -r -U 5 -N -x CVS -x '*~' -x '.#*' ./crosstool-0.43/all.sh ./crosstool-0.43-insight/all.sh
--- ./crosstool-0.43/all.sh	2006-12-06 16:17:40.000000000 -0800
+++ ./crosstool-0.43-insight/all.sh	2008-08-27 10:57:42.000000000 -0700
@@ -92,21 +92,28 @@
 	   opt_no_test=1
 	   ;;
 	--gdb|-gdb) 
 	   opt_gdb=1
 	   ;;
+	--insight|-insight) 
+	   opt_insight=1
+	   ;;
 	--testlinux|-testlinux) 
 	   opt_testlinux=1
 	   ;;
 	*)
-	    abort "Usage: all.sh [--nounpack|--nobuild|--testlinux|--gdb|--builduserland|--notest]"
+	    abort "Usage: all.sh [--nounpack|--nobuild|--testlinux|--gdb|--insight|--builduserland|--notest]"
     esac
     shift
 done
 
 if test "$opt_gdb" = "1"; then
-    test -z "${GDB_DIR}"          && echo "Defaulting to GDB_DIR=gdb-6.3" && GDB_DIR=gdb-6.3 && export GDB_DIR
+    test -z "${GDB_DIR}"          && echo "Defaulting to GDB_DIR=gdb-6.8" && GDB_DIR=gdb-6.8 && export GDB_DIR
+fi
+
+if test "$opt_insight" = "1"; then
+    test -z "${INSIGHT_DIR}"          && echo "Defaulting to INSIGHT_DIR=insight-6.8" && INSIGHT_DIR=insight-6.8 && export INSIGHT_DIR
 fi
 
 if test "$opt_no_unpack" = ""; then
    if test "$opt_builduserland" = "1"; then
       # Ah, nobody would want to change this :-)
@@ -146,10 +153,16 @@
     # Build a debugger
     # kludge: don't abort if it doesn't build; we want to know if the kernel builds, too
     sh gdb.sh || test "$opt_testlinux" = "1"
 fi
 
+if test "$opt_insight" = "1"; then
+    # Build the insight GUI for GDB.
+    # kludge: don't abort if it doesn't build; we want to know if the kernel builds, too
+    sh insight.sh || test "$opt_testlinux" = "1"
+fi
+
 if test "$opt_testlinux" = "1"; then
     # Build a Linux kernel to see if we can
     sh testlinux.sh
 fi
 
diff -r -U 5 -N -x CVS -x '*~' -x '.#*' ./crosstool-0.43/demo-mipsel.sh ./crosstool-0.43-insight/demo-mipsel.sh
--- ./crosstool-0.43/demo-mipsel.sh	2006-12-06 16:17:40.000000000 -0800
+++ ./crosstool-0.43-insight/demo-mipsel.sh	2008-08-27 10:53:04.000000000 -0700
@@ -24,8 +24,8 @@
 #eval `cat mipsel.dat gcc-3.4.5-glibc-2.3.2.dat` sh all.sh --notest
 #eval `cat mipsel.dat gcc-3.4.5-glibc-2.3.2-tls.dat` sh all.sh --notest
 #eval `cat mipsel.dat gcc-3.4.5-glibc-2.3.5.dat` sh all.sh --notest
 #eval `cat mipsel.dat gcc-3.4.5-glibc-2.3.5-tls.dat` sh all.sh --notest
 #eval `cat mipsel.dat gcc-3.4.5-glibc-2.3.6.dat` sh all.sh --notest
-eval `cat mipsel.dat gcc-3.4.5-glibc-2.3.6-tls.dat` sh all.sh --notest
+eval `cat mipsel.dat gcc-3.4.5-glibc-2.3.6-tls.dat` sh all.sh --notest --gdb --insight
 
 echo Done.
diff -r -U 5 -N -x CVS -x '*~' -x '.#*' ./crosstool-0.43/getandpatch.sh ./crosstool-0.43-insight/getandpatch.sh
--- ./crosstool-0.43/getandpatch.sh	2006-12-06 16:17:40.000000000 -0800
+++ ./crosstool-0.43-insight/getandpatch.sh	2008-08-27 08:48:22.000000000 -0700
@@ -198,10 +198,16 @@
                       ftp://sources.redhat.com/pub/gdb/releases/$GDB_DIR.tar.bz2 \
                       ftp://sources.redhat.com/pub/gdb/old-releases/$GDB_DIR.tar.bz2 \
                       ftp://sources.redhat.com/pub/gdb/snapshots/current/$GDB_DIR.tar.bz2
 fi
 
+if test -n "$INSIGHT_DIR"; then
+    getUnpackAndPatch ftp://sourceware.org/pub/insight/releases/$INSIGHT_DIR.tar.bz2 \
+                      ftp://mirrors.kernel.org/sources.redhat.com/insight/releases/$INSIGHT_DIR.tar.bz2 \
+                      ftp://bo.mirror.garr.it/mirrors/sourceware.org/insight/releases/$INSIGHT_DIR.tar.bz2
+fi
+
 # No glibc for cygwin.
 if test "${CYGWIN_DIR}" = ""; then
    case $GLIBC_DIR in
       glibc-200*) 
   	  getUnpackAndPatch \
diff -r -U 5 -N -x CVS -x '*~' -x '.#*' ./crosstool-0.43/insight.sh ./crosstool-0.43-insight/insight.sh
--- ./crosstool-0.43/insight.sh	1969-12-31 16:00:00.000000000 -0800
+++ ./crosstool-0.43-insight/insight.sh	2008-08-27 09:45:19.000000000 -0700
@@ -0,0 +1,66 @@
+#!/bin/sh
+# Scriptlet to build a cross-gcc and a native insight.
+# Anthony Tonizzo
+# Copyright 2004, Andre Ancelin (andrea@adtecinc.com)
+# Copyright 2005, Google
+# Copyright 2008, Google
+set -ex
+
+abort() {
+    echo crosstool: $@
+    exec false
+}
+
+# Used to log success or failure of each stage
+logresult() {
+    if test -x $2; then
+        echo crosstool: $1 built ok
+    else
+        abort Build failed during $1
+    fi
+}
+
+test -z "${PREFIX}"           && abort "Please set PREFIX to where you want the toolchain installed."
+test -z "${BUILD_DIR}"        && abort "Please set BUILD_DIR to the directory where the tools are to be built"
+test -z "${SRC_DIR}"          && abort "Please set SRC_DIR to the directory where the source tarballs are to be unpacked"
+test -z "${TARGET}"           && abort "Please set TARGET to the Gnu target identifier (e.g. pentium-linux)"
+test -z "${GCC_HOST}"         && echo "GCC_HOST not set, assuming HOST=BUILD"
+test -z "${GCC_BUILD}"        && echo "GCC_BUILD not set, assuming BUILD=output of config.guess"
+TOP_DIR=${TOP_DIR-`pwd`}
+BUILD=${GCC_BUILD-`$TOP_DIR/config.guess`}
+test -z "$BUILD" && abort "bug: BUILD not set?!"
+if test "$GCC_HOST" = ""; then
+        GCC_HOST=$BUILD
+fi
+test -z "${INSIGHT_DIR}"          && abort "Please set INSIGHT_DIR to the bare filename of the insight tarball or directory"
+# If we're building compilers that run on Windows, remember that their
+# filenames end in .exe
+case "$GCC_HOST" in
+*cygwin*) EXEEXT=".exe" ;;
+*)        EXEEXT="" ;;
+esac
+
+PATH="${PREFIX}/bin:${PATH}"
+export PATH
+
+INSIGHT_DIR=`cd ${SRC_DIR}/${INSIGHT_DIR}; pwd`
+
+cd $BUILD_DIR
+
+#---------------------------------------------------------
+echo Build insight
+
+mkdir -p build-insight; cd build-insight
+
+if test '!' -f Makefile; then
+    ${INSIGHT_DIR}/configure --target=$TARGET --host=$GCC_HOST --prefix=$PREFIX
+fi
+
+make $PARALLELMFLAGS all
+make install
+
+cd ..
+ 
+logresult insight ${PREFIX}/bin/${TARGET}-insight${EXEEXT}
+ 
+
--
For unsubscribe information see http://sourceware.org/lists.html#faq

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]