diff options
author | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
---|---|---|
committer | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
commit | 709c4d66e0b107ca606941b988bad717c0b45d9b (patch) | |
tree | 37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/gdb | |
parent | fa6cd5a3b993f16c27de4ff82b42684516d433ba (diff) |
rename packages/ to recipes/ per earlier agreement
See links below for more details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816
Signed-off-by: Denys Dmytriyenko <denis@denix.org>
Acked-by: Mike Westerhof <mwester@dls.net>
Acked-by: Philip Balister <philip@balister.org>
Acked-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Marcin Juszkiewicz <hrw@openembedded.org>
Acked-by: Koen Kooi <koen@openembedded.org>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/gdb')
34 files changed, 2508 insertions, 0 deletions
diff --git a/recipes/gdb/files/gdbserver-cflags-last.diff b/recipes/gdb/files/gdbserver-cflags-last.diff new file mode 100644 index 0000000000..42bd740a7c --- /dev/null +++ b/recipes/gdb/files/gdbserver-cflags-last.diff @@ -0,0 +1,13 @@ +--- gdb/gdbserver/Makefile.in.orig 2004-10-05 18:52:56.298419032 +0200 ++++ gdb/gdbserver/Makefile.in 2004-10-05 18:53:10.442268840 +0200 +@@ -97,8 +97,8 @@ + CFLAGS = @CFLAGS@ + + # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros. +-INTERNAL_CFLAGS = $(WARN_CFLAGS) ${CFLAGS} ${GLOBAL_CFLAGS} \ +- ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${BFD_CFLAGS} ++INTERNAL_CFLAGS = $(WARN_CFLAGS) ${GLOBAL_CFLAGS} \ ++ ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${BFD_CFLAGS} ${CFLAGS} + + # LDFLAGS is specifically reserved for setting from the command line + # when running make. diff --git a/recipes/gdb/files/kill_arm_map_symbols.patch b/recipes/gdb/files/kill_arm_map_symbols.patch new file mode 100644 index 0000000000..177142192d --- /dev/null +++ b/recipes/gdb/files/kill_arm_map_symbols.patch @@ -0,0 +1,24 @@ +Index: gdb-6.3/gdb/arm-tdep.c +=================================================================== +--- gdb-6.3.orig/gdb/arm-tdep.c 2004-08-03 02:02:20.000000000 +0000 ++++ gdb-6.3/gdb/arm-tdep.c 2005-11-09 15:13:29.000000000 +0000 +@@ -2491,6 +2491,19 @@ + static void + arm_elf_make_msymbol_special(asymbol *sym, struct minimal_symbol *msym) + { ++ ++ /* FIXME: We want gdb to ignore the ARM ELF mapping symbols when ++ displaying disassembly so we use this horrible hack here to ++ artifically set their address to the highest possible value. ++ This is wrong of course, and it prevents the symbols from being ++ used for their intended purpose - to distinguish between ARM ++ and THUMB code. So we ought to find a better way to do this. */ ++ if (bfd_asymbol_name (sym) ++ && bfd_asymbol_name (sym)[0] == '$' ++ && bfd_asymbol_name (sym)[1] != 0 ++ && bfd_asymbol_name (sym)[2] == 0) ++ SYMBOL_VALUE_ADDRESS(msym) = (CORE_ADDR) 0x7ffffffc; ++ + /* Thumb symbols are of type STT_LOPROC, (synonymous with + STT_ARM_TFUNC). */ + if (ELF_ST_TYPE (((elf_symbol_type *)sym)->internal_elf_sym.st_info) diff --git a/recipes/gdb/files/libiberty-cross.patch b/recipes/gdb/files/libiberty-cross.patch new file mode 100644 index 0000000000..0d1897f9e0 --- /dev/null +++ b/recipes/gdb/files/libiberty-cross.patch @@ -0,0 +1,630 @@ +--- libiberty/configure.in.old 2004-03-31 21:25:25.000000000 +0100 ++++ libiberty/configure.in 2004-03-31 21:18:02.000000000 +0100 +@@ -100,6 +100,7 @@ + AC_CHECK_TOOL(RANLIB, ranlib, :) + + LIB_AC_PROG_CC ++AC_PROG_CC_WORKS + + AC_PROG_CC_C_O + # autoconf is lame and doesn't give us any substitution variable for this. +@@ -402,7 +403,6 @@ + + # We haven't set the list of objects yet. Use the standard autoconf + # tests. This will only work if the compiler works. +- AC_PROG_CC_WORKS + AC_REPLACE_FUNCS($funcs) + libiberty_AC_FUNC_C_ALLOCA + AC_FUNC_VFORK + +--- libiberty/configure.old 2003-06-19 21:05:35.000000000 +0100 ++++ libiberty/configure 2004-03-31 21:35:12.000000000 +0100 +@@ -1000,13 +1000,60 @@ + fi + + ++echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ++echo "configure:1005: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ++ ++ac_ext=c ++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ++cross_compiling=$ac_cv_prog_cc_cross ++ ++cat > conftest.$ac_ext << EOF ++ ++#line 1016 "configure" ++#include "confdefs.h" ++ ++main(){return(0);} ++EOF ++if { (eval echo configure:1021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ ac_cv_prog_cc_works=yes ++ # If we can't run a trivial program, we are probably using a cross compiler. ++ if (./conftest; exit) 2>/dev/null; then ++ ac_cv_prog_cc_cross=no ++ else ++ ac_cv_prog_cc_cross=yes ++ fi ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ ac_cv_prog_cc_works=no ++fi ++rm -fr conftest* ++ac_ext=c ++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ++cross_compiling=$ac_cv_prog_cc_cross ++ ++echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 ++if test $ac_cv_prog_cc_works = no; then ++ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } ++fi ++echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ++echo "configure:1047: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 ++echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 ++cross_compiling=$ac_cv_prog_cc_cross ++ + + if test "x$CC" != xcc; then + echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6 +-echo "configure:1007: checking whether $CC and cc understand -c and -o together" >&5 ++echo "configure:1054: checking whether $CC and cc understand -c and -o together" >&5 + else + echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6 +-echo "configure:1010: checking whether cc understands -c and -o together" >&5 ++echo "configure:1057: checking whether cc understands -c and -o together" >&5 + fi + set dummy $CC; ac_cc="`echo $2 | + sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" +@@ -1018,16 +1065,16 @@ + # We do the test twice because some compilers refuse to overwrite an + # existing .o file with -o, though they will create one. + ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5' +-if { (eval echo configure:1022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && +- test -f conftest.o && { (eval echo configure:1023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; ++if { (eval echo configure:1069: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && ++ test -f conftest.o && { (eval echo configure:1070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; + then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. +- if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then ++ if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + ac_try='cc -c conftest.c -o conftest.o 1>&5' +- if { (eval echo configure:1030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && +- test -f conftest.o && { (eval echo configure:1031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; ++ if { (eval echo configure:1077: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && ++ test -f conftest.o && { (eval echo configure:1078: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; + then + # cc works too. + : +@@ -1063,7 +1110,7 @@ + + + echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 +-echo "configure:1067: checking for POSIXized ISC" >&5 ++echo "configure:1114: checking for POSIXized ISC" >&5 + if test -d /etc/conf/kconfig.d && + grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 + then +@@ -1084,12 +1131,12 @@ + fi + + echo $ac_n "checking for working const""... $ac_c" 1>&6 +-echo "configure:1088: checking for working const" >&5 ++echo "configure:1135: checking for working const" >&5 + if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <<EOF +-#line 1093 "configure" ++#line 1140 "configure" + #include "confdefs.h" + + int main() { +@@ -1138,7 +1185,7 @@ + + ; return 0; } + EOF +-if { (eval echo configure:1142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_const=yes + else +@@ -1159,21 +1206,21 @@ + fi + + echo $ac_n "checking for inline""... $ac_c" 1>&6 +-echo "configure:1163: checking for inline" >&5 ++echo "configure:1210: checking for inline" >&5 + if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_cv_c_inline=no + for ac_kw in inline __inline__ __inline; do + cat > conftest.$ac_ext <<EOF +-#line 1170 "configure" ++#line 1217 "configure" + #include "confdefs.h" + + int main() { + } $ac_kw foo() { + ; return 0; } + EOF +-if { (eval echo configure:1177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1224: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_inline=$ac_kw; break + else +@@ -1199,14 +1246,14 @@ + esac + + echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 +-echo "configure:1203: checking whether byte ordering is bigendian" >&5 ++echo "configure:1250: checking whether byte ordering is bigendian" >&5 + if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_cv_c_bigendian=unknown + # See if sys/param.h defines the BYTE_ORDER macro. + cat > conftest.$ac_ext <<EOF +-#line 1210 "configure" ++#line 1257 "configure" + #include "confdefs.h" + #include <sys/types.h> + #include <sys/param.h> +@@ -1217,11 +1264,11 @@ + #endif + ; return 0; } + EOF +-if { (eval echo configure:1221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + # It does; now see whether it defined to BIG_ENDIAN or not. + cat > conftest.$ac_ext <<EOF +-#line 1225 "configure" ++#line 1272 "configure" + #include "confdefs.h" + #include <sys/types.h> + #include <sys/param.h> +@@ -1232,7 +1279,7 @@ + #endif + ; return 0; } + EOF +-if { (eval echo configure:1236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_bigendian=yes + else +@@ -1252,7 +1299,7 @@ + echo $ac_n "cross-compiling... " 2>&6 + else + cat > conftest.$ac_ext <<EOF +-#line 1256 "configure" ++#line 1303 "configure" + #include "confdefs.h" + main () { + /* Are we little or big endian? From Harbison&Steele. */ +@@ -1265,7 +1312,7 @@ + exit (u.c[sizeof (long) - 1] == 1); + } + EOF +-if { (eval echo configure:1269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:1316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_c_bigendian=no + else +@@ -1283,7 +1330,7 @@ + echo "$ac_t""$ac_cv_c_bigendian" 1>&6 + if test $ac_cv_c_bigendian = unknown; then + echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6 +-echo "configure:1287: checking to probe for byte ordering" >&5 ++echo "configure:1334: checking to probe for byte ordering" >&5 + + cat >conftest.c <<EOF + short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +@@ -1352,7 +1399,7 @@ + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" + # ./install, which can be erroneously created by make from ./install.sh. + echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +-echo "configure:1356: checking for a BSD compatible install" >&5 ++echo "configure:1403: checking for a BSD compatible install" >&5 + if test -z "$INSTALL"; then + if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -1413,7 +1460,7 @@ + # able to link anything, it had better be able to at least compile + # something. + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +-echo "configure:1417: checking how to run the C preprocessor" >&5 ++echo "configure:1464: checking how to run the C preprocessor" >&5 + # On Suns, sometimes $CPP names a directory. + if test -n "$CPP" && test -d "$CPP"; then + CPP= +@@ -1428,13 +1475,13 @@ + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext <<EOF +-#line 1432 "configure" ++#line 1479 "configure" + #include "confdefs.h" + #include <assert.h> + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:1438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:1485: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : +@@ -1445,13 +1492,13 @@ + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext <<EOF +-#line 1449 "configure" ++#line 1496 "configure" + #include "confdefs.h" + #include <assert.h> + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:1455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:1502: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : +@@ -1462,13 +1509,13 @@ + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext <<EOF +-#line 1466 "configure" ++#line 1513 "configure" + #include "confdefs.h" + #include <assert.h> + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:1472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:1519: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : +@@ -1496,17 +1543,17 @@ + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:1500: checking for $ac_hdr" >&5 ++echo "configure:1547: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <<EOF +-#line 1505 "configure" ++#line 1552 "configure" + #include "confdefs.h" + #include <$ac_hdr> + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:1510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:1557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -1533,12 +1580,12 @@ + done + + echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 +-echo "configure:1537: checking for sys/wait.h that is POSIX.1 compatible" >&5 ++echo "configure:1584: checking for sys/wait.h that is POSIX.1 compatible" >&5 + if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <<EOF +-#line 1542 "configure" ++#line 1589 "configure" + #include "confdefs.h" + #include <sys/types.h> + #include <sys/wait.h> +@@ -1554,7 +1601,7 @@ + s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; + ; return 0; } + EOF +-if { (eval echo configure:1558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1605: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_sys_wait_h=yes + else +@@ -1575,12 +1622,12 @@ + fi + + echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 +-echo "configure:1579: checking whether time.h and sys/time.h may both be included" >&5 ++echo "configure:1626: checking whether time.h and sys/time.h may both be included" >&5 + if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <<EOF +-#line 1584 "configure" ++#line 1631 "configure" + #include "confdefs.h" + #include <sys/types.h> + #include <sys/time.h> +@@ -1589,7 +1636,7 @@ + struct tm *tp; + ; return 0; } + EOF +-if { (eval echo configure:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1640: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_time=yes + else +@@ -1611,19 +1658,19 @@ + + + echo $ac_n "checking whether errno must be declared""... $ac_c" 1>&6 +-echo "configure:1615: checking whether errno must be declared" >&5 ++echo "configure:1662: checking whether errno must be declared" >&5 + if eval "test \"`echo '$''{'libiberty_cv_declare_errno'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <<EOF +-#line 1620 "configure" ++#line 1667 "configure" + #include "confdefs.h" + #include <errno.h> + int main() { + int x = errno; + ; return 0; } + EOF +-if { (eval echo configure:1627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1674: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + libiberty_cv_declare_errno=no + else +@@ -1645,12 +1692,12 @@ + + + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +-echo "configure:1649: checking for ANSI C header files" >&5 ++echo "configure:1696: checking for ANSI C header files" >&5 + if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <<EOF +-#line 1654 "configure" ++#line 1701 "configure" + #include "confdefs.h" + #include <stdlib.h> + #include <stdarg.h> +@@ -1658,7 +1705,7 @@ + #include <float.h> + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:1662: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:1709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -1675,7 +1722,7 @@ + if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat > conftest.$ac_ext <<EOF +-#line 1679 "configure" ++#line 1726 "configure" + #include "confdefs.h" + #include <string.h> + EOF +@@ -1693,7 +1740,7 @@ + if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat > conftest.$ac_ext <<EOF +-#line 1697 "configure" ++#line 1744 "configure" + #include "confdefs.h" + #include <stdlib.h> + EOF +@@ -1714,7 +1761,7 @@ + : + else + cat > conftest.$ac_ext <<EOF +-#line 1718 "configure" ++#line 1765 "configure" + #include "confdefs.h" + #include <ctype.h> + #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +@@ -1725,7 +1772,7 @@ + exit (0); } + + EOF +-if { (eval echo configure:1729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:1776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + : + else +@@ -1749,12 +1796,12 @@ + fi + + echo $ac_n "checking for uintptr_t""... $ac_c" 1>&6 +-echo "configure:1753: checking for uintptr_t" >&5 ++echo "configure:1800: checking for uintptr_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_uintptr_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <<EOF +-#line 1758 "configure" ++#line 1805 "configure" + #include "confdefs.h" + #include <sys/types.h> + #if STDC_HEADERS +@@ -1790,12 +1837,12 @@ + + + echo $ac_n "checking for pid_t""... $ac_c" 1>&6 +-echo "configure:1794: checking for pid_t" >&5 ++echo "configure:1841: checking for pid_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <<EOF +-#line 1799 "configure" ++#line 1846 "configure" + #include "confdefs.h" + #include <sys/types.h> + #if STDC_HEADERS +@@ -1895,12 +1942,12 @@ + realpath canonicalize_file_name + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:1899: checking for $ac_func" >&5 ++echo "configure:1946: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <<EOF +-#line 1904 "configure" ++#line 1951 "configure" + #include "confdefs.h" + /* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +@@ -1923,7 +1970,7 @@ + + ; return 0; } + EOF +-if { (eval echo configure:1927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:1974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -2152,53 +2199,6 @@ + + # We haven't set the list of objects yet. Use the standard autoconf + # tests. This will only work if the compiler works. +- echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +-echo "configure:2157: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +- +-ac_ext=c +-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +-ac_cpp='$CPP $CPPFLAGS' +-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +-cross_compiling=$ac_cv_prog_cc_cross +- +-cat > conftest.$ac_ext << EOF +- +-#line 2168 "configure" +-#include "confdefs.h" +- +-main(){return(0);} +-EOF +-if { (eval echo configure:2173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +- ac_cv_prog_cc_works=yes +- # If we can't run a trivial program, we are probably using a cross compiler. +- if (./conftest; exit) 2>/dev/null; then +- ac_cv_prog_cc_cross=no +- else +- ac_cv_prog_cc_cross=yes +- fi +-else +- echo "configure: failed program was:" >&5 +- cat conftest.$ac_ext >&5 +- ac_cv_prog_cc_works=no +-fi +-rm -fr conftest* +-ac_ext=c +-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +-ac_cpp='$CPP $CPPFLAGS' +-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +-cross_compiling=$ac_cv_prog_cc_cross +- +-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +-if test $ac_cv_prog_cc_works = no; then +- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +-fi +-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +-echo "configure:2199: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +-cross_compiling=$ac_cv_prog_cc_cross +- + for ac_func in $funcs + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +@@ -2900,7 +2900,7 @@ + esac + + +-for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h ++for ac_hdr in unistd.h + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +@@ -3032,24 +3032,11 @@ + #include <fcntl.h> + #include <sys/mman.h> + +-#if HAVE_SYS_TYPES_H +-# include <sys/types.h> +-#endif +- +-#if HAVE_STDLIB_H +-# include <stdlib.h> +-#endif +- +-#if HAVE_SYS_STAT_H +-# include <sys/stat.h> +-#endif +- +-#if HAVE_UNISTD_H +-# include <unistd.h> +-#endif +- + /* This mess was copied from the GNU getpagesize.h. */ + #ifndef HAVE_GETPAGESIZE ++# ifdef HAVE_UNISTD_H ++# include <unistd.h> ++# endif + + /* Assume that all systems that can run configure have sys/param.h. */ + # ifndef HAVE_SYS_PARAM_H +@@ -3157,7 +3144,7 @@ + } + + EOF +-if { (eval echo configure:3161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:3148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_func_mmap_fixed_mapped=yes + else +@@ -3181,7 +3168,7 @@ + + + echo $ac_n "checking for working strncmp""... $ac_c" 1>&6 +-echo "configure:3185: checking for working strncmp" >&5 ++echo "configure:3172: checking for working strncmp" >&5 + if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -3189,7 +3176,7 @@ + ac_cv_func_strncmp_works=no + else + cat > conftest.$ac_ext <<EOF +-#line 3193 "configure" ++#line 3180 "configure" + #include "confdefs.h" + + /* Test by Jim Wilson and Kaveh Ghazi. +@@ -3253,7 +3240,7 @@ + } + + EOF +-if { (eval echo configure:3257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:3244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_func_strncmp_works=yes + else diff --git a/recipes/gdb/files/sim-install-makefile-common.patch b/recipes/gdb/files/sim-install-makefile-common.patch new file mode 100644 index 0000000000..24550edc6c --- /dev/null +++ b/recipes/gdb/files/sim-install-makefile-common.patch @@ -0,0 +1,22 @@ +--- gdb-6.1/sim/common/Make-common.in~sim-install.patch 2003-09-08 18:24:59.000000000 +0100 ++++ gdb-6.1/sim/common/Make-common.in 2004-07-22 17:56:18.947423032 +0100 +@@ -581,14 +581,14 @@ + + install-common: installdirs + n=`echo run | sed '$(program_transform_name)'`; \ +- $(INSTALL_PROGRAM) run$(EXEEXT) $(bindir)/$$n$(EXEEXT) ++ $(INSTALL_PROGRAM) run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT) + n=`echo libsim.a | sed s/libsim.a/lib$(target_alias)-sim.a/`; \ +- $(INSTALL_DATA) libsim.a $(libdir)/$$n ; \ +- ( cd $(libdir) ; $(RANLIB) $$n ) ++ $(INSTALL_DATA) libsim.a $(DESTDIR)$(libdir)/$$n ; \ ++ ( cd $(DESTDIR)$(libdir) ; $(RANLIB) $$n ) + + installdirs: +- $(SHELL) $(srcdir)/../../mkinstalldirs $(bindir) +- $(SHELL) $(srcdir)/../../mkinstalldirs $(libdir) ++ $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir) ++ $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(libdir) + + check: + cd ../testsuite && $(MAKE) check RUNTESTFLAGS="$(RUNTESTFLAGS)" diff --git a/recipes/gdb/files/sim-install-makefile.patch b/recipes/gdb/files/sim-install-makefile.patch new file mode 100644 index 0000000000..7ac67496ac --- /dev/null +++ b/recipes/gdb/files/sim-install-makefile.patch @@ -0,0 +1,11 @@ +--- gdb-6.6~org/sim/common/Makefile.in 2007-01-30 09:23:31.000000000 -0500 ++++ gdb-6.6/sim/common/Makefile.in 2007-01-30 09:25:32.000000000 -0500 +@@ -34,7 +34,7 @@ + + datadir = @datadir@ + mandir = @mandir@ +-man1dir = $(mandir)/man1 ++man1dir = $(DESTDIR)$(mandir)/man1 + infodir = @infodir@ + includedir = @includedir@ + diff --git a/recipes/gdb/files/uclibc.patch b/recipes/gdb/files/uclibc.patch new file mode 100644 index 0000000000..3d6b7ba187 --- /dev/null +++ b/recipes/gdb/files/uclibc.patch @@ -0,0 +1,194 @@ +--- binutils-2.15.91.0.1/bfd/config.bfd~binutils-2.15.90.0.3-uclibc-100-conf ++++ binutils-2.15.91.0.1/bfd/config.bfd +@@ -128,7 +128,7 @@ + targ_defvec=ecoffalpha_little_vec + targ_selvecs=bfd_elf64_alpha_vec + ;; +- alpha*-*-linux-gnu* | alpha*-*-elf*) ++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*) + targ_defvec=bfd_elf64_alpha_vec + targ_selvecs=ecoffalpha_little_vec + ;; +@@ -138,7 +138,7 @@ + alpha*-*-*) + targ_defvec=ecoffalpha_little_vec + ;; +- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu) ++ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-linux-uclibc* | ia64*-*-kfreebsd*-gnu) + targ_defvec=bfd_elf64_ia64_little_vec + targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec" + ;; +@@ -215,7 +215,7 @@ + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec + ;; +- armeb-*-elf | arm*b-*-linux-gnu*) ++ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*) + targ_defvec=bfd_elf32_bigarm_vec + targ_selvecs=bfd_elf32_littlearm_vec + ;; +@@ -223,8 +223,8 @@ + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec + ;; +- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \ +- arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks) ++ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | \ ++ arm*-*-conix* | arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks) + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec + ;; +@@ -367,7 +367,7 @@ + ;; + + #ifdef BFD64 +- hppa*64*-*-linux-gnu*) ++ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) + targ_defvec=bfd_elf64_hppa_linux_vec + targ_selvecs=bfd_elf64_hppa_vec + ;; +@@ -378,7 +378,7 @@ + ;; + #endif + +- hppa*-*-linux-gnu* | hppa*-*-netbsd*) ++ hppa*-*-linux-gnu* | hppa*-*-netbsd* | hppa*-*-linux-uclibc*) + targ_defvec=bfd_elf32_hppa_linux_vec + targ_selvecs=bfd_elf32_hppa_vec + ;; +@@ -501,7 +501,7 @@ + targ_selvecs=bfd_elf32_i386_vec + targ_underscore=yes + ;; +- i[3-7]86-*-linux-gnu*) ++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) + targ_defvec=bfd_elf32_i386_vec + targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec" + targ64_selvecs=bfd_elf64_x86_64_vec +@@ -515,7 +515,7 @@ + targ_defvec=bfd_elf64_x86_64_vec + targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec" + ;; +- x86_64-*-linux-gnu*) ++ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) + targ_defvec=bfd_elf64_x86_64_vec + targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec" + ;; +@@ -690,7 +690,7 @@ + targ_selvecs=bfd_elf32_m68k_vec + targ_underscore=yes + ;; +- m68*-*-linux-gnu*) ++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*) + targ_defvec=bfd_elf32_m68k_vec + targ_selvecs=m68klinux_vec + ;; +@@ -966,7 +966,8 @@ + ;; + #endif + powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \ +- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \ ++ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \ ++ powerpc-*-rtems* | \ + powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*) + targ_defvec=bfd_elf32_powerpc_vec + targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec" +@@ -1003,8 +1004,8 @@ + targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" + ;; + powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \ +- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\ +- powerpcle-*-rtems*) ++ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\ ++ powerpcle-*-vxworks* | powerpcle-*-rtems*) + targ_defvec=bfd_elf32_powerpcle_vec + targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" + targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" +@@ -1165,7 +1166,7 @@ + targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec" + targ_underscore=yes + ;; +- sparc-*-linux-gnu*) ++ sparc-*-linux-gnu* | sparc-*-linux-uclibc*) + targ_defvec=bfd_elf32_sparc_vec + targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec" + ;; +@@ -1212,7 +1213,7 @@ + targ_defvec=sunos_big_vec + targ_underscore=yes + ;; +- sparc64-*-linux-gnu*) ++ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) + targ_defvec=bfd_elf64_sparc_vec + targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec" + ;; +--- binutils-2.15.91.0.1/bfd/configure~binutils-2.15.90.0.3-uclibc-100-conf ++++ binutils-2.15.91.0.1/bfd/configure +@@ -1687,6 +1687,11 @@ + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + ++linux-uclibc*) ++ lt_cv_deplibs_check_method=pass_all ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` ++ ;; ++ + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' +@@ -5266,7 +5271,7 @@ + alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) + COREFILE='' + ;; +- alpha*-*-linux-gnu*) ++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/alphalinux.h"' + ;; +@@ -5326,7 +5331,7 @@ + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i386mach3.h"' + ;; +- i[3-7]86-*-linux-gnu*) ++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i386linux.h"' + ;; +@@ -5364,7 +5369,7 @@ + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/hp300bsd.h"' + ;; +- m68*-*-linux-gnu*) ++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/m68klinux.h"' + ;; +--- binutils-2.15.91.0.1/bfd/configure.in~binutils-2.15.90.0.3-uclibc-100-conf ++++ binutils-2.15.91.0.1/bfd/configure.in +@@ -164,7 +164,7 @@ + alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) + COREFILE='' + ;; +- alpha*-*-linux-gnu*) ++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/alphalinux.h"' + ;; +@@ -245,7 +245,7 @@ + TRAD_HEADER='"hosts/i386mach3.h"' + ;; + changequote(,)dnl +- i[3-7]86-*-linux-gnu*) ++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) + changequote([,])dnl + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i386linux.h"' +@@ -286,7 +286,7 @@ + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/hp300bsd.h"' + ;; +- m68*-*-linux-gnu*) ++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/m68klinux.h"' + ;; diff --git a/recipes/gdb/gdb-6.3/thumb-breakpoint.patch b/recipes/gdb/gdb-6.3/thumb-breakpoint.patch new file mode 100644 index 0000000000..cd678b0b93 --- /dev/null +++ b/recipes/gdb/gdb-6.3/thumb-breakpoint.patch @@ -0,0 +1,41 @@ +# This patch causes gdb to use thumb swi(1) on linux for a thumb breakpoint +# rather than the default, swi(254). To stand any chance of making this +# work a linux kernel patch is required to read the swi number on a thumb +# swi. In the absence of this patch gdb will effectively insert a random +# swi because the kernel reads the swi number from r7... +# +--- gdb-6.3/gdb/arm-linux-tdep.c.orig 2005-09-19 13:55:16.486702426 -0700 ++++ gdb-6.3/gdb/arm-linux-tdep.c 2005-09-19 13:57:44.127992906 -0700 +@@ -44,6 +44,12 @@ + + static const char arm_linux_arm_be_breakpoint[] = { 0xef, 0x9f, 0x00, 0x01 }; + ++/* The following requires the corresponding patch to the kernel to recognise ++ * this SWI as a breakpoint. ++ */ ++static const char arm_linux_thumb_le_breakpoint[] = {0x01, 0xdf}; ++static const char arm_linux_thumb_be_breakpoint[] = {0xdf, 0x01}; ++ + /* Description of the longjmp buffer. */ + #define ARM_LINUX_JB_ELEMENT_SIZE INT_REGISTER_SIZE + #define ARM_LINUX_JB_PC 21 +@@ -463,10 +469,17 @@ + + tdep->lowest_pc = 0x8000; + if (info.byte_order == BFD_ENDIAN_BIG) +- tdep->arm_breakpoint = arm_linux_arm_be_breakpoint; ++ { ++ tdep->arm_breakpoint = arm_linux_arm_be_breakpoint; ++ tdep->thumb_breakpoint = arm_linux_thumb_be_breakpoint; ++ } + else +- tdep->arm_breakpoint = arm_linux_arm_le_breakpoint; ++ { ++ tdep->arm_breakpoint = arm_linux_arm_le_breakpoint; ++ tdep->thumb_breakpoint = arm_linux_thumb_le_breakpoint; ++ } + tdep->arm_breakpoint_size = sizeof (arm_linux_arm_le_breakpoint); ++ tdep->thumb_breakpoint_size = sizeof (arm_linux_thumb_le_breakpoint); + + tdep->fp_model = ARM_FLOAT_FPA; + diff --git a/recipes/gdb/gdb-6.3/uclibc.patch b/recipes/gdb/gdb-6.3/uclibc.patch new file mode 100644 index 0000000000..b3981202ff --- /dev/null +++ b/recipes/gdb/gdb-6.3/uclibc.patch @@ -0,0 +1,194 @@ +--- gdb-6.3/bfd/config.bfd.orig 2004-10-15 06:47:11.000000000 +0100 ++++ gdb-6.3/bfd/config.bfd 2005-01-05 19:30:32.000000000 +0000 +@@ -129,7 +129,7 @@ + targ_defvec=ecoffalpha_little_vec + targ_selvecs=bfd_elf64_alpha_vec + ;; +- alpha*-*-linux-gnu* | alpha*-*-elf*) ++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*) + targ_defvec=bfd_elf64_alpha_vec + targ_selvecs=ecoffalpha_little_vec + ;; +@@ -139,7 +139,7 @@ + alpha*-*-*) + targ_defvec=ecoffalpha_little_vec + ;; +- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu) ++ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-linux-uclibc* | ia64*-*-kfreebsd*-gnu) + targ_defvec=bfd_elf64_ia64_little_vec + targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec" + ;; +@@ -216,7 +216,7 @@ + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec + ;; +- armeb-*-elf | arm*b-*-linux-gnu*) ++ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*) + targ_defvec=bfd_elf32_bigarm_vec + targ_selvecs=bfd_elf32_littlearm_vec + ;; +@@ -224,8 +224,8 @@ + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec + ;; +- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \ +- arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks | \ ++ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | \ ++ arm*-*-conix* | arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks | \ + arm*-*-eabi* ) + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec +@@ -378,7 +378,7 @@ + ;; + + #ifdef BFD64 +- hppa*64*-*-linux-gnu*) ++ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) + targ_defvec=bfd_elf64_hppa_linux_vec + targ_selvecs=bfd_elf64_hppa_vec + ;; +@@ -389,7 +389,7 @@ + ;; + #endif + +- hppa*-*-linux-gnu*) ++ hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) + targ_defvec=bfd_elf32_hppa_linux_vec + targ_selvecs=bfd_elf32_hppa_vec + ;; +@@ -522,7 +522,7 @@ + targ_selvecs=bfd_elf32_i386_vec + targ_underscore=yes + ;; +- i[3-7]86-*-linux-gnu*) ++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) + targ_defvec=bfd_elf32_i386_vec + targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec" + targ64_selvecs=bfd_elf64_x86_64_vec +@@ -536,7 +536,7 @@ + targ_defvec=bfd_elf64_x86_64_vec + targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec" + ;; +- x86_64-*-linux-gnu*) ++ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) + targ_defvec=bfd_elf64_x86_64_vec + targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec" + ;; +@@ -711,7 +711,7 @@ + targ_selvecs=bfd_elf32_m68k_vec + targ_underscore=yes + ;; +- m68*-*-linux-gnu*) ++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*) + targ_defvec=bfd_elf32_m68k_vec + targ_selvecs=m68klinux_vec + ;; +@@ -987,7 +987,8 @@ + ;; + #endif + powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \ +- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \ ++ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \ ++ powerpc-*-rtems* | \ + powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*) + targ_defvec=bfd_elf32_powerpc_vec + targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec" +@@ -1024,8 +1025,8 @@ + targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" + ;; + powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \ +- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\ +- powerpcle-*-rtems*) ++ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\ ++ powerpcle-*-vxworks* | powerpcle-*-rtems*) + targ_defvec=bfd_elf32_powerpcle_vec + targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" + targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" +@@ -1192,7 +1193,7 @@ + targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec" + targ_underscore=yes + ;; +- sparc-*-linux-gnu*) ++ sparc-*-linux-gnu* | sparc-*-linux-uclibc*) + targ_defvec=bfd_elf32_sparc_vec + targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec" + ;; +@@ -1239,7 +1240,7 @@ + targ_defvec=sunos_big_vec + targ_underscore=yes + ;; +- sparc64-*-linux-gnu*) ++ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) + targ_defvec=bfd_elf64_sparc_vec + targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec" + ;; +--- gdb-6.3/bfd/configure.in.orig 2004-10-08 15:53:59.000000000 +0100 ++++ gdb-6.3/bfd/configure.in 2005-01-05 19:28:50.000000000 +0000 +@@ -163,7 +163,7 @@ + alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) + COREFILE='' + ;; +- alpha*-*-linux-gnu*) ++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/alphalinux.h"' + ;; +@@ -248,7 +248,7 @@ + TRAD_HEADER='"hosts/i386mach3.h"' + ;; + changequote(,)dnl +- i[3-7]86-*-linux-gnu*) ++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) + changequote([,])dnl + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i386linux.h"' +@@ -289,7 +289,7 @@ + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/hp300bsd.h"' + ;; +- m68*-*-linux-gnu*) ++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/m68klinux.h"' + ;; +--- gdb-6.3/bfd/configure.orig 2004-10-08 15:53:56.000000000 +0100 ++++ gdb-6.3/bfd/configure 2005-01-05 19:29:27.000000000 +0000 +@@ -3583,6 +3583,11 @@ + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + ++linux-uclibc*) ++ lt_cv_deplibs_check_method=pass_all ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` ++ ;; ++ + netbsd* | knetbsd*-gnu) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' +@@ -9914,7 +9919,7 @@ + alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) + COREFILE='' + ;; +- alpha*-*-linux-gnu*) ++ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/alphalinux.h"' + ;; +@@ -9978,7 +9983,7 @@ + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i386mach3.h"' + ;; +- i[3-7]86-*-linux-gnu*) ++ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/i386linux.h"' + ;; +@@ -10016,7 +10021,7 @@ + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/hp300bsd.h"' + ;; +- m68*-*-linux-gnu*) ++ m68*-*-linux-gnu* | m68*-*-linux-uclibc*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/m68klinux.h"' + ;; diff --git a/recipes/gdb/gdb-6.6/early_debug_in_nptl.patch b/recipes/gdb/gdb-6.6/early_debug_in_nptl.patch new file mode 100644 index 0000000000..c53f0d8ad5 --- /dev/null +++ b/recipes/gdb/gdb-6.6/early_debug_in_nptl.patch @@ -0,0 +1,306 @@ +http://sourceware.org/ml/gdb-patches/2007-06/msg00479.html + +Index: gdb/linux-thread-db.c +=================================================================== +--- gdb/linux-thread-db.c.orig 2006-10-20 03:08:14.000000000 +0200 ++++ gdb/linux-thread-db.c 2008-03-01 14:45:52.000000000 +0100 +@@ -213,6 +213,21 @@ + } + } + ++/* Return 1 if any threads have been registered. There may be none if ++ the threading library is not fully initialized yet. */ ++ ++static int ++have_threads_callback (struct thread_info *thread, void *dummy) ++{ ++ return 1; ++} ++ ++static int ++have_threads (void) ++{ ++ return iterate_over_threads (have_threads_callback, NULL) != NULL; ++} ++ + /* A callback function for td_ta_thr_iter, which we use to map all + threads to LWPs. + +@@ -700,23 +715,6 @@ + } + + static void +-thread_db_attach (char *args, int from_tty) +-{ +- target_beneath->to_attach (args, from_tty); +- +- /* Destroy thread info; it's no longer valid. */ +- init_thread_list (); +- +- /* The child process is now the actual multi-threaded +- program. Snatch its process ID... */ +- proc_handle.pid = GET_PID (inferior_ptid); +- +- /* ...and perform the remaining initialization steps. */ +- enable_thread_event_reporting (); +- thread_db_find_new_threads (); +-} +- +-static void + detach_thread (ptid_t ptid, int verbose) + { + struct thread_info *thread_info; +@@ -742,14 +740,13 @@ + disable_thread_event_reporting (); + + /* There's no need to save & restore inferior_ptid here, since the +- inferior is supposed to be survive this function call. */ ++ inferior is not supposed to survive this function call. */ + inferior_ptid = lwp_from_thread (inferior_ptid); + +- /* Forget about the child's process ID. We shouldn't need it +- anymore. */ +- proc_handle.pid = 0; +- + target_beneath->to_detach (args, from_tty); ++ ++ /* Should this be done by detach_command? */ ++ target_mourn_inferior (); + } + + static int +@@ -870,12 +867,6 @@ + + ptid = target_beneath->to_wait (ptid, ourstatus); + +- if (proc_handle.pid == 0) +- /* The current child process isn't the actual multi-threaded +- program yet, so don't try to do any special thread-specific +- post-processing and bail out early. */ +- return ptid; +- + if (ourstatus->kind == TARGET_WAITKIND_EXITED + || ourstatus->kind == TARGET_WAITKIND_SIGNALLED) + return pid_to_ptid (-1); +@@ -889,23 +880,32 @@ + return pid_to_ptid (GET_PID (ptid)); + } + ++ /* If we do not know about the main thread yet, this would be a good time to ++ find it. */ ++ if (ourstatus->kind == TARGET_WAITKIND_STOPPED && !have_threads ()) ++ thread_db_find_new_threads (); ++ + if (ourstatus->kind == TARGET_WAITKIND_STOPPED + && ourstatus->value.sig == TARGET_SIGNAL_TRAP) + /* Check for a thread event. */ + check_event (ptid); + +- if (!ptid_equal (trap_ptid, null_ptid)) +- trap_ptid = thread_from_lwp (trap_ptid); ++ if (have_threads ()) ++ { ++ /* Change ptids back into the higher level PID + TID format. If ++ the thread is dead and no longer on the thread list, we will ++ get back a dead ptid. This can occur if the thread death ++ event gets postponed by other simultaneous events. In such a ++ case, we want to just ignore the event and continue on. */ ++ ++ if (!ptid_equal (trap_ptid, null_ptid)) ++ trap_ptid = thread_from_lwp (trap_ptid); ++ ++ ptid = thread_from_lwp (ptid); ++ if (GET_PID (ptid) == -1) ++ ourstatus->kind = TARGET_WAITKIND_SPURIOUS; ++ } + +- /* Change the ptid back into the higher level PID + TID format. +- If the thread is dead and no longer on the thread list, we will +- get back a dead ptid. This can occur if the thread death event +- gets postponed by other simultaneous events. In such a case, +- we want to just ignore the event and continue on. */ +- ptid = thread_from_lwp (ptid); +- if (GET_PID (ptid) == -1) +- ourstatus->kind = TARGET_WAITKIND_SPURIOUS; +- + return ptid; + } + +@@ -944,30 +944,6 @@ + } + + static void +-thread_db_create_inferior (char *exec_file, char *allargs, char **env, +- int from_tty) +-{ +- unpush_target (&thread_db_ops); +- using_thread_db = 0; +- target_beneath->to_create_inferior (exec_file, allargs, env, from_tty); +-} +- +-static void +-thread_db_post_startup_inferior (ptid_t ptid) +-{ +- if (proc_handle.pid == 0) +- { +- /* The child process is now the actual multi-threaded +- program. Snatch its process ID... */ +- proc_handle.pid = GET_PID (ptid); +- +- /* ...and perform the remaining initialization steps. */ +- enable_thread_event_reporting (); +- thread_db_find_new_threads (); +- } +-} +- +-static void + thread_db_mourn_inferior (void) + { + /* Forget about the child's process ID. We shouldn't need it +@@ -1002,6 +978,22 @@ + + ptid = ptid_build (GET_PID (inferior_ptid), ti.ti_lid, ti.ti_tid); + ++ if (ti.ti_tid == 0) ++ { ++ /* A thread ID of zero means that this is the main thread, but ++ glibc has not yet initialized thread-local storage and the ++ pthread library. We do not know what the thread's TID will ++ be yet. Just enable event reporting and otherwise ignore ++ it. */ ++ ++ err = td_thr_event_enable_p (th_p, 1); ++ if (err != TD_OK) ++ error (_("Cannot enable thread event reporting for %s: %s"), ++ target_pid_to_str (ptid), thread_db_err_str (err)); ++ ++ return 0; ++ } ++ + if (!in_thread_list (ptid)) + attach_thread (ptid, th_p, &ti, 1); + +@@ -1058,6 +1050,16 @@ + return NULL; + } + ++/* Return 1 if this thread has the same LWP as the passed PTID. */ ++ ++static int ++same_ptid_callback (struct thread_info *thread, void *arg) ++{ ++ ptid_t *ptid_p = arg; ++ ++ return GET_LWP (thread->ptid) == GET_LWP (*ptid_p); ++} ++ + /* Get the address of the thread local variable in load module LM which + is stored at OFFSET within the thread local storage for thread PTID. */ + +@@ -1066,6 +1068,21 @@ + CORE_ADDR lm, + CORE_ADDR offset) + { ++ /* If we have not discovered any threads yet, check now. */ ++ if (!is_thread (ptid) && !have_threads ()) ++ thread_db_find_new_threads (); ++ ++ /* Try to find a matching thread if we still have the LWP ID instead ++ of the thread ID. */ ++ if (!is_thread (ptid)) ++ { ++ struct thread_info *thread; ++ ++ thread = iterate_over_threads (same_ptid_callback, &ptid); ++ if (thread != NULL) ++ ptid = thread->ptid; ++ } ++ + if (is_thread (ptid)) + { + td_err_e err; +@@ -1125,14 +1142,11 @@ + thread_db_ops.to_shortname = "multi-thread"; + thread_db_ops.to_longname = "multi-threaded child process."; + thread_db_ops.to_doc = "Threads and pthreads support."; +- thread_db_ops.to_attach = thread_db_attach; + thread_db_ops.to_detach = thread_db_detach; + thread_db_ops.to_resume = thread_db_resume; + thread_db_ops.to_wait = thread_db_wait; + thread_db_ops.to_xfer_partial = thread_db_xfer_partial; + thread_db_ops.to_kill = thread_db_kill; +- thread_db_ops.to_create_inferior = thread_db_create_inferior; +- thread_db_ops.to_post_startup_inferior = thread_db_post_startup_inferior; + thread_db_ops.to_mourn_inferior = thread_db_mourn_inferior; + thread_db_ops.to_find_new_threads = thread_db_find_new_threads; + thread_db_ops.to_pid_to_str = thread_db_pid_to_str; +Index: gdb/gdbserver/thread-db.c +=================================================================== +--- gdb/gdbserver/thread-db.c.orig 2006-10-17 18:02:27.000000000 +0200 ++++ gdb/gdbserver/thread-db.c 2008-03-01 14:44:41.000000000 +0100 +@@ -40,6 +40,7 @@ + /* Connection to the libthread_db library. */ + static td_thragent_t *thread_agent; + ++static void thread_db_find_new_threads (void); + static int find_new_threads_callback (const td_thrhandle_t *th_p, void *data); + + static char * +@@ -134,6 +135,8 @@ + td_event_msg_t msg; + td_err_e err; + struct inferior_linux_data *tdata; ++ struct thread_info *inferior; ++ struct process_info *process; + + if (debug_threads) + fprintf (stderr, "Thread creation event.\n"); +@@ -149,6 +152,14 @@ + fprintf (stderr, "thread getmsg err: %s\n", + thread_db_err_str (err)); + ++ /* If we do not know about the main thread yet, this would be a good time to ++ find it. We need to do this to pick up the main thread before any newly ++ created threads. */ ++ inferior = (struct thread_info *) all_threads.head; ++ process = get_thread_process (inferior); ++ if (process->thread_known == 0) ++ thread_db_find_new_threads (); ++ + /* msg.event == TD_EVENT_CREATE */ + + find_new_threads_callback (msg.th_p, NULL); +@@ -231,8 +242,24 @@ + { + inferior = (struct thread_info *) all_threads.head; + process = get_thread_process (inferior); ++ + if (process->thread_known == 0) + { ++ /* If the new thread ID is zero, a final thread ID will be ++ available later. Do not enable thread debugging yet. */ ++ if (ti_p->ti_tid == 0) ++ { ++ err = td_thr_event_enable (th_p, 1); ++ if (err != TD_OK) ++ error ("Cannot enable thread event reporting for %d: %s", ++ ti_p->ti_lid, thread_db_err_str (err)); ++ return; ++ } ++ ++ if (process->lwpid != ti_p->ti_lid) ++ fatal ("PID mismatch! Expected %ld, got %ld", ++ (long) process->lwpid, (long) ti_p->ti_lid); ++ + /* Switch to indexing the threads list by TID. */ + change_inferior_id (&all_threads, ti_p->ti_tid); + goto found; +@@ -331,6 +358,8 @@ + + process = get_thread_process (thread); + if (!process->thread_known) ++ thread_db_find_new_threads (); ++ if (!process->thread_known) + return TD_NOTHR; + + err = td_thr_tls_get_addr (&process->th, (psaddr_t) load_module, offset, diff --git a/recipes/gdb/gdb-6.8/gcc-4.3-build-error.patch b/recipes/gdb/gdb-6.8/gcc-4.3-build-error.patch new file mode 100644 index 0000000000..36e501af1a --- /dev/null +++ b/recipes/gdb/gdb-6.8/gcc-4.3-build-error.patch @@ -0,0 +1,129 @@ +http://patches.ubuntu.com/g/gdb/extracted/gcc-4.3-build-error.patch + +--- gdb/cli/cli-cmds.c~ 2008-06-24 16:07:25.000000000 +0200 ++++ gdb/cli/cli-cmds.c 2008-06-24 16:22:31.000000000 +0200 +@@ -323,7 +323,8 @@ + { + if (args) + error (_("The \"pwd\" command does not take an argument: %s"), args); +- getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); ++ if (!getcwd (gdb_dirbuf, sizeof (gdb_dirbuf))) ++ error (_("Unable to determine current directory")); + + if (strcmp (gdb_dirbuf, current_directory) != 0) + printf_unfiltered (_("Working directory %s\n (canonically %s).\n"), +--- gdb/linux-nat.c~ 2008-01-29 23:47:20.000000000 +0100 ++++ gdb/linux-nat.c 2008-06-24 16:18:57.000000000 +0200 +@@ -2876,7 +2876,8 @@ + sprintf (fname1, "/proc/%lld/cmdline", pid); + if ((procfile = fopen (fname1, "r")) != NULL) + { +- fgets (buffer, sizeof (buffer), procfile); ++ if (!fgets (buffer, sizeof (buffer), procfile)) ++ error(_("Unable to read '%s'"), fname1); + printf_filtered ("cmdline = '%s'\n", buffer); + fclose (procfile); + } +--- gdb/inflow.c~ 2008-01-01 23:53:11.000000000 +0100 ++++ gdb/inflow.c 2008-06-24 16:32:10.000000000 +0200 +@@ -512,7 +512,7 @@ + void + new_tty (void) + { +- int tty; ++ int tty, rv; + + if (inferior_thisrun_terminal == 0) + return; +@@ -545,17 +545,17 @@ + if (tty != 0) + { + close (0); +- dup (tty); ++ rv = dup (tty); + } + if (tty != 1) + { + close (1); +- dup (tty); ++ rv = dup (tty); + } + if (tty != 2) + { + close (2); +- dup (tty); ++ rv = dup (tty); + } + if (tty > 2) + close (tty); +--- gdb/mi/mi-cmd-env.c~ 2008-01-01 23:53:14.000000000 +0100 ++++ gdb/mi/mi-cmd-env.c 2008-06-24 16:23:25.000000000 +0200 +@@ -78,7 +78,8 @@ + + /* Otherwise the mi level is 2 or higher. */ + +- getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); ++ if (!getcwd (gdb_dirbuf, sizeof (gdb_dirbuf))) ++ error (_("Unable to determine current directory")); + ui_out_field_string (uiout, "cwd", gdb_dirbuf); + + return MI_CMD_DONE; +--- gdb/utils.c~ 2008-01-01 23:53:13.000000000 +0100 ++++ gdb/utils.c 2008-06-24 16:29:13.000000000 +0200 +@@ -688,6 +688,7 @@ + static int dejavu; + int quit_p; + int dump_core_p; ++ int rv; + char *reason; + + /* Don't allow infinite error/warning recursion. */ +@@ -704,7 +705,7 @@ + abort (); /* NOTE: GDB has only three calls to abort(). */ + default: + dejavu = 3; +- write (STDERR_FILENO, msg, sizeof (msg)); ++ rv = write (STDERR_FILENO, msg, sizeof (msg)); + exit (1); + } + } +--- gdb/top.c~ 2008-01-01 23:53:13.000000000 +0100 ++++ gdb/top.c 2008-06-24 16:26:51.000000000 +0200 +@@ -1628,7 +1628,8 @@ + + /* Run the init function of each source file */ + +- getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); ++ if (!getcwd (gdb_dirbuf, sizeof (gdb_dirbuf))) ++ error (_("Unable to determine current directory")); + current_directory = gdb_dirbuf; + + #ifdef __MSDOS__ +--- gdb/ui-file.c~ 2008-01-01 23:53:13.000000000 +0100 ++++ gdb/ui-file.c 2008-06-24 16:30:16.000000000 +0200 +@@ -477,11 +477,12 @@ + static void + stdio_file_write (struct ui_file *file, const char *buf, long length_buf) + { ++ int rv; + struct stdio_file *stdio = ui_file_data (file); + if (stdio->magic != &stdio_file_magic) + internal_error (__FILE__, __LINE__, + _("stdio_file_write: bad magic number")); +- fwrite (buf, length_buf, 1, stdio->file); ++ rv = fwrite (buf, length_buf, 1, stdio->file); + } + + static void +--- gdb/main.c~ 2008-06-24 16:07:25.000000000 +0200 ++++ gdb/main.c 2008-06-24 16:25:05.000000000 +0200 +@@ -188,7 +188,8 @@ + line[0] = '\0'; /* Terminate saved (now empty) cmd line */ + instream = stdin; + +- getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); ++ if (!getcwd (gdb_dirbuf, sizeof (gdb_dirbuf))) ++ error (_("Unable to determine current directory")); + current_directory = gdb_dirbuf; + + gdb_stdout = stdio_fileopen (stdout); diff --git a/recipes/gdb/gdb-6.8/gdb-6.8-mingw-3.patch b/recipes/gdb/gdb-6.8/gdb-6.8-mingw-3.patch new file mode 100644 index 0000000000..7bfcca7518 --- /dev/null +++ b/recipes/gdb/gdb-6.8/gdb-6.8-mingw-3.patch @@ -0,0 +1,425 @@ +diff -urp gdb-6.8_orig/gdb/gdbserver/remote-utils.c gdb-6.8/gdb/gdbserver/remote-utils.c +--- gdb-6.8_orig/gdb/gdbserver/remote-utils.c 2008-01-29 16:51:50.000000000 -0800 ++++ gdb-6.8/gdb/gdbserver/remote-utils.c 2008-04-09 14:04:30.000000000 -0700 +@@ -617,7 +617,12 @@ input_interrupt (int unused) + + cc = read (remote_desc, &c, 1); + ++#ifdef _WIN32_WINNT ++ // its normal in windows for current_inferior to be null. ++ if (cc != 1 || c != '\003' /*|| current_inferior == NULL*/) ++#else + if (cc != 1 || c != '\003' || current_inferior == NULL) ++#endif + { + fprintf (stderr, "input_interrupt, count = %d c = %d ('%c')\n", + cc, c, c); +diff -urp gdb-6.8_orig/gdb/gdbserver/server.c gdb-6.8/gdb/gdbserver/server.c +--- gdb-6.8_orig/gdb/gdbserver/server.c 2008-02-19 13:36:54.000000000 -0800 ++++ gdb-6.8/gdb/gdbserver/server.c 2008-04-23 13:56:51.000000000 -0700 +@@ -29,6 +29,10 @@ + #include <sys/wait.h> + #endif + ++#ifdef _WIN32 ++#include <windows.h> ++#endif ++ + unsigned long cont_thread; + unsigned long general_thread; + unsigned long step_thread; +@@ -268,6 +272,20 @@ monitor_show_help (void) + monitor_output (" Enable general debugging messages\n"); + monitor_output (" set remote-debug <0|1>\n"); + monitor_output (" Enable remote protocol debugging messages\n"); ++#ifdef _WIN32 ++ monitor_output (" get processlist\n"); ++ monitor_output (" List remote processes with names and pid\n"); ++ monitor_output (" get processlistmi\n"); ++ monitor_output (" Process list in an MI-like format\n"); ++#endif ++ monitor_output (" set env <name=value>\n"); ++ monitor_output (" Set environment variable in remote environment\n"); ++ monitor_output (" cd <directory>\n"); ++ monitor_output (" Change current working directory\n"); ++ monitor_output (" pwd\n"); ++ monitor_output (" Print current working directory\n"); ++ monitor_output (" shell <command line>\n"); ++ monitor_output (" Execute command on remote target\n"); + monitor_output (" exit\n"); + monitor_output (" Quit GDBserver\n"); + } +@@ -279,6 +297,47 @@ monitor_show_help (void) + return; \ + } + ++#ifdef _WIN32 ++typedef DWORD (__stdcall *GETPROCESSIMAGEFILENAME)(HANDLE hProcess, LPTSTR lpImageFileName, DWORD nSize); ++typedef BOOL (__stdcall *ENUMPROCESSES)(DWORD* pProcessIds, DWORD cb, DWORD* pBytesReturned); ++ ++# define HAS_DEVICE(P) \ ++((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ ++&& (P)[1] == ':') ++# define FILE_SYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0) ++# define ISSLASH(C) ((C) == '/' || (C) == '\\') ++ ++char * ++__basename (char const *name) ++{ ++ char const *base = name += FILE_SYSTEM_PREFIX_LEN (name); ++ int all_slashes = 1; ++ char const *p; ++ ++ for (p = name; *p; p++) ++ { ++ if (ISSLASH (*p)) ++ base = p + 1; ++ else ++ all_slashes = 0; ++ } ++ ++ /* If NAME is all slashes, arrange to return `/'. */ ++ if (*base == '\0' && ISSLASH (*name) && all_slashes) ++ --base; ++ ++ /* Make sure the last byte is not a slash. */ ++ //assert (all_slashes || !ISSLASH (*(p - 1))); ++ ++ return (char *) base; ++} ++#endif ++ ++#ifndef _POSIX_PATH_MAX ++#define _POSIX_PATH_MAX 1024 ++#define _POSIX_PATH_MAX_WAS_UNDEFINED ++#endif ++ + /* Handle all of the extended 'q' packets. */ + void + handle_query (char *own_buf, int packet_len, int *new_packet_len_p) +@@ -664,6 +723,158 @@ handle_query (char *own_buf, int packet_ + debug_threads = 1; + monitor_output ("Debug output enabled.\n"); + } ++#ifdef _WIN32 ++ else if (strncmp (mon, "get processlist", 15) == 0) ++ { ++ HINSTANCE lib = LoadLibrary("PSAPI.DLL"); ++ GETPROCESSIMAGEFILENAME imageFilename = (GETPROCESSIMAGEFILENAME)GetProcAddress(lib, "GetProcessImageFileNameA"); ++ ENUMPROCESSES enumProcesses = (ENUMPROCESSES)GetProcAddress(lib, "EnumProcesses"); ++ ++ char* name = (char*)malloc(MAX_PATH); ++ ++ int miMode = (strcmp(mon, "get processlistmi") == 0); ++ ++ DWORD* pids = (DWORD*)malloc(sizeof(DWORD)*1024); ++ memset(pids, 0, sizeof(pids)); ++ DWORD size = 0; ++ ++ if (!enumProcesses(pids, 1024 * sizeof(DWORD), &size)) ++ { ++ free(pids); ++ free(mon); ++ return; ++ } ++ ++ int cnt = 0; ++ int number = size / sizeof(DWORD); ++ ++ char* miOutput = NULL; ++ ++ if (!miMode) ++ monitor_output("Remote process list:\n"); ++ else ++ { ++ miOutput = (char*)malloc((number * 255) * sizeof(char)); ++ strcpy(miOutput, "^done,processlist=["); ++ } ++ ++ for (cnt = 0; cnt < number; cnt++) ++ { ++ HMODULE hProcess = (HMODULE)OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pids[cnt]); ++ strcpy(name, ""); ++ printf(name); ++ ++ imageFilename(hProcess, name, MAX_PATH); ++ ++ if (pids[cnt] > 4 && strcmp(name, "") != 0) ++ { ++ char item[2048] = ""; ++ char tmp[24] = "0"; ++ itoa(pids[cnt], tmp, 10); ++ strcat(item, tmp); ++ strcat(item, "="); ++ strcat(item, __basename(name)); ++ ++ if (!miMode) ++ { ++ strcat(item, "\n"); ++ monitor_output(item); ++ } ++ else ++ { ++ strcat(miOutput, item); ++ strcat(miOutput, ","); ++ } ++ } ++ ++ CloseHandle(hProcess); ++ } ++ ++ if (miMode) ++ { ++ strcat(miOutput, "]\n"); ++ monitor_output(miOutput); ++ free(miOutput); ++ } ++ ++ FreeLibrary(lib); ++ ++ free(pids); ++ free(name); ++ } ++#endif ++ else if (strncmp (mon, "set env ", 8) == 0) ++ { ++ char* envLine = mon + 8; ++ char* envName = strtok(envLine, "= "); ++ char* envValue = strtok(NULL, "= "); ++ if (envName && envValue) ++ { ++#ifdef _WIN32 ++ SetEnvironmentVariable(envName, envValue); ++#else ++ setenv(envName, envValue, 1); ++#endif ++ monitor_output("Target environment variable set ("); ++ monitor_output(envName); ++ monitor_output(" = "); ++ monitor_output(envValue); ++ monitor_output(").\n"); ++ } ++ else ++ monitor_output("Incorrect format for environment variable.\n"); ++ } ++ else if (strncmp (mon, "cd ", 3) == 0) ++ { ++ char* dir = mon + 3; ++ if (strlen(dir) > 0) ++ chdir(dir); ++ } ++ else if (strcmp(mon, "pwd") == 0) ++ { ++ long size = _POSIX_PATH_MAX; ++ char* current_directory = (char*)malloc(size); ++ getcwd(current_directory, size); ++ if (strlen(current_directory) > 0) ++ { ++ monitor_output(current_directory); ++ monitor_output("\n"); ++ } ++ free(current_directory); ++ } ++ else if (strncmp (mon, "shell ", 6) == 0) ++ { ++ char* arg = mon + 6; ++ ++ if (strlen(arg) == 0) ++ { ++ monitor_output("Inferior shells are not supported."); ++ free(mon); ++ return; ++ } ++ ++ long size = _POSIX_PATH_MAX; ++ char* current_directory = (char*)malloc(size); ++ getcwd(current_directory, size); ++ ++ int rc = system (arg); ++ char msg[255]; ++ if (rc == -1) ++ { ++ sprintf(msg, "Cannot execute '%s': %s.\n", arg, strerror(errno)); ++ monitor_output(msg); ++ } ++ else if (rc != -1) ++ { ++ sprintf(msg, "'%s' exited with status %d.\n", arg, rc); ++ monitor_output(msg); ++ } ++ ++ /* Make sure to return to the directory GDB thinks it is, in case the ++ shell command we just ran changed it. */ ++ chdir(current_directory); ++ free(current_directory); ++ } + else if (strcmp (mon, "set debug 0") == 0) + { + debug_threads = 0; +@@ -699,6 +910,11 @@ handle_query (char *own_buf, int packet_ + own_buf[0] = 0; + } + ++#ifdef _POSIX_PATH_MAX_WAS_UNDEFINED ++#undef _POSIX_PATH_MAX ++#undef _POSIX_PATH_MAX_WAS_UNDEFINED ++#endif ++ + /* Parse vCont packets. */ + void + handle_v_cont (char *own_buf, char *status, int *signal) +@@ -1503,6 +1719,8 @@ main (int argc, char *argv[]) + fprintf (stderr, "\nChild terminated with signal = 0x%x (%s)\n", + target_signal_to_host (signal), + target_signal_to_name (signal)); ++ ++ kill_inferior(); + + if (extended_protocol) + goto restart; +diff -urp gdb-6.8_orig/gdb/gdbserver/win32-low.c gdb-6.8/gdb/gdbserver/win32-low.c +--- gdb-6.8_orig/gdb/gdbserver/win32-low.c 2008-02-14 14:41:39.000000000 -0800 ++++ gdb-6.8/gdb/gdbserver/win32-low.c 2008-04-22 23:24:38.000000000 -0700 +@@ -38,7 +38,7 @@ + #include <sys/cygwin.h> + #endif + +-#define LOG 0 ++#define LOG 1 + + #define OUTMSG(X) do { printf X; fflush (stdout); } while (0) + #if LOG +@@ -543,9 +543,9 @@ win32_create_inferior (char *program, ch + } + OUTMSG2 (("Command line is \"%s\"\n", args)); + +-#ifdef CREATE_NEW_PROCESS_GROUP ++//#ifdef CREATE_NEW_PROCESS_GROUP + flags |= CREATE_NEW_PROCESS_GROUP; +-#endif ++//#endif + + ret = create_process (program, args, flags, &pi); + err = GetLastError (); +@@ -684,8 +684,37 @@ win32_kill (void) + if (current_process_handle == NULL) + return; + +- TerminateProcess (current_process_handle, 0); +- for (;;) ++ TerminateProcess (current_process_handle, 0); ++ ++ // BKS - fix for terminating apps prior to their exit, lets go of execs. ++ winapi_DebugActiveProcessStop DebugActiveProcessStop = NULL; ++ winapi_DebugSetProcessKillOnExit DebugSetProcessKillOnExit = NULL; ++#ifdef _WIN32_WCE ++ HMODULE dll = GetModuleHandle (_T("COREDLL.DLL")); ++#else ++ HMODULE dll = GetModuleHandle (_T("KERNEL32.DLL")); ++#endif ++ DebugActiveProcessStop = GETPROCADDRESS (dll, DebugActiveProcessStop); ++ DebugSetProcessKillOnExit = GETPROCADDRESS (dll, DebugSetProcessKillOnExit); ++ ++ if (DebugSetProcessKillOnExit != NULL ++ && DebugActiveProcessStop != NULL) ++ { ++ { ++ struct thread_resume resume; ++ resume.thread = -1; ++ resume.step = 0; ++ resume.sig = 0; ++ resume.leave_stopped = 0; ++ win32_resume (&resume); ++ } ++ ++ DebugActiveProcessStop (current_process_id); ++ DebugSetProcessKillOnExit (FALSE); ++ } ++ // end BKS ++ ++ for (;;) + { + if (!child_continue (DBG_CONTINUE, -1)) + break; +@@ -1186,6 +1215,7 @@ handle_exception (struct target_waitstat + + ourstatus->kind = TARGET_WAITKIND_STOPPED; + ++ //printf("handle exception....................%X\n", (unsigned int)code); + switch (code) + { + case EXCEPTION_ACCESS_VIOLATION: +@@ -1196,7 +1226,13 @@ handle_exception (struct target_waitstat + OUTMSG2 (("STATUS_STACK_OVERFLOW")); + ourstatus->value.sig = TARGET_SIGNAL_SEGV; + break; +- case STATUS_FLOAT_DENORMAL_OPERAND: ++ // BKS ++ case STATUS_INVALID_HANDLE: ++ OUTMSG2 (("STATUS_INVALID_HANDLE")); ++ ourstatus->value.sig = TARGET_SIGNAL_TRAP; ++ break; ++ // BKS ++ case STATUS_FLOAT_DENORMAL_OPERAND: + OUTMSG2 (("STATUS_FLOAT_DENORMAL_OPERAND")); + ourstatus->value.sig = TARGET_SIGNAL_FPE; + break; +@@ -1453,7 +1489,8 @@ get_child_debug_event (struct target_wai + (unsigned) current_event.dwThreadId)); + ourstatus->kind = TARGET_WAITKIND_EXITED; + ourstatus->value.integer = current_event.u.ExitProcess.dwExitCode; +- CloseHandle (current_process_handle); ++ win32_kill(); // fixed problem with exec's not being let go after completion. ++ //CloseHandle (current_process_handle); // let this get done by win32_kill(). + current_process_handle = NULL; + break; + +diff -urp gdb-6.8_orig/gdb/linespec.c gdb-6.8/gdb/linespec.c +--- gdb-6.8_orig/gdb/linespec.c 2008-01-01 14:53:11.000000000 -0800 ++++ gdb-6.8/gdb/linespec.c 2008-04-23 11:15:58.000000000 -0700 +@@ -1534,11 +1534,11 @@ symtab_from_filename (char **argptr, cha + file_symtab = lookup_symtab (copy); + if (file_symtab == 0) + { +- if (!have_full_symbols () && !have_partial_symbols ()) +- error (_("No symbol table is loaded. Use the \"file\" command.")); ++// if (!have_full_symbols () && !have_partial_symbols ()) ++// error (_("No symbol table is loaded. Use the \"file\" command.")); + if (not_found_ptr) + *not_found_ptr = 1; +- throw_error (NOT_FOUND_ERROR, _("No source file named %s."), copy); ++ throw_error (NOT_FOUND_ERROR, _("No source file named %s in loaded symbols."), copy); + } + + /* Discard the file name from the arg. */ +@@ -1744,13 +1744,13 @@ decode_variable (char *copy, int funfirs + if (msymbol != NULL) + return minsym_found (funfirstline, msymbol); + +- if (!have_full_symbols () && ++ /*if (!have_full_symbols () && + !have_partial_symbols () && !have_minimal_symbols ()) +- error (_("No symbol table is loaded. Use the \"file\" command.")); ++ error (_("No symbol table is loaded. Use the \"file\" command."));*/ + + if (not_found_ptr) + *not_found_ptr = 1; +- throw_error (NOT_FOUND_ERROR, _("Function \"%s\" not defined."), copy); ++ throw_error (NOT_FOUND_ERROR, _("Function \"%s\" not defined in loaded symbols."), copy); + } + + +diff -urp gdb-6.8_orig/gdb/win32-nat.c gdb-6.8/gdb/win32-nat.c +--- gdb-6.8_orig/gdb/win32-nat.c 2008-01-29 13:11:24.000000000 -0800 ++++ gdb-6.8/gdb/win32-nat.c 2008-04-18 17:45:52.000000000 -0700 +@@ -1031,6 +1031,10 @@ handle_exception (struct target_waitstat + DEBUG_EXCEPTION_SIMPLE ("STATUS_STACK_OVERFLOW"); + ourstatus->value.sig = TARGET_SIGNAL_SEGV; + break; ++ case STATUS_INVALID_HANDLE: ++ DEBUG_EXCEPTION_SIMPLE ("STATUS_INVALID_HANDLE"); ++ ourstatus->value.sig = TARGET_SIGNAL_TRAP; ++ break; + case STATUS_FLOAT_DENORMAL_OPERAND: + DEBUG_EXCEPTION_SIMPLE ("STATUS_FLOAT_DENORMAL_OPERAND"); + ourstatus->value.sig = TARGET_SIGNAL_FPE; diff --git a/recipes/gdb/gdb-6.8/gdb-6.8-mips-mingw-sim-fixup.patch b/recipes/gdb/gdb-6.8/gdb-6.8-mips-mingw-sim-fixup.patch new file mode 100644 index 0000000000..2a31e29174 --- /dev/null +++ b/recipes/gdb/gdb-6.8/gdb-6.8-mips-mingw-sim-fixup.patch @@ -0,0 +1,17 @@ +--- + sim/common/sim-signal.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: gdb-6.8/sim/common/sim-signal.c +=================================================================== +--- gdb-6.8.orig/sim/common/sim-signal.c ++++ gdb-6.8/sim/common/sim-signal.c +@@ -26,7 +26,7 @@ along with this program. If not, see <h + to not think the process has died (so it can be debugged at the point of + failure). */ + +-#ifdef _MSC_VER ++#ifdef __WIN32 + #ifndef SIGTRAP + #define SIGTRAP 5 + #endif diff --git a/recipes/gdb/gdb-6.8/gdb-6.8-pr9638-ppc-canadian-configh.patch b/recipes/gdb/gdb-6.8/gdb-6.8-pr9638-ppc-canadian-configh.patch new file mode 100644 index 0000000000..83e85ba3cd --- /dev/null +++ b/recipes/gdb/gdb-6.8/gdb-6.8-pr9638-ppc-canadian-configh.patch @@ -0,0 +1,179 @@ +diff -urN gdb-6.8-pl1/sim/ppc/Makefile.in gdb-6.8-pl2/sim/ppc/Makefile.in +--- gdb-6.8-pl1/sim/ppc/Makefile.in 2006-05-31 17:14:45.000000000 +0200 ++++ gdb-6.8-pl2/sim/ppc/Makefile.in 2008-09-30 15:56:33.000000000 +0200 +@@ -61,7 +61,7 @@ + AR = @AR@ + AR_FLAGS = rc + CC = @CC@ +-CFLAGS = @CFLAGS@ ++CFLAGS = @CFLAGS@ -DHAVE_CONFIG_H + CC_FOR_BUILD = @CC_FOR_BUILD@ + CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ + BISON = bison +@@ -115,8 +115,8 @@ + $(DEVZERO_CFLAGS) + SIM_FPU_CFLAGS = @sim_fpu_cflags@ + +-STD_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS) +-NOWARN_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(SIM_FPU_CFLAGS) ++STD_CFLAGS = $(CFLAGS) -DHAVE_CONFIG_H $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS) ++NOWARN_CFLAGS = $(CFLAGS) -DHAVE_CONFIG_H $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(SIM_FPU_CFLAGS) + BUILD_CFLAGS = $(CFLAGS_FOR_BUILD) $(INCLUDES) $(WARNING_CFLAGS) + + BUILD_LDFLAGS = +diff -urN gdb-6.8-orig/sim/ppc/basics.h gdb-6.8-pl1/sim/ppc/basics.h +--- gdb-6.8-orig/sim/ppc/basics.h 1999-04-16 03:35:08.000000000 +0200 ++++ gdb-6.8-pl1/sim/ppc/basics.h 2008-09-30 15:12:32.000000000 +0200 +@@ -86,7 +86,9 @@ + + /* Basic configuration */ + ++#ifdef HAVE_CONFIG_H + #include "config.h" ++#endif + #include "ppc-config.h" + #include "inline.h" + +diff -urN gdb-6.8-orig/sim/ppc/debug.c gdb-6.8-pl1/sim/ppc/debug.c +--- gdb-6.8-orig/sim/ppc/debug.c 1999-04-16 03:35:08.000000000 +0200 ++++ gdb-6.8-pl1/sim/ppc/debug.c 2008-09-30 15:12:27.000000000 +0200 +@@ -22,7 +22,9 @@ + #ifndef _DEBUG_C_ + #define _DEBUG_C_ + ++#ifdef HAVE_CONFIG_H + #include "config.h" ++#endif + #include "basics.h" + + #ifdef HAVE_STDLIB_H +diff -urN gdb-6.8-orig/sim/ppc/dgen.c gdb-6.8-pl1/sim/ppc/dgen.c +--- gdb-6.8-orig/sim/ppc/dgen.c 1999-04-16 03:35:08.000000000 +0200 ++++ gdb-6.8-pl1/sim/ppc/dgen.c 2008-09-30 15:12:22.000000000 +0200 +@@ -27,7 +27,9 @@ + #include <ctype.h> + #include <stdarg.h> + ++#ifdef HAVE_CONFIG_H + #include "config.h" ++#endif + #include "misc.h" + #include "lf.h" + #include "table.h" +diff -urN gdb-6.8-orig/sim/ppc/filter.c gdb-6.8-pl1/sim/ppc/filter.c +--- gdb-6.8-orig/sim/ppc/filter.c 1999-04-16 03:35:09.000000000 +0200 ++++ gdb-6.8-pl1/sim/ppc/filter.c 2008-09-30 15:12:15.000000000 +0200 +@@ -21,7 +21,9 @@ + + #include <stdio.h> + ++#ifdef HAVE_CONFIG_H + #include "config.h" ++#endif + + #ifdef HAVE_STRING_H + #include <string.h> +diff -urN gdb-6.8-orig/sim/ppc/filter_filename.c gdb-6.8-pl1/sim/ppc/filter_filename.c +--- gdb-6.8-orig/sim/ppc/filter_filename.c 1999-04-16 03:35:08.000000000 +0200 ++++ gdb-6.8-pl1/sim/ppc/filter_filename.c 2008-09-30 15:12:11.000000000 +0200 +@@ -18,7 +18,9 @@ + + */ + ++#ifdef HAVE_CONFIG_H + #include "config.h" ++#endif + #include "ppc-config.h" + #include "filter_filename.h" + +diff -urN gdb-6.8-orig/sim/ppc/igen.c gdb-6.8-pl1/sim/ppc/igen.c +--- gdb-6.8-orig/sim/ppc/igen.c 2003-06-20 05:59:33.000000000 +0200 ++++ gdb-6.8-pl1/sim/ppc/igen.c 2008-09-30 15:12:06.000000000 +0200 +@@ -25,7 +25,9 @@ + #include "misc.h" + #include "lf.h" + #include "table.h" ++#ifdef HAVE_CONFIG_H + #include "config.h" ++#endif + + #include "filter.h" + +diff -urN gdb-6.8-orig/sim/ppc/inline.c gdb-6.8-pl1/sim/ppc/inline.c +--- gdb-6.8-orig/sim/ppc/inline.c 1999-04-16 03:35:10.000000000 +0200 ++++ gdb-6.8-pl1/sim/ppc/inline.c 2008-09-30 15:11:58.000000000 +0200 +@@ -22,7 +22,9 @@ + #ifndef _INLINE_C_ + #define _INLINE_C_ + ++#ifdef HAVE_CONFIG_H + #include "config.h" ++#endif + #include "ppc-config.h" + + #include "inline.h" +diff -urN gdb-6.8-orig/sim/ppc/lf.c gdb-6.8-pl1/sim/ppc/lf.c +--- gdb-6.8-orig/sim/ppc/lf.c 2002-05-30 17:07:06.000000000 +0200 ++++ gdb-6.8-pl1/sim/ppc/lf.c 2008-09-30 15:33:35.000000000 +0200 +@@ -23,7 +23,9 @@ + #include <stdarg.h> + #include <ctype.h> + ++#ifdef HAVE_CONFIG_H + #include "config.h" ++#endif + #include "misc.h" + #include "lf.h" + +diff -urN gdb-6.8-orig/sim/ppc/misc.c gdb-6.8-pl1/sim/ppc/misc.c +--- gdb-6.8-orig/sim/ppc/misc.c 1999-04-16 03:35:11.000000000 +0200 ++++ gdb-6.8-pl1/sim/ppc/misc.c 2008-09-30 15:11:54.000000000 +0200 +@@ -23,7 +23,9 @@ + #include <stdarg.h> + #include <ctype.h> + ++#ifdef HAVE_CONFIG_H + #include "config.h" ++#endif + #include "misc.h" + + #ifdef HAVE_STDLIB_H +diff -urN gdb-6.8-orig/sim/ppc/misc.h gdb-6.8-pl1/sim/ppc/misc.h +--- gdb-6.8-orig/sim/ppc/misc.h 2002-01-12 11:21:12.000000000 +0100 ++++ gdb-6.8-pl1/sim/ppc/misc.h 2008-09-30 15:11:49.000000000 +0200 +@@ -21,7 +21,9 @@ + + /* Frustrating header junk */ + ++#ifdef HAVE_CONFIG_H + #include "config.h" ++#endif + + #include <stdio.h> + #include <ctype.h> +diff -urN gdb-6.8-orig/sim/ppc/sim-endian.c gdb-6.8-pl1/sim/ppc/sim-endian.c +--- gdb-6.8-orig/sim/ppc/sim-endian.c 1999-04-16 03:35:11.000000000 +0200 ++++ gdb-6.8-pl1/sim/ppc/sim-endian.c 2008-09-30 15:11:44.000000000 +0200 +@@ -22,7 +22,9 @@ + #ifndef _SIM_ENDIAN_C_ + #define _SIM_ENDIAN_C_ + ++#ifdef HAVE_CONFIG_H + #include "config.h" ++#endif + #include "basics.h" + + +diff -urN gdb-6.8-orig/sim/ppc/table.c gdb-6.8-pl1/sim/ppc/table.c +--- gdb-6.8-orig/sim/ppc/table.c 2002-01-12 11:21:12.000000000 +0100 ++++ gdb-6.8-pl1/sim/ppc/table.c 2008-09-30 15:11:38.000000000 +0200 +@@ -25,7 +25,9 @@ + #include <fcntl.h> + #include <ctype.h> + ++#ifdef HAVE_CONFIG_H + #include "config.h" ++#endif + #include "misc.h" + #include "lf.h" + #include "table.h" diff --git a/recipes/gdb/gdb-avr32.inc b/recipes/gdb/gdb-avr32.inc new file mode 100644 index 0000000000..0c0255fdb2 --- /dev/null +++ b/recipes/gdb/gdb-avr32.inc @@ -0,0 +1,32 @@ +# Perform tasks required to use Atmel's AVR32 patches +# See http://avr32linux.org/twiki/bin/view/Main/GDBPatches for more info + + +do_avr32_reconf () { + if test ${TARGET_ARCH} == "avr32"; then + (cd ${S} && autoconf) || \ + die "failure running autoconf in top-level gdb" + + (cd ${S}/bfd && autoreconf) || \ + die "failure running autoreconf in bfd/" + + (cd ${S}/opcodes && autoreconf) || \ + die "failure running autoreconf in opcodes/" + fi + +} + + + +do_avr32_configure_bfd () { + if test ${TARGET_ARCH} == "avr32"; then + (cd ${B} && make configure-bfd) || die "Error running configure-bfd" + (cd ${B}/bfd && make headers) || \ + die "error running 'make headers' in bfd" + fi +} + + +addtask avr32_reconf after do_patch before do_configure +addtask avr32_configure_bfd after do_configure before do_compile + diff --git a/recipes/gdb/gdb-canadian-cross.inc b/recipes/gdb/gdb-canadian-cross.inc new file mode 100644 index 0000000000..f472b538b0 --- /dev/null +++ b/recipes/gdb/gdb-canadian-cross.inc @@ -0,0 +1,18 @@ +require gdb-common.inc + +inherit canadian-sdk + +EXTRA_OEMAKE = "'SUBDIRS=intl mmalloc libiberty opcodes bfd sim gdb etc utils' LDFLAGS='${BUILD_LDFLAGS}'" + +do_configure () { +# override this function to avoid the autoconf/automake/aclocal/autoheader +# calls for now + (cd ${S} && gnu-configize) || die "failure in running gnu-configize" + + # Fix for issues when system's texinfo version >= 4.10 + # (See https://bugzilla.redhat.com/show_bug.cgi?id=345621) + sed -i -e "s@egrep 'texinfo.*'@egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|4.[1-9][0-9]+|[5-9])'@" '${S}/configure' + + + oe_runconf +} diff --git a/recipes/gdb/gdb-canadian-sdk_6.8.bb b/recipes/gdb/gdb-canadian-sdk_6.8.bb new file mode 100644 index 0000000000..1eefddc917 --- /dev/null +++ b/recipes/gdb/gdb-canadian-sdk_6.8.bb @@ -0,0 +1,12 @@ +require gdb-canadian-cross.inc + +SRC_URI += "file://gcc-4.3-build-error.patch;patch=1;pnum=0 \ + file://gdb-6.8-mingw-3.patch;patch=1 \ + file://gdb-6.8-pr9638-ppc-canadian-configh.patch;patch=1 \ + file://gdb-6.8-mips-mingw-sim-fixup.patch;patch=1" + +PR = "r1" + +do_stage() { + : +} diff --git a/recipes/gdb/gdb-common.inc b/recipes/gdb/gdb-common.inc new file mode 100644 index 0000000000..0c236925dc --- /dev/null +++ b/recipes/gdb/gdb-common.inc @@ -0,0 +1,22 @@ +DESCRIPTION = "gdb - GNU debugger" +HOMEPAGE = "http://www.gnu.org/software/gdb/" +LICENSE="GPL" +SECTION = "devel" +PRIORITY = "optional" + +inherit autotools + +SRC_URI = "${GNU_MIRROR}/gdb/gdb-${PV}.tar.gz" + +FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/gdb-${PV}" + +export CC_FOR_BUILD = "${BUILD_CC}" +export CXX_FOR_BUILD = "${BUILD_CXX}" +export CPP_FOR_BUILD = "${BUILD_CPP}" +export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}" +export CXXFLAGS_FOR_BUILD = "${BUILD_CXXFLAGS}" +export CPPFLAGS_FOR_BUILD = "${BUILD_CPPFLAGS}" + +S = "${WORKDIR}/gdb-${PV}" +B = "${WORKDIR}/build-${TARGET_SYS}" + diff --git a/recipes/gdb/gdb-cross-sdk_6.6.bb b/recipes/gdb/gdb-cross-sdk_6.6.bb new file mode 100644 index 0000000000..656119cf93 --- /dev/null +++ b/recipes/gdb/gdb-cross-sdk_6.6.bb @@ -0,0 +1,13 @@ +require gdb-cross.inc + +inherit sdk + +DEPENDS = "ncurses-sdk" + +PR = "r3" + +SRC_URI += "file://early_debug_in_nptl.patch;patch=1;pnum=0" + +do_stage() { + : +} diff --git a/recipes/gdb/gdb-cross-sdk_6.8.bb b/recipes/gdb/gdb-cross-sdk_6.8.bb new file mode 100644 index 0000000000..6aed03d639 --- /dev/null +++ b/recipes/gdb/gdb-cross-sdk_6.8.bb @@ -0,0 +1,13 @@ +require gdb-cross.inc + +SRC_URI += "file://gcc-4.3-build-error.patch;patch=1;pnum=0" + +DEPENDS = "ncurses-sdk" + +inherit sdk + +PR = "r2" + +do_stage() { + : +} diff --git a/recipes/gdb/gdb-cross.inc b/recipes/gdb/gdb-cross.inc new file mode 100644 index 0000000000..6d4c3d177e --- /dev/null +++ b/recipes/gdb/gdb-cross.inc @@ -0,0 +1,24 @@ +require gdb-common.inc + +DEPENDS = "ncurses-native" + +EXTRA_OEMAKE = "'SUBDIRS=intl mmalloc libiberty opcodes bfd sim gdb etc utils' LDFLAGS='${BUILD_LDFLAGS}'" + +EXTRA_OECONF = "--with-curses --with-readline" + +do_configure () { +# override this function to avoid the autoconf/automake/aclocal/autoheader +# calls for now + (cd ${S} && gnu-configize) || die "failure in running gnu-configize" + + # Fix for issues when system's texinfo version >= 4.10 + # (See https://bugzilla.redhat.com/show_bug.cgi?id=345621) + sed -i -e "s@egrep 'texinfo.*'@egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|4.[1-9][0-9]+|[5-9])'@" '${S}/configure' + + + oe_runconf +} + +do_stage () { + oe_runmake install +} diff --git a/recipes/gdb/gdb-cross_6.3.bb b/recipes/gdb/gdb-cross_6.3.bb new file mode 100644 index 0000000000..5b27e09959 --- /dev/null +++ b/recipes/gdb/gdb-cross_6.3.bb @@ -0,0 +1,8 @@ +require gdb-cross.inc + +inherit cross + +PR = "r3" + +SRC_URI += "file://sim-install-makefile.patch;patch=1 \ + file://sim-install-makefile-common.patch;patch=1" diff --git a/recipes/gdb/gdb-cross_6.4.bb b/recipes/gdb/gdb-cross_6.4.bb new file mode 100644 index 0000000000..e4946b0fe1 --- /dev/null +++ b/recipes/gdb/gdb-cross_6.4.bb @@ -0,0 +1,5 @@ +require gdb-cross.inc + +inherit cross + +PR = "r1"
\ No newline at end of file diff --git a/recipes/gdb/gdb-cross_6.6.bb b/recipes/gdb/gdb-cross_6.6.bb new file mode 100644 index 0000000000..570dd52859 --- /dev/null +++ b/recipes/gdb/gdb-cross_6.6.bb @@ -0,0 +1,7 @@ +require gdb-cross.inc +inherit cross + +PR = "r3" + +SRC_URI += "file://early_debug_in_nptl.patch;patch=1;pnum=0" + diff --git a/recipes/gdb/gdb-cross_6.7.1.bb b/recipes/gdb/gdb-cross_6.7.1.bb new file mode 100644 index 0000000000..adccebe115 --- /dev/null +++ b/recipes/gdb/gdb-cross_6.7.1.bb @@ -0,0 +1,19 @@ +require gdb-cross.inc +inherit cross + +DEFAULT_PREFERENCE_avr32 = "99" +SRC_URI_avr32 = " http://avr32linux.org/twiki/pub/Main/GDBPatches/gdb-6.7.1.atmel.1.0.3.tar.bz2" +S_avr32 = "${WORKDIR}/gdb-6.7.1.atmel.1.0.3" + +do_configure_prepend() { + for i in $(find ${S} -name "warning*m4") ; do + sed -i -e s:-Werror::g $i + done + for i in $(find ${S} -name "configure.ac") ; do + sed -i -e s:-Werror::g $i + done + for i in $(find ${S} -name "configure") ; do + sed -i -e s:-Werror::g $i + done +} + diff --git a/recipes/gdb/gdb-cross_6.8.bb b/recipes/gdb/gdb-cross_6.8.bb new file mode 100644 index 0000000000..664ab5e323 --- /dev/null +++ b/recipes/gdb/gdb-cross_6.8.bb @@ -0,0 +1,7 @@ +require gdb-cross.inc + +SRC_URI += "file://gcc-4.3-build-error.patch;patch=1;pnum=0" + +inherit cross + +PR = "r3" diff --git a/recipes/gdb/gdb.inc b/recipes/gdb/gdb.inc new file mode 100644 index 0000000000..77a9ca6a3e --- /dev/null +++ b/recipes/gdb/gdb.inc @@ -0,0 +1,47 @@ +require gdb-common.inc + +DEFAULT_PREFERENCE_avr32 = "-99" + +DEPENDS = "ncurses readline" + +PACKAGES =+ "gdbserver" +FILES_gdbserver = "${bindir}/gdbserver" + +RRECOMMENDS_gdb_append_linux = " glibc-thread-db " +RRECOMMENDS_gdb_append_linux-gnueabi = " glibc-thread-db " + +inherit gettext + +SRC_URI += "file://kill_arm_map_symbols.patch;patch=1 \ + file://gdbserver-cflags-last.diff;patch=1;pnum=0" +#FIXME file://uclibc.patch;patch=1 \ + +EXTRA_OEMAKE = "'SUBDIRS=intl mmalloc libiberty opcodes bfd sim gdb etc utils'" + +EXTRA_OECONF = "--disable-gdbtk --disable-tui --disable-x \ + --with-curses --disable-multilib --with-readline --disable-sim \ + --program-prefix=''" + +LDFLAGS_append = " -s" +export CFLAGS_append=" -L${STAGING_LIBDIR}" + +do_configure () { + # override this function to avoid the autoconf/automake/aclocal/autoheader + # calls for now + (cd ${S} && gnu-configize) || die "failure in running gnu-configize" + + # Remove duplicate spaces to work around configure complaining about + # changed LDFLAGS. + LDFLAGS=$(echo "${LDFLAGS}" | sed "s/ / /") + + CPPFLAGS="" oe_runconf +} + +do_install () { + make -C bfd/doc chew LDFLAGS= CFLAGS=-O2 + oe_runmake DESTDIR='${D}' install + install -d ${D}${bindir} + install -m 0755 gdb/gdbserver/gdbserver ${D}${bindir} +} + + diff --git a/recipes/gdb/gdb_6.3.bb b/recipes/gdb/gdb_6.3.bb new file mode 100644 index 0000000000..988cfb4c44 --- /dev/null +++ b/recipes/gdb/gdb_6.3.bb @@ -0,0 +1,3 @@ +require gdb.inc + +PR = "r4" diff --git a/recipes/gdb/gdb_6.4.bb b/recipes/gdb/gdb_6.4.bb new file mode 100644 index 0000000000..be40f3f12b --- /dev/null +++ b/recipes/gdb/gdb_6.4.bb @@ -0,0 +1,3 @@ +require gdb.inc + +PR = "r2" diff --git a/recipes/gdb/gdb_6.6.bb b/recipes/gdb/gdb_6.6.bb new file mode 100644 index 0000000000..e4502a648e --- /dev/null +++ b/recipes/gdb/gdb_6.6.bb @@ -0,0 +1,5 @@ +require gdb.inc + +PR = "r5" + +SRC_URI += "file://early_debug_in_nptl.patch;patch=1;pnum=0" diff --git a/recipes/gdb/gdb_6.7.1.bb b/recipes/gdb/gdb_6.7.1.bb new file mode 100644 index 0000000000..fedf2bf1f1 --- /dev/null +++ b/recipes/gdb/gdb_6.7.1.bb @@ -0,0 +1,7 @@ +require gdb.inc + +PR = "r1" + +DEFAULT_PREFERENCE_avr32 = "99" +SRC_URI_avr32 = " http://avr32linux.org/twiki/pub/Main/GDBPatches/gdb-6.7.1.atmel.1.0.3.tar.bz2" +S_avr32 = "${WORKDIR}/gdb-6.7.1.atmel.1.0.3" diff --git a/recipes/gdb/gdb_6.8.bb b/recipes/gdb/gdb_6.8.bb new file mode 100644 index 0000000000..a969651c24 --- /dev/null +++ b/recipes/gdb/gdb_6.8.bb @@ -0,0 +1,5 @@ +require gdb.inc + +SRC_URI += "file://gcc-4.3-build-error.patch;patch=1;pnum=0" + +PR = "r3" diff --git a/recipes/gdb/gdbserver.inc b/recipes/gdb/gdbserver.inc new file mode 100644 index 0000000000..a1610daff8 --- /dev/null +++ b/recipes/gdb/gdbserver.inc @@ -0,0 +1,66 @@ +require gdb-common.inc + +DEFAULT_PREFERENCE_avr32 = "-99" + +DEPENDS = "ncurses readline" + +FILES_gdbserver = "${bindir}/gdbserver" + +RRECOMMENDS_gdb_append_linux = " glibc-thread-db " +RRECOMMENDS_gdb_append_linux-gnueabi = " glibc-thread-db " + +inherit gettext + +SRC_URI += "file://kill_arm_map_symbols.patch;patch=1 \ + file://gdbserver-cflags-last.diff;patch=1;pnum=0" +#FIXME file://uclibc.patch;patch=1 \ + +EXTRA_OEMAKE = "'SUBDIRS=intl mmalloc libiberty opcodes bfd sim gdb etc utils'" + +EXTRA_OECONF = "--disable-gdbtk --disable-tui --disable-x \ + --with-curses --disable-multilib --with-readline --disable-sim \ + --program-prefix=''" + +LDFLAGS_append = " -s" +export CFLAGS_append=" -L${STAGING_LIBDIR}" + +do_configure () { + # override this function to avoid the autoconf/automake/aclocal/autoheader + # calls for now + (cd ${S}/gdb/gdbserver && gnu-configize) || die "failure in running gnu-configize" + CPPFLAGS="" oe_rungdbserverconf +} + +do_install () { + install -d ${D}${bindir} + install -m 0755 ${B}/gdbserver ${D}${bindir} +} + +oe_rungdbserverconf() { + if [ -x ${S}/gdb/gdbserver/configure ] ; then + cfgcmd="${S}/gdb/gdbserver/configure \ + --build=${BUILD_SYS} \ + --host=${HOST_SYS} \ + --target=${TARGET_SYS} \ + --prefix=${prefix} \ + --exec_prefix=${exec_prefix} \ + --bindir=${bindir} \ + --sbindir=${sbindir} \ + --libexecdir=${libexecdir} \ + --datadir=${datadir} \ + --sysconfdir=${sysconfdir} \ + --sharedstatedir=${sharedstatedir} \ + --localstatedir=${localstatedir} \ + --libdir=${libdir} \ + --includedir=${includedir} \ + --oldincludedir=${oldincludedir} \ + --infodir=${infodir} \ + --mandir=${mandir} \ + ${EXTRA_OECONF} \ + $@" + oenote "Running $cfgcmd..." + $cfgcmd || oefatal "oe_runconf failed" + else + oefatal "no configure script found" + fi +} diff --git a/recipes/gdb/gdbserver_6.7.1.bb b/recipes/gdb/gdbserver_6.7.1.bb new file mode 100644 index 0000000000..fb92ebc424 --- /dev/null +++ b/recipes/gdb/gdbserver_6.7.1.bb @@ -0,0 +1,6 @@ +require gdbserver.inc + +DEFAULT_PREFERENCE_avr32 = "99" +SRC_URI_avr32 = " http://avr32linux.org/twiki/pub/Main/GDBPatches/gdb-6.7.1.atmel.1.0.3.tar.bz2" +S_avr32 = "${WORKDIR}/gdb-6.7.1.atmel.1.0.3" + diff --git a/recipes/gdb/gdbserver_6.8.bb b/recipes/gdb/gdbserver_6.8.bb new file mode 100644 index 0000000000..67fc280ea2 --- /dev/null +++ b/recipes/gdb/gdbserver_6.8.bb @@ -0,0 +1 @@ +require gdbserver.inc |