diff options
| author | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:38:32 +0100 |
|---|---|---|
| committer | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:50:20 +0100 |
| commit | e2e6f6fe07049f33cb6348780fa975162752e421 (patch) | |
| tree | b1813295411235d1297a0ed642b1346b24fdfb12 /meta/recipes-devtools/gdb | |
| download | poky-e2e6f6fe07049f33cb6348780fa975162752e421.tar.gz | |
initial commit of Enea Linux 3.1
Migrated from the internal git server on the dora-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/recipes-devtools/gdb')
20 files changed, 2634 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gdb/gdb-7.6.inc b/meta/recipes-devtools/gdb/gdb-7.6.inc new file mode 100644 index 0000000000..00cb6eea48 --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb-7.6.inc | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | LICENSE="GPLv2 & GPLv3 & LGPLv2 & LGPLv3" | ||
| 2 | LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \ | ||
| 3 | file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \ | ||
| 4 | file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \ | ||
| 5 | file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674" | ||
| 6 | |||
| 7 | S = "${WORKDIR}/${BPN}-${PV}" | ||
| 8 | |||
| 9 | SRC_URI[md5sum] = "a9836707337e5f7bf76a009a8904f470" | ||
| 10 | SRC_URI[sha256sum] = "8070389a5dcc104eb0be483d582729f98ed4d761ad19cedd3f17b5d2502faa36" | ||
diff --git a/meta/recipes-devtools/gdb/gdb-common.inc b/meta/recipes-devtools/gdb/gdb-common.inc new file mode 100644 index 0000000000..695495416f --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb-common.inc | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | DESCRIPTION = "gdb - GNU debugger" | ||
| 2 | HOMEPAGE = "http://www.gnu.org/software/gdb/" | ||
| 3 | LICENSE="GPLv3+" | ||
| 4 | SECTION = "devel" | ||
| 5 | DEPENDS = "expat ncurses readline ${LTTNGUST}" | ||
| 6 | |||
| 7 | LTTNGUST = "lttng-ust" | ||
| 8 | LTTNGUST_aarch64 = "" | ||
| 9 | LTTNGUST_libc-uclibc = "" | ||
| 10 | LTTNGUST_mips = "" | ||
| 11 | LTTNGUST_mipsel = "" | ||
| 12 | LTTNGUST_mips64 = "" | ||
| 13 | LTTNGUST_mips64el = "" | ||
| 14 | LTTNGUST_sh4 = "" | ||
| 15 | |||
| 16 | INC_PR = "r0" | ||
| 17 | |||
| 18 | LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \ | ||
| 19 | file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674 \ | ||
| 20 | file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \ | ||
| 21 | file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6" | ||
| 22 | inherit autotools | ||
| 23 | |||
| 24 | SRC_URI = "${GNU_MIRROR}/gdb/gdb-${PV}.tar.gz \ | ||
| 25 | " | ||
| 26 | export CC_FOR_BUILD = "${BUILD_CC}" | ||
| 27 | export CXX_FOR_BUILD = "${BUILD_CXX}" | ||
| 28 | export CPP_FOR_BUILD = "${BUILD_CPP}" | ||
| 29 | export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}" | ||
| 30 | export CXXFLAGS_FOR_BUILD = "${BUILD_CXXFLAGS}" | ||
| 31 | export CPPFLAGS_FOR_BUILD = "${BUILD_CPPFLAGS}" | ||
| 32 | |||
| 33 | B = "${WORKDIR}/build-${TARGET_SYS}" | ||
| 34 | |||
| 35 | EXTRA_OEMAKE = "'SUBDIRS=intl mmalloc libiberty opcodes bfd sim gdb etc utils'" | ||
| 36 | |||
| 37 | EXPAT = "--with-expat --with-libexpat-prefix=${STAGING_DIR_HOST}" | ||
| 38 | |||
| 39 | EXTRA_OECONF = "--disable-gdbtk --disable-tui --disable-x --disable-werror \ | ||
| 40 | --with-curses --disable-multilib --with-system-readline --disable-sim \ | ||
| 41 | --without-lzma \ | ||
| 42 | ${GDBPROPREFIX} ${EXPAT} \ | ||
| 43 | ${@base_contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)} \ | ||
| 44 | --disable-rpath \ | ||
| 45 | " | ||
| 46 | |||
| 47 | GDBPROPREFIX = "--program-prefix=''" | ||
| 48 | |||
| 49 | do_configure () { | ||
| 50 | # override this function to avoid the autoconf/automake/aclocal/autoheader | ||
| 51 | # calls for now | ||
| 52 | (cd ${S} && gnu-configize) || die "failure in running gnu-configize" | ||
| 53 | oe_runconf | ||
| 54 | } | ||
| 55 | |||
| 56 | # we don't want gdb to provide bfd/iberty/opcodes, which instead will override the | ||
| 57 | # right bits installed by binutils. | ||
| 58 | do_install_append() { | ||
| 59 | rm -rf ${D}${libdir} | ||
| 60 | rm -rf ${D}${includedir} | ||
| 61 | rm -rf ${D}${datadir}/locale | ||
| 62 | } | ||
| 63 | |||
| 64 | RRECOMMENDS_gdb_append_linux = " glibc-thread-db " | ||
| 65 | RRECOMMENDS_gdb_append_linux-gnueabi = " glibc-thread-db " | ||
| 66 | RRECOMMENDS_gdbserver_append_linux = " glibc-thread-db " | ||
| 67 | RRECOMMENDS_gdbserver_append_linux-gnueabi = " glibc-thread-db " | ||
| 68 | |||
diff --git a/meta/recipes-devtools/gdb/gdb-cross-canadian.inc b/meta/recipes-devtools/gdb/gdb-cross-canadian.inc new file mode 100644 index 0000000000..3cb347b4c5 --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb-cross-canadian.inc | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | inherit cross-canadian | ||
| 2 | inherit python-dir | ||
| 3 | |||
| 4 | DESCRIPTION = "cross-canadian gdb for ${TARGET_ARCH} target - GNU debugger" | ||
| 5 | PN = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}" | ||
| 6 | BPN = "gdb" | ||
| 7 | |||
| 8 | DEPENDS = "nativesdk-ncurses nativesdk-expat nativesdk-gettext nativesdk-readline nativesdk-python" | ||
| 9 | RDEPENDS_${PN} += "nativesdk-python-core nativesdk-python-lang nativesdk-python-re \ | ||
| 10 | nativesdk-python-codecs nativesdk-python-netclient" | ||
| 11 | |||
| 12 | GDBPROPREFIX = "--program-prefix='${TARGET_PREFIX}'" | ||
| 13 | |||
| 14 | EXTRA_OECONF_append = "--with-python=${WORKDIR}/python" | ||
| 15 | |||
| 16 | do_configure_prepend() { | ||
| 17 | cat > ${WORKDIR}/python << EOF | ||
| 18 | #! /bin/sh | ||
| 19 | case "\$2" in | ||
| 20 | --includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}/" ;; | ||
| 21 | --ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;; | ||
| 22 | --exec-prefix) echo "${exec_prefix}" ;; | ||
| 23 | *) exit 1 ;; | ||
| 24 | esac | ||
| 25 | exit 0 | ||
| 26 | EOF | ||
| 27 | chmod +x ${WORKDIR}/python | ||
| 28 | } | ||
| 29 | |||
| 30 | # we don't want gdb to provide bfd/iberty/opcodes, which instead will override the | ||
| 31 | # right bits installed by binutils. | ||
| 32 | do_install_append() { | ||
| 33 | rm -rf ${D}${exec_prefix}/lib | ||
| 34 | } | ||
| 35 | |||
diff --git a/meta/recipes-devtools/gdb/gdb-cross-canadian_7.6.bb b/meta/recipes-devtools/gdb/gdb-cross-canadian_7.6.bb new file mode 100644 index 0000000000..3864435276 --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb-cross-canadian_7.6.bb | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | require gdb-common.inc | ||
| 2 | require gdb-cross-canadian.inc | ||
| 3 | require gdb-7.6.inc | ||
diff --git a/meta/recipes-devtools/gdb/gdb-cross.inc b/meta/recipes-devtools/gdb/gdb-cross.inc new file mode 100644 index 0000000000..6fc98ff110 --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb-cross.inc | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | require gdb-common.inc | ||
| 2 | |||
| 3 | DEPENDS = "expat-native ncurses-native readline-native" | ||
| 4 | |||
| 5 | EXTRA_OECONF += "--without-python" | ||
| 6 | |||
| 7 | #EXTRA_OEMAKE += "LDFLAGS='${BUILD_LDFLAGS}'" | ||
| 8 | |||
| 9 | GDBPROPREFIX = "" | ||
| 10 | |||
| 11 | inherit cross | ||
| 12 | inherit gettext | ||
| 13 | |||
| 14 | datadir .= "/gdb-${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}" | ||
diff --git a/meta/recipes-devtools/gdb/gdb-cross_7.6.bb b/meta/recipes-devtools/gdb/gdb-cross_7.6.bb new file mode 100644 index 0000000000..62f6937bd5 --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb-cross_7.6.bb | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | require gdb-cross.inc | ||
| 2 | require gdb-7.6.inc | ||
| 3 | |||
| 4 | SRC_URI += "file://sim-install-6.6.patch" | ||
diff --git a/meta/recipes-devtools/gdb/gdb.inc b/meta/recipes-devtools/gdb/gdb.inc new file mode 100644 index 0000000000..ab84737468 --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb.inc | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | require gdb-common.inc | ||
| 2 | |||
| 3 | inherit gettext ptest | ||
| 4 | |||
| 5 | SRC_URI += "file://kill_arm_map_symbols.patch \ | ||
| 6 | file://gdbserver-cflags-last.diff;striplevel=0 \ | ||
| 7 | file://renesas-sh-native-support.patch \ | ||
| 8 | file://run-ptest \ | ||
| 9 | file://runtest-flags.patch \ | ||
| 10 | file://0001-add-delay-before-run-exp-file.patch \ | ||
| 11 | file://0002-function-name-is-used-by-mistake.patch \ | ||
| 12 | file://gdb-ptest-attach.patch \ | ||
| 13 | " | ||
| 14 | #LDFLAGS_append = " -s" | ||
| 15 | #export CFLAGS_append=" -L${STAGING_LIBDIR}" | ||
| 16 | |||
| 17 | # cross-canadian must not see this | ||
| 18 | PACKAGES =+ "gdbserver" | ||
| 19 | FILES_gdbserver = "${bindir}/gdbserver" | ||
| 20 | |||
| 21 | |||
| 22 | |||
| 23 | DEPENDS_${PN}-ptest += "expect dejagnu tcl" | ||
| 24 | RDEPENDS_${PN}-ptest += "eglibc-charmap-ibm1047 \ | ||
| 25 | eglibc-gconv-ibm1047 \ | ||
| 26 | eglibc-charmap-ebcdic-us \ | ||
| 27 | eglibc-gconv-ebcdic-us \ | ||
| 28 | eglibc-gconv-utf-32 \ | ||
| 29 | eglibc-gconv-utf-16 \ | ||
| 30 | prelink \ | ||
| 31 | expect \ | ||
| 32 | dejagnu \ | ||
| 33 | make \ | ||
| 34 | " | ||
| 35 | do_configure_ptest () { | ||
| 36 | if [ "${PN}" = "${BPN}" ]; then | ||
| 37 | cd ${S}/gdb/testsuite/ | ||
| 38 | ./configure --host=${HOST_SYS} --build=${BUILD_SYS} | ||
| 39 | make site.exp | ||
| 40 | fi | ||
| 41 | } | ||
| 42 | |||
| 43 | do_install_ptest () { | ||
| 44 | if [ "${PN}" = "${BPN}" ]; then | ||
| 45 | cp -r ${S}/gdb/testsuite/ ${D}${PTEST_PATH} | ||
| 46 | cp -r ${S}/gdb/features/ ${D}${PTEST_PATH} | ||
| 47 | cp ${S}/config.sub ${D}${PTEST_PATH}/testsuite/ | ||
| 48 | cp ${S}/config.guess ${D}${PTEST_PATH}/testsuite/ | ||
| 49 | cp ${S}/install-sh ${D}${PTEST_PATH}/testsuite/ | ||
| 50 | fi | ||
| 51 | } | ||
diff --git a/meta/recipes-devtools/gdb/gdb/0001-add-delay-before-run-exp-file.patch b/meta/recipes-devtools/gdb/gdb/0001-add-delay-before-run-exp-file.patch new file mode 100644 index 0000000000..1c415622e7 --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb/0001-add-delay-before-run-exp-file.patch | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | Description: Add delay for stable running | ||
| 2 | |||
| 3 | Author: jack zhang <jack.zhang@enea.com> | ||
| 4 | Date: Mon, 12 Nov 2012 04:10:20 +0100 | ||
| 5 | |||
| 6 | Upstream-Status: Pending | ||
| 7 | |||
| 8 | Signed-off-by: jack zhang <jack.zhang@enea.com> | ||
| 9 | Signed-off-by: Ciprian Barbu <ciprian.barbu@enea.com> | ||
| 10 | --- | ||
| 11 | gdb/testsuite/dg-extract-results.sh | 1 + | ||
| 12 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/gdb/testsuite/dg-extract-results.sh b/gdb/testsuite/dg-extract-results.sh | ||
| 15 | --- a/gdb/testsuite/dg-extract-results.sh | ||
| 16 | +++ b/gdb/testsuite/dg-extract-results.sh | ||
| 17 | @@ -322,6 +322,7 @@ END { | ||
| 18 | n=1 | ||
| 19 | while (n < expfileno) { | ||
| 20 | if (expfileseen[expfiles[n]]) { | ||
| 21 | + sleep 1 | ||
| 22 | print "Running "expfiles[n]" ..." | ||
| 23 | if (filewritten["${TMP}/list"n]) { | ||
| 24 | if (expfileseen[expfiles[n]] == 1) | ||
| 25 | -- | ||
| 26 | 1.7.5.4 | ||
diff --git a/meta/recipes-devtools/gdb/gdb/0002-function-name-is-used-by-mistake.patch b/meta/recipes-devtools/gdb/gdb/0002-function-name-is-used-by-mistake.patch new file mode 100644 index 0000000000..7f25a357e0 --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb/0002-function-name-is-used-by-mistake.patch | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | Description: function name is used by mistake | ||
| 2 | |||
| 3 | Author: jack zhang <jack.zhang@enea.com> | ||
| 4 | Date: Tue, 13 Nov 2012 09:56:54 +0100 | ||
| 5 | |||
| 6 | Upstream-Status: Pending | ||
| 7 | |||
| 8 | Signed-off-by: jack zhang <jack.zhang@enea.com> | ||
| 9 | Signed-off-by: Ciprian Barbu <ciprian.barbu@enea.com> | ||
| 10 | --- | ||
| 11 | gdb/testsuite/gdb.base/skip.exp | 4 ++-- | ||
| 12 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
| 13 | |||
| 14 | diff --git a/gdb/testsuite/gdb.base/skip.exp b/gdb/testsuite/gdb.base/skip.exp | ||
| 15 | --- a/gdb/testsuite/gdb.base/skip.exp | ||
| 16 | +++ b/gdb/testsuite/gdb.base/skip.exp | ||
| 17 | @@ -113,9 +113,9 @@ gdb_test "info skip 3" ".*\\n3\\s+file\\s+n.*" \ | ||
| 18 | "info skip shows entry as disabled" | ||
| 19 | |||
| 20 | if ![runto_main] { fail "skip tests suppressed" } | ||
| 21 | -gdb_test "step" "bar \\(\\) at.*" "step after disabling 3 (1)" | ||
| 22 | +gdb_test "step" "foo \\(\\) at.*" "step after disabling 3 (1)" | ||
| 23 | gdb_test "step" ".*" "step after disabling 3 (2)"; # Return from foo() | ||
| 24 | -gdb_test "step" "foo \\(\\) at.*" "step after disabling 3 (3)" | ||
| 25 | +gdb_test "step" "bar \\(\\) at.*" "step after disabling 3 (3)" | ||
| 26 | gdb_test "step" ".*" "step after disabling 3 (4)"; # Return from bar() | ||
| 27 | gdb_test "step" "main \\(\\) at.*" "step after disabling 3 (5)" | ||
| 28 | |||
| 29 | -- | ||
| 30 | 1.7.5.4 | ||
diff --git a/meta/recipes-devtools/gdb/gdb/gdb-ptest-attach.patch b/meta/recipes-devtools/gdb/gdb/gdb-ptest-attach.patch new file mode 100644 index 0000000000..b95ac2c163 --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb/gdb-ptest-attach.patch | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | From f442dc426b0346e1e413a7c3ae5b07725837135c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "Rick.Yang" <rick.yang@enea.com> | ||
| 3 | Date: Sun, 11 Nov 2012 10:05:50 +0100 | ||
| 4 | Subject: [PATCH] Fix the failed test case. | ||
| 5 | |||
| 6 | Description: Fixed failing test case | ||
| 7 | In fact, the test case is passing, but the output does not completely | ||
| 8 | match the expected pattern in some special case. Modified the pattern | ||
| 9 | to resolve it. | ||
| 10 | |||
| 11 | Signed-off-by: Rick.Yang <rick.yang@enea.com> | ||
| 12 | Signed-off-by: Ciprian Barbu <ciprian.barbu@enea.com> | ||
| 13 | --- | ||
| 14 | gdb/testsuite/gdb.base/attach.exp | 2 +- | ||
| 15 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp | ||
| 18 | --- a/gdb/testsuite/gdb.base/attach.exp | ||
| 19 | +++ b/gdb/testsuite/gdb.base/attach.exp | ||
| 20 | @@ -285,7 +285,7 @@ proc do_attach_tests {} { | ||
| 21 | gdb_test "dir ${objdir}/${subdir}" "Source directories searched: .*" \ | ||
| 22 | "set source path" | ||
| 23 | |||
| 24 | - gdb_test "cd /tmp" "Working directory /tmp." \ | ||
| 25 | + gdb_test "cd /tmp" "Working directory /tmp.*" \ | ||
| 26 | "cd away from process working directory" | ||
| 27 | |||
| 28 | # Explicitly flush out any knowledge of the previous attachment. | ||
| 29 | -- | ||
| 30 | 1.7.5.4 | ||
diff --git a/meta/recipes-devtools/gdb/gdb/gdbserver-cflags-last.diff b/meta/recipes-devtools/gdb/gdb/gdbserver-cflags-last.diff new file mode 100644 index 0000000000..4dfc419c43 --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb/gdbserver-cflags-last.diff | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | Upstream-Status: Pending | ||
| 2 | |||
| 3 | --- | ||
| 4 | gdb/gdbserver/Makefile.in | 4 ++-- | ||
| 5 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 6 | |||
| 7 | --- gdb/gdbserver/Makefile.in.orig | ||
| 8 | +++ gdb/gdbserver/Makefile.in | ||
| 9 | @@ -118,14 +118,14 @@ WARN_CFLAGS_NO_FORMAT = `echo " $(WARN_C | ||
| 10 | # CFLAGS is specifically reserved for setting from the command line | ||
| 11 | # when running make. I.E. "make CFLAGS=-Wmissing-prototypes". | ||
| 12 | CFLAGS = @CFLAGS@ | ||
| 13 | |||
| 14 | # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros. | ||
| 15 | -INTERNAL_CFLAGS_BASE = ${CFLAGS} ${GLOBAL_CFLAGS} \ | ||
| 16 | +INTERNAL_CFLAGS_BASE = ${GLOBAL_CFLAGS} \ | ||
| 17 | ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} | ||
| 18 | INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS) | ||
| 19 | -INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER | ||
| 20 | +INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) ${CFLAGS} -DGDBSERVER | ||
| 21 | |||
| 22 | # LDFLAGS is specifically reserved for setting from the command line | ||
| 23 | # when running make. | ||
| 24 | LDFLAGS = @LDFLAGS@ | ||
| 25 | INTERNAL_LDFLAGS = $(LDFLAGS) @RDYNAMIC@ | ||
diff --git a/meta/recipes-devtools/gdb/gdb/kill_arm_map_symbols.patch b/meta/recipes-devtools/gdb/gdb/kill_arm_map_symbols.patch new file mode 100644 index 0000000000..9fc45b9f2a --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb/kill_arm_map_symbols.patch | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | Upstream-Status: Inappropriate [embedded specific] | ||
| 2 | |||
| 3 | Index: gdb-7.3/gdb/arm-tdep.c | ||
| 4 | =================================================================== | ||
| 5 | --- gdb-7.3.orig/gdb/arm-tdep.c 2011-05-17 14:27:01.000000000 -0700 | ||
| 6 | +++ gdb-7.3/gdb/arm-tdep.c 2011-08-05 22:29:58.784201850 -0700 | ||
| 7 | @@ -7806,6 +7806,19 @@ | ||
| 8 | static void | ||
| 9 | arm_elf_make_msymbol_special(asymbol *sym, struct minimal_symbol *msym) | ||
| 10 | { | ||
| 11 | + | ||
| 12 | + /* FIXME: We want gdb to ignore the ARM ELF mapping symbols when | ||
| 13 | + displaying disassembly so we use this horrible hack here to | ||
| 14 | + artifically set their address to the highest possible value. | ||
| 15 | + This is wrong of course, and it prevents the symbols from being | ||
| 16 | + used for their intended purpose - to distinguish between ARM | ||
| 17 | + and THUMB code. So we ought to find a better way to do this. */ | ||
| 18 | + if (bfd_asymbol_name (sym) | ||
| 19 | + && bfd_asymbol_name (sym)[0] == '$' | ||
| 20 | + && bfd_asymbol_name (sym)[1] != 0 | ||
| 21 | + && bfd_asymbol_name (sym)[2] == 0) | ||
| 22 | + SYMBOL_VALUE_ADDRESS(msym) = (CORE_ADDR) 0x7ffffffc; | ||
| 23 | + | ||
| 24 | if (ARM_SYM_BRANCH_TYPE (&((elf_symbol_type *)sym)->internal_elf_sym) | ||
| 25 | == ST_BRANCH_TO_THUMB) | ||
| 26 | MSYMBOL_SET_SPECIAL (msym); | ||
diff --git a/meta/recipes-devtools/gdb/gdb/libiberty-cross.patch b/meta/recipes-devtools/gdb/gdb/libiberty-cross.patch new file mode 100644 index 0000000000..d051fdf1ba --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb/libiberty-cross.patch | |||
| @@ -0,0 +1,632 @@ | |||
| 1 | Upstream-Status: Pending | ||
| 2 | |||
| 3 | --- libiberty/configure.in.old 2004-03-31 21:25:25.000000000 +0100 | ||
| 4 | +++ libiberty/configure.in 2004-03-31 21:18:02.000000000 +0100 | ||
| 5 | @@ -100,6 +100,7 @@ | ||
| 6 | AC_CHECK_TOOL(RANLIB, ranlib, :) | ||
| 7 | |||
| 8 | LIB_AC_PROG_CC | ||
| 9 | +AC_PROG_CC_WORKS | ||
| 10 | |||
| 11 | AC_PROG_CC_C_O | ||
| 12 | # autoconf is lame and doesn't give us any substitution variable for this. | ||
| 13 | @@ -402,7 +403,6 @@ | ||
| 14 | |||
| 15 | # We haven't set the list of objects yet. Use the standard autoconf | ||
| 16 | # tests. This will only work if the compiler works. | ||
| 17 | - AC_PROG_CC_WORKS | ||
| 18 | AC_REPLACE_FUNCS($funcs) | ||
| 19 | libiberty_AC_FUNC_C_ALLOCA | ||
| 20 | AC_FUNC_VFORK | ||
| 21 | |||
| 22 | --- libiberty/configure.old 2003-06-19 21:05:35.000000000 +0100 | ||
| 23 | +++ libiberty/configure 2004-03-31 21:35:12.000000000 +0100 | ||
| 24 | @@ -1000,13 +1000,60 @@ | ||
| 25 | fi | ||
| 26 | |||
| 27 | |||
| 28 | +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 | ||
| 29 | +echo "configure:1005: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 | ||
| 30 | + | ||
| 31 | +ac_ext=c | ||
| 32 | +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. | ||
| 33 | +ac_cpp='$CPP $CPPFLAGS' | ||
| 34 | +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' | ||
| 35 | +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' | ||
| 36 | +cross_compiling=$ac_cv_prog_cc_cross | ||
| 37 | + | ||
| 38 | +cat > conftest.$ac_ext << EOF | ||
| 39 | + | ||
| 40 | +#line 1016 "configure" | ||
| 41 | +#include "confdefs.h" | ||
| 42 | + | ||
| 43 | +main(){return(0);} | ||
| 44 | +EOF | ||
| 45 | +if { (eval echo configure:1021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then | ||
| 46 | + ac_cv_prog_cc_works=yes | ||
| 47 | + # If we can't run a trivial program, we are probably using a cross compiler. | ||
| 48 | + if (./conftest; exit) 2>/dev/null; then | ||
| 49 | + ac_cv_prog_cc_cross=no | ||
| 50 | + else | ||
| 51 | + ac_cv_prog_cc_cross=yes | ||
| 52 | + fi | ||
| 53 | +else | ||
| 54 | + echo "configure: failed program was:" >&5 | ||
| 55 | + cat conftest.$ac_ext >&5 | ||
| 56 | + ac_cv_prog_cc_works=no | ||
| 57 | +fi | ||
| 58 | +rm -fr conftest* | ||
| 59 | +ac_ext=c | ||
| 60 | +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. | ||
| 61 | +ac_cpp='$CPP $CPPFLAGS' | ||
| 62 | +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' | ||
| 63 | +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' | ||
| 64 | +cross_compiling=$ac_cv_prog_cc_cross | ||
| 65 | + | ||
| 66 | +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 | ||
| 67 | +if test $ac_cv_prog_cc_works = no; then | ||
| 68 | + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } | ||
| 69 | +fi | ||
| 70 | +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 | ||
| 71 | +echo "configure:1047: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 | ||
| 72 | +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 | ||
| 73 | +cross_compiling=$ac_cv_prog_cc_cross | ||
| 74 | + | ||
| 75 | |||
| 76 | if test "x$CC" != xcc; then | ||
| 77 | echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6 | ||
| 78 | -echo "configure:1007: checking whether $CC and cc understand -c and -o together" >&5 | ||
| 79 | +echo "configure:1054: checking whether $CC and cc understand -c and -o together" >&5 | ||
| 80 | else | ||
| 81 | echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6 | ||
| 82 | -echo "configure:1010: checking whether cc understands -c and -o together" >&5 | ||
| 83 | +echo "configure:1057: checking whether cc understands -c and -o together" >&5 | ||
| 84 | fi | ||
| 85 | set dummy $CC; ac_cc="`echo $2 | | ||
| 86 | sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" | ||
| 87 | @@ -1018,16 +1065,16 @@ | ||
| 88 | # We do the test twice because some compilers refuse to overwrite an | ||
| 89 | # existing .o file with -o, though they will create one. | ||
| 90 | ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5' | ||
| 91 | -if { (eval echo configure:1022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && | ||
| 92 | - test -f conftest.o && { (eval echo configure:1023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; | ||
| 93 | +if { (eval echo configure:1069: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && | ||
| 94 | + test -f conftest.o && { (eval echo configure:1070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; | ||
| 95 | then | ||
| 96 | eval ac_cv_prog_cc_${ac_cc}_c_o=yes | ||
| 97 | if test "x$CC" != xcc; then | ||
| 98 | # Test first that cc exists at all. | ||
| 99 | - if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then | ||
| 100 | + if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then | ||
| 101 | ac_try='cc -c conftest.c -o conftest.o 1>&5' | ||
| 102 | - if { (eval echo configure:1030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && | ||
| 103 | - test -f conftest.o && { (eval echo configure:1031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; | ||
| 104 | + if { (eval echo configure:1077: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && | ||
| 105 | + test -f conftest.o && { (eval echo configure:1078: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; | ||
| 106 | then | ||
| 107 | # cc works too. | ||
| 108 | : | ||
| 109 | @@ -1063,7 +1110,7 @@ | ||
| 110 | |||
| 111 | |||
| 112 | echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 | ||
| 113 | -echo "configure:1067: checking for POSIXized ISC" >&5 | ||
| 114 | +echo "configure:1114: checking for POSIXized ISC" >&5 | ||
| 115 | if test -d /etc/conf/kconfig.d && | ||
| 116 | grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 | ||
| 117 | then | ||
| 118 | @@ -1084,12 +1131,12 @@ | ||
| 119 | fi | ||
| 120 | |||
| 121 | echo $ac_n "checking for working const""... $ac_c" 1>&6 | ||
| 122 | -echo "configure:1088: checking for working const" >&5 | ||
| 123 | +echo "configure:1135: checking for working const" >&5 | ||
| 124 | if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then | ||
| 125 | echo $ac_n "(cached) $ac_c" 1>&6 | ||
| 126 | else | ||
| 127 | cat > conftest.$ac_ext <<EOF | ||
| 128 | -#line 1093 "configure" | ||
| 129 | +#line 1140 "configure" | ||
| 130 | #include "confdefs.h" | ||
| 131 | |||
| 132 | int main() { | ||
| 133 | @@ -1138,7 +1185,7 @@ | ||
| 134 | |||
| 135 | ; return 0; } | ||
| 136 | EOF | ||
| 137 | -if { (eval echo configure:1142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then | ||
| 138 | +if { (eval echo configure:1189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then | ||
| 139 | rm -rf conftest* | ||
| 140 | ac_cv_c_const=yes | ||
| 141 | else | ||
| 142 | @@ -1159,21 +1206,21 @@ | ||
| 143 | fi | ||
| 144 | |||
| 145 | echo $ac_n "checking for inline""... $ac_c" 1>&6 | ||
| 146 | -echo "configure:1163: checking for inline" >&5 | ||
| 147 | +echo "configure:1210: checking for inline" >&5 | ||
| 148 | if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then | ||
| 149 | echo $ac_n "(cached) $ac_c" 1>&6 | ||
| 150 | else | ||
| 151 | ac_cv_c_inline=no | ||
| 152 | for ac_kw in inline __inline__ __inline; do | ||
| 153 | cat > conftest.$ac_ext <<EOF | ||
| 154 | -#line 1170 "configure" | ||
| 155 | +#line 1217 "configure" | ||
| 156 | #include "confdefs.h" | ||
| 157 | |||
| 158 | int main() { | ||
| 159 | } $ac_kw foo() { | ||
| 160 | ; return 0; } | ||
| 161 | EOF | ||
| 162 | -if { (eval echo configure:1177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then | ||
| 163 | +if { (eval echo configure:1224: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then | ||
| 164 | rm -rf conftest* | ||
| 165 | ac_cv_c_inline=$ac_kw; break | ||
| 166 | else | ||
| 167 | @@ -1199,14 +1246,14 @@ | ||
| 168 | esac | ||
| 169 | |||
| 170 | echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 | ||
| 171 | -echo "configure:1203: checking whether byte ordering is bigendian" >&5 | ||
| 172 | +echo "configure:1250: checking whether byte ordering is bigendian" >&5 | ||
| 173 | if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then | ||
| 174 | echo $ac_n "(cached) $ac_c" 1>&6 | ||
| 175 | else | ||
| 176 | ac_cv_c_bigendian=unknown | ||
| 177 | # See if sys/param.h defines the BYTE_ORDER macro. | ||
| 178 | cat > conftest.$ac_ext <<EOF | ||
| 179 | -#line 1210 "configure" | ||
| 180 | +#line 1257 "configure" | ||
| 181 | #include "confdefs.h" | ||
| 182 | #include <sys/types.h> | ||
| 183 | #include <sys/param.h> | ||
| 184 | @@ -1217,11 +1264,11 @@ | ||
| 185 | #endif | ||
| 186 | ; return 0; } | ||
| 187 | EOF | ||
| 188 | -if { (eval echo configure:1221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then | ||
| 189 | +if { (eval echo configure:1268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then | ||
| 190 | rm -rf conftest* | ||
| 191 | # It does; now see whether it defined to BIG_ENDIAN or not. | ||
| 192 | cat > conftest.$ac_ext <<EOF | ||
| 193 | -#line 1225 "configure" | ||
| 194 | +#line 1272 "configure" | ||
| 195 | #include "confdefs.h" | ||
| 196 | #include <sys/types.h> | ||
| 197 | #include <sys/param.h> | ||
| 198 | @@ -1232,7 +1279,7 @@ | ||
| 199 | #endif | ||
| 200 | ; return 0; } | ||
| 201 | EOF | ||
| 202 | -if { (eval echo configure:1236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then | ||
| 203 | +if { (eval echo configure:1283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then | ||
| 204 | rm -rf conftest* | ||
| 205 | ac_cv_c_bigendian=yes | ||
| 206 | else | ||
| 207 | @@ -1252,7 +1299,7 @@ | ||
| 208 | echo $ac_n "cross-compiling... " 2>&6 | ||
| 209 | else | ||
| 210 | cat > conftest.$ac_ext <<EOF | ||
| 211 | -#line 1256 "configure" | ||
| 212 | +#line 1303 "configure" | ||
| 213 | #include "confdefs.h" | ||
| 214 | main () { | ||
| 215 | /* Are we little or big endian? From Harbison&Steele. */ | ||
| 216 | @@ -1265,7 +1312,7 @@ | ||
| 217 | exit (u.c[sizeof (long) - 1] == 1); | ||
| 218 | } | ||
| 219 | EOF | ||
| 220 | -if { (eval echo configure:1269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null | ||
| 221 | +if { (eval echo configure:1316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null | ||
| 222 | then | ||
| 223 | ac_cv_c_bigendian=no | ||
| 224 | else | ||
| 225 | @@ -1283,7 +1330,7 @@ | ||
| 226 | echo "$ac_t""$ac_cv_c_bigendian" 1>&6 | ||
| 227 | if test $ac_cv_c_bigendian = unknown; then | ||
| 228 | echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6 | ||
| 229 | -echo "configure:1287: checking to probe for byte ordering" >&5 | ||
| 230 | +echo "configure:1334: checking to probe for byte ordering" >&5 | ||
| 231 | |||
| 232 | cat >conftest.c <<EOF | ||
| 233 | short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; | ||
| 234 | @@ -1352,7 +1399,7 @@ | ||
| 235 | # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" | ||
| 236 | # ./install, which can be erroneously created by make from ./install.sh. | ||
| 237 | echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 | ||
| 238 | -echo "configure:1356: checking for a BSD compatible install" >&5 | ||
| 239 | +echo "configure:1403: checking for a BSD compatible install" >&5 | ||
| 240 | if test -z "$INSTALL"; then | ||
| 241 | if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then | ||
| 242 | echo $ac_n "(cached) $ac_c" 1>&6 | ||
| 243 | @@ -1413,7 +1460,7 @@ | ||
| 244 | # able to link anything, it had better be able to at least compile | ||
| 245 | # something. | ||
| 246 | echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 | ||
| 247 | -echo "configure:1417: checking how to run the C preprocessor" >&5 | ||
| 248 | +echo "configure:1464: checking how to run the C preprocessor" >&5 | ||
| 249 | # On Suns, sometimes $CPP names a directory. | ||
| 250 | if test -n "$CPP" && test -d "$CPP"; then | ||
| 251 | CPP= | ||
| 252 | @@ -1428,13 +1475,13 @@ | ||
| 253 | # On the NeXT, cc -E runs the code through the compiler's parser, | ||
| 254 | # not just through cpp. | ||
| 255 | cat > conftest.$ac_ext <<EOF | ||
| 256 | -#line 1432 "configure" | ||
| 257 | +#line 1479 "configure" | ||
| 258 | #include "confdefs.h" | ||
| 259 | #include <assert.h> | ||
| 260 | Syntax Error | ||
| 261 | EOF | ||
| 262 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | ||
| 263 | -{ (eval echo configure:1438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | ||
| 264 | +{ (eval echo configure:1485: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | ||
| 265 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | ||
| 266 | if test -z "$ac_err"; then | ||
| 267 | : | ||
| 268 | @@ -1445,13 +1492,13 @@ | ||
| 269 | rm -rf conftest* | ||
| 270 | CPP="${CC-cc} -E -traditional-cpp" | ||
| 271 | cat > conftest.$ac_ext <<EOF | ||
| 272 | -#line 1449 "configure" | ||
| 273 | +#line 1496 "configure" | ||
| 274 | #include "confdefs.h" | ||
| 275 | #include <assert.h> | ||
| 276 | Syntax Error | ||
| 277 | EOF | ||
| 278 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | ||
| 279 | -{ (eval echo configure:1455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | ||
| 280 | +{ (eval echo configure:1502: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | ||
| 281 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | ||
| 282 | if test -z "$ac_err"; then | ||
| 283 | : | ||
| 284 | @@ -1462,13 +1509,13 @@ | ||
| 285 | rm -rf conftest* | ||
| 286 | CPP="${CC-cc} -nologo -E" | ||
| 287 | cat > conftest.$ac_ext <<EOF | ||
| 288 | -#line 1466 "configure" | ||
| 289 | +#line 1513 "configure" | ||
| 290 | #include "confdefs.h" | ||
| 291 | #include <assert.h> | ||
| 292 | Syntax Error | ||
| 293 | EOF | ||
| 294 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | ||
| 295 | -{ (eval echo configure:1472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | ||
| 296 | +{ (eval echo configure:1519: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | ||
| 297 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | ||
| 298 | if test -z "$ac_err"; then | ||
| 299 | : | ||
| 300 | @@ -1496,17 +1543,17 @@ | ||
| 301 | do | ||
| 302 | ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` | ||
| 303 | echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 | ||
| 304 | -echo "configure:1500: checking for $ac_hdr" >&5 | ||
| 305 | +echo "configure:1547: checking for $ac_hdr" >&5 | ||
| 306 | if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then | ||
| 307 | echo $ac_n "(cached) $ac_c" 1>&6 | ||
| 308 | else | ||
| 309 | cat > conftest.$ac_ext <<EOF | ||
| 310 | -#line 1505 "configure" | ||
| 311 | +#line 1552 "configure" | ||
| 312 | #include "confdefs.h" | ||
| 313 | #include <$ac_hdr> | ||
| 314 | EOF | ||
| 315 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | ||
| 316 | -{ (eval echo configure:1510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | ||
| 317 | +{ (eval echo configure:1557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | ||
| 318 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | ||
| 319 | if test -z "$ac_err"; then | ||
| 320 | rm -rf conftest* | ||
| 321 | @@ -1533,12 +1580,12 @@ | ||
| 322 | done | ||
| 323 | |||
| 324 | echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 | ||
| 325 | -echo "configure:1537: checking for sys/wait.h that is POSIX.1 compatible" >&5 | ||
| 326 | +echo "configure:1584: checking for sys/wait.h that is POSIX.1 compatible" >&5 | ||
| 327 | if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then | ||
| 328 | echo $ac_n "(cached) $ac_c" 1>&6 | ||
| 329 | else | ||
| 330 | cat > conftest.$ac_ext <<EOF | ||
| 331 | -#line 1542 "configure" | ||
| 332 | +#line 1589 "configure" | ||
| 333 | #include "confdefs.h" | ||
| 334 | #include <sys/types.h> | ||
| 335 | #include <sys/wait.h> | ||
| 336 | @@ -1554,7 +1601,7 @@ | ||
| 337 | s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; | ||
| 338 | ; return 0; } | ||
| 339 | EOF | ||
| 340 | -if { (eval echo configure:1558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then | ||
| 341 | +if { (eval echo configure:1605: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then | ||
| 342 | rm -rf conftest* | ||
| 343 | ac_cv_header_sys_wait_h=yes | ||
| 344 | else | ||
| 345 | @@ -1575,12 +1622,12 @@ | ||
| 346 | fi | ||
| 347 | |||
| 348 | echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 | ||
| 349 | -echo "configure:1579: checking whether time.h and sys/time.h may both be included" >&5 | ||
| 350 | +echo "configure:1626: checking whether time.h and sys/time.h may both be included" >&5 | ||
| 351 | if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then | ||
| 352 | echo $ac_n "(cached) $ac_c" 1>&6 | ||
| 353 | else | ||
| 354 | cat > conftest.$ac_ext <<EOF | ||
| 355 | -#line 1584 "configure" | ||
| 356 | +#line 1631 "configure" | ||
| 357 | #include "confdefs.h" | ||
| 358 | #include <sys/types.h> | ||
| 359 | #include <sys/time.h> | ||
| 360 | @@ -1589,7 +1636,7 @@ | ||
| 361 | struct tm *tp; | ||
| 362 | ; return 0; } | ||
| 363 | EOF | ||
| 364 | -if { (eval echo configure:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then | ||
| 365 | +if { (eval echo configure:1640: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then | ||
| 366 | rm -rf conftest* | ||
| 367 | ac_cv_header_time=yes | ||
| 368 | else | ||
| 369 | @@ -1611,19 +1658,19 @@ | ||
| 370 | |||
| 371 | |||
| 372 | echo $ac_n "checking whether errno must be declared""... $ac_c" 1>&6 | ||
| 373 | -echo "configure:1615: checking whether errno must be declared" >&5 | ||
| 374 | +echo "configure:1662: checking whether errno must be declared" >&5 | ||
| 375 | if eval "test \"`echo '$''{'libiberty_cv_declare_errno'+set}'`\" = set"; then | ||
| 376 | echo $ac_n "(cached) $ac_c" 1>&6 | ||
| 377 | else | ||
| 378 | cat > conftest.$ac_ext <<EOF | ||
| 379 | -#line 1620 "configure" | ||
| 380 | +#line 1667 "configure" | ||
| 381 | #include "confdefs.h" | ||
| 382 | #include <errno.h> | ||
| 383 | int main() { | ||
| 384 | int x = errno; | ||
| 385 | ; return 0; } | ||
| 386 | EOF | ||
| 387 | -if { (eval echo configure:1627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then | ||
| 388 | +if { (eval echo configure:1674: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then | ||
| 389 | rm -rf conftest* | ||
| 390 | libiberty_cv_declare_errno=no | ||
| 391 | else | ||
| 392 | @@ -1645,12 +1692,12 @@ | ||
| 393 | |||
| 394 | |||
| 395 | echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 | ||
| 396 | -echo "configure:1649: checking for ANSI C header files" >&5 | ||
| 397 | +echo "configure:1696: checking for ANSI C header files" >&5 | ||
| 398 | if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then | ||
| 399 | echo $ac_n "(cached) $ac_c" 1>&6 | ||
| 400 | else | ||
| 401 | cat > conftest.$ac_ext <<EOF | ||
| 402 | -#line 1654 "configure" | ||
| 403 | +#line 1701 "configure" | ||
| 404 | #include "confdefs.h" | ||
| 405 | #include <stdlib.h> | ||
| 406 | #include <stdarg.h> | ||
| 407 | @@ -1658,7 +1705,7 @@ | ||
| 408 | #include <float.h> | ||
| 409 | EOF | ||
| 410 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | ||
| 411 | -{ (eval echo configure:1662: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | ||
| 412 | +{ (eval echo configure:1709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | ||
| 413 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | ||
| 414 | if test -z "$ac_err"; then | ||
| 415 | rm -rf conftest* | ||
| 416 | @@ -1675,7 +1722,7 @@ | ||
| 417 | if test $ac_cv_header_stdc = yes; then | ||
| 418 | # SunOS 4.x string.h does not declare mem*, contrary to ANSI. | ||
| 419 | cat > conftest.$ac_ext <<EOF | ||
| 420 | -#line 1679 "configure" | ||
| 421 | +#line 1726 "configure" | ||
| 422 | #include "confdefs.h" | ||
| 423 | #include <string.h> | ||
| 424 | EOF | ||
| 425 | @@ -1693,7 +1740,7 @@ | ||
| 426 | if test $ac_cv_header_stdc = yes; then | ||
| 427 | # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. | ||
| 428 | cat > conftest.$ac_ext <<EOF | ||
| 429 | -#line 1697 "configure" | ||
| 430 | +#line 1744 "configure" | ||
| 431 | #include "confdefs.h" | ||
| 432 | #include <stdlib.h> | ||
| 433 | EOF | ||
| 434 | @@ -1714,7 +1761,7 @@ | ||
| 435 | : | ||
| 436 | else | ||
| 437 | cat > conftest.$ac_ext <<EOF | ||
| 438 | -#line 1718 "configure" | ||
| 439 | +#line 1765 "configure" | ||
| 440 | #include "confdefs.h" | ||
| 441 | #include <ctype.h> | ||
| 442 | #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') | ||
| 443 | @@ -1725,7 +1772,7 @@ | ||
| 444 | exit (0); } | ||
| 445 | |||
| 446 | EOF | ||
| 447 | -if { (eval echo configure:1729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null | ||
| 448 | +if { (eval echo configure:1776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null | ||
| 449 | then | ||
| 450 | : | ||
| 451 | else | ||
| 452 | @@ -1749,12 +1796,12 @@ | ||
| 453 | fi | ||
| 454 | |||
| 455 | echo $ac_n "checking for uintptr_t""... $ac_c" 1>&6 | ||
| 456 | -echo "configure:1753: checking for uintptr_t" >&5 | ||
| 457 | +echo "configure:1800: checking for uintptr_t" >&5 | ||
| 458 | if eval "test \"`echo '$''{'ac_cv_type_uintptr_t'+set}'`\" = set"; then | ||
| 459 | echo $ac_n "(cached) $ac_c" 1>&6 | ||
| 460 | else | ||
| 461 | cat > conftest.$ac_ext <<EOF | ||
| 462 | -#line 1758 "configure" | ||
| 463 | +#line 1805 "configure" | ||
| 464 | #include "confdefs.h" | ||
| 465 | #include <sys/types.h> | ||
| 466 | #if STDC_HEADERS | ||
| 467 | @@ -1790,12 +1837,12 @@ | ||
| 468 | |||
| 469 | |||
| 470 | echo $ac_n "checking for pid_t""... $ac_c" 1>&6 | ||
| 471 | -echo "configure:1794: checking for pid_t" >&5 | ||
| 472 | +echo "configure:1841: checking for pid_t" >&5 | ||
| 473 | if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then | ||
| 474 | echo $ac_n "(cached) $ac_c" 1>&6 | ||
| 475 | else | ||
| 476 | cat > conftest.$ac_ext <<EOF | ||
| 477 | -#line 1799 "configure" | ||
| 478 | +#line 1846 "configure" | ||
| 479 | #include "confdefs.h" | ||
| 480 | #include <sys/types.h> | ||
| 481 | #if STDC_HEADERS | ||
| 482 | @@ -1895,12 +1942,12 @@ | ||
| 483 | realpath canonicalize_file_name | ||
| 484 | do | ||
| 485 | echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 | ||
| 486 | -echo "configure:1899: checking for $ac_func" >&5 | ||
| 487 | +echo "configure:1946: checking for $ac_func" >&5 | ||
| 488 | if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then | ||
| 489 | echo $ac_n "(cached) $ac_c" 1>&6 | ||
| 490 | else | ||
| 491 | cat > conftest.$ac_ext <<EOF | ||
| 492 | -#line 1904 "configure" | ||
| 493 | +#line 1951 "configure" | ||
| 494 | #include "confdefs.h" | ||
| 495 | /* System header to define __stub macros and hopefully few prototypes, | ||
| 496 | which can conflict with char $ac_func(); below. */ | ||
| 497 | @@ -1923,7 +1970,7 @@ | ||
| 498 | |||
| 499 | ; return 0; } | ||
| 500 | EOF | ||
| 501 | -if { (eval echo configure:1927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then | ||
| 502 | +if { (eval echo configure:1974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then | ||
| 503 | rm -rf conftest* | ||
| 504 | eval "ac_cv_func_$ac_func=yes" | ||
| 505 | else | ||
| 506 | @@ -2152,53 +2199,6 @@ | ||
| 507 | |||
| 508 | # We haven't set the list of objects yet. Use the standard autoconf | ||
| 509 | # tests. This will only work if the compiler works. | ||
| 510 | - echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 | ||
| 511 | -echo "configure:2157: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 | ||
| 512 | - | ||
| 513 | -ac_ext=c | ||
| 514 | -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. | ||
| 515 | -ac_cpp='$CPP $CPPFLAGS' | ||
| 516 | -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' | ||
| 517 | -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' | ||
| 518 | -cross_compiling=$ac_cv_prog_cc_cross | ||
| 519 | - | ||
| 520 | -cat > conftest.$ac_ext << EOF | ||
| 521 | - | ||
| 522 | -#line 2168 "configure" | ||
| 523 | -#include "confdefs.h" | ||
| 524 | - | ||
| 525 | -main(){return(0);} | ||
| 526 | -EOF | ||
| 527 | -if { (eval echo configure:2173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then | ||
| 528 | - ac_cv_prog_cc_works=yes | ||
| 529 | - # If we can't run a trivial program, we are probably using a cross compiler. | ||
| 530 | - if (./conftest; exit) 2>/dev/null; then | ||
| 531 | - ac_cv_prog_cc_cross=no | ||
| 532 | - else | ||
| 533 | - ac_cv_prog_cc_cross=yes | ||
| 534 | - fi | ||
| 535 | -else | ||
| 536 | - echo "configure: failed program was:" >&5 | ||
| 537 | - cat conftest.$ac_ext >&5 | ||
| 538 | - ac_cv_prog_cc_works=no | ||
| 539 | -fi | ||
| 540 | -rm -fr conftest* | ||
| 541 | -ac_ext=c | ||
| 542 | -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. | ||
| 543 | -ac_cpp='$CPP $CPPFLAGS' | ||
| 544 | -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' | ||
| 545 | -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' | ||
| 546 | -cross_compiling=$ac_cv_prog_cc_cross | ||
| 547 | - | ||
| 548 | -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 | ||
| 549 | -if test $ac_cv_prog_cc_works = no; then | ||
| 550 | - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } | ||
| 551 | -fi | ||
| 552 | -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 | ||
| 553 | -echo "configure:2199: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 | ||
| 554 | -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 | ||
| 555 | -cross_compiling=$ac_cv_prog_cc_cross | ||
| 556 | - | ||
| 557 | for ac_func in $funcs | ||
| 558 | do | ||
| 559 | echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 | ||
| 560 | @@ -2900,7 +2900,7 @@ | ||
| 561 | esac | ||
| 562 | |||
| 563 | |||
| 564 | -for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h | ||
| 565 | +for ac_hdr in unistd.h | ||
| 566 | do | ||
| 567 | ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` | ||
| 568 | echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 | ||
| 569 | @@ -3032,24 +3032,11 @@ | ||
| 570 | #include <fcntl.h> | ||
| 571 | #include <sys/mman.h> | ||
| 572 | |||
| 573 | -#if HAVE_SYS_TYPES_H | ||
| 574 | -# include <sys/types.h> | ||
| 575 | -#endif | ||
| 576 | - | ||
| 577 | -#if HAVE_STDLIB_H | ||
| 578 | -# include <stdlib.h> | ||
| 579 | -#endif | ||
| 580 | - | ||
| 581 | -#if HAVE_SYS_STAT_H | ||
| 582 | -# include <sys/stat.h> | ||
| 583 | -#endif | ||
| 584 | - | ||
| 585 | -#if HAVE_UNISTD_H | ||
| 586 | -# include <unistd.h> | ||
| 587 | -#endif | ||
| 588 | - | ||
| 589 | /* This mess was copied from the GNU getpagesize.h. */ | ||
| 590 | #ifndef HAVE_GETPAGESIZE | ||
| 591 | +# ifdef HAVE_UNISTD_H | ||
| 592 | +# include <unistd.h> | ||
| 593 | +# endif | ||
| 594 | |||
| 595 | /* Assume that all systems that can run configure have sys/param.h. */ | ||
| 596 | # ifndef HAVE_SYS_PARAM_H | ||
| 597 | @@ -3157,7 +3144,7 @@ | ||
| 598 | } | ||
| 599 | |||
| 600 | EOF | ||
| 601 | -if { (eval echo configure:3161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null | ||
| 602 | +if { (eval echo configure:3148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null | ||
| 603 | then | ||
| 604 | ac_cv_func_mmap_fixed_mapped=yes | ||
| 605 | else | ||
| 606 | @@ -3181,7 +3168,7 @@ | ||
| 607 | |||
| 608 | |||
| 609 | echo $ac_n "checking for working strncmp""... $ac_c" 1>&6 | ||
| 610 | -echo "configure:3185: checking for working strncmp" >&5 | ||
| 611 | +echo "configure:3172: checking for working strncmp" >&5 | ||
| 612 | if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then | ||
| 613 | echo $ac_n "(cached) $ac_c" 1>&6 | ||
| 614 | else | ||
| 615 | @@ -3189,7 +3176,7 @@ | ||
| 616 | ac_cv_func_strncmp_works=no | ||
| 617 | else | ||
| 618 | cat > conftest.$ac_ext <<EOF | ||
| 619 | -#line 3193 "configure" | ||
| 620 | +#line 3180 "configure" | ||
| 621 | #include "confdefs.h" | ||
| 622 | |||
| 623 | /* Test by Jim Wilson and Kaveh Ghazi. | ||
| 624 | @@ -3253,7 +3240,7 @@ | ||
| 625 | } | ||
| 626 | |||
| 627 | EOF | ||
| 628 | -if { (eval echo configure:3257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null | ||
| 629 | +if { (eval echo configure:3244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null | ||
| 630 | then | ||
| 631 | ac_cv_func_strncmp_works=yes | ||
| 632 | else | ||
diff --git a/meta/recipes-devtools/gdb/gdb/renesas-sh-native-support.patch b/meta/recipes-devtools/gdb/gdb/renesas-sh-native-support.patch new file mode 100644 index 0000000000..15ff62013e --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb/renesas-sh-native-support.patch | |||
| @@ -0,0 +1,1379 @@ | |||
| 1 | Description: Add Renesas SH (sh4) support | ||
| 2 | Add support for Renesas SH (sh4) architecture. | ||
| 3 | . | ||
| 4 | gdb (7.4-1~cvs20111117.2) experimental; urgency=low | ||
| 5 | . | ||
| 6 | * Add Renesas SH (sh4) support (Closes: #576242) | ||
| 7 | - Thanks Nobuhiro Iwamatsu, Takashi Yoshii. | ||
| 8 | Author: Hector Oron <zumbi@debian.org> | ||
| 9 | Bug-Debian: http://bugs.debian.org/576242 | ||
| 10 | |||
| 11 | --- | ||
| 12 | The information above should follow the Patch Tagging Guidelines, please | ||
| 13 | checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here | ||
| 14 | are templates for supplementary fields that you might want to add: | ||
| 15 | |||
| 16 | Forwarded: <no|not-needed|url proving that it has been forwarded> | ||
| 17 | Last-Update: <2011-11-17> | ||
| 18 | |||
| 19 | |||
| 20 | Upstream-Status: Pending | ||
| 21 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 22 | |||
| 23 | Index: gdb-7.5/gdb/configure.host | ||
| 24 | =================================================================== | ||
| 25 | --- gdb-7.5.orig/gdb/configure.host 2012-05-30 12:41:34.000000000 -0700 | ||
| 26 | +++ gdb-7.5/gdb/configure.host 2012-09-19 14:40:42.974609772 -0700 | ||
| 27 | @@ -140,6 +140,7 @@ | ||
| 28 | |||
| 29 | s390*-*-*) gdb_host=s390 ;; | ||
| 30 | |||
| 31 | +sh*-*-linux*) gdb_host=linux ;; | ||
| 32 | sh*-*-netbsdelf* | sh*-*-knetbsd*-gnu) | ||
| 33 | gdb_host=nbsd ;; | ||
| 34 | sh*-*-openbsd*) gdb_host=nbsd ;; | ||
| 35 | Index: gdb-7.5/gdb/Makefile.in | ||
| 36 | =================================================================== | ||
| 37 | --- gdb-7.5.orig/gdb/Makefile.in 2012-07-02 08:29:33.000000000 -0700 | ||
| 38 | +++ gdb-7.5/gdb/Makefile.in 2012-09-19 14:40:42.974609772 -0700 | ||
| 39 | @@ -1493,6 +1493,7 @@ | ||
| 40 | score-tdep.c \ | ||
| 41 | ser-go32.c ser-pipe.c ser-tcp.c ser-mingw.c \ | ||
| 42 | sh-tdep.c sh64-tdep.c shnbsd-tdep.c shnbsd-nat.c \ | ||
| 43 | + sh-linux-tdep.c sh-linux-nat.c \ | ||
| 44 | sol2-tdep.c \ | ||
| 45 | solib-irix.c solib-svr4.c solib-sunos.c \ | ||
| 46 | sparc-linux-nat.c sparc-linux-tdep.c \ | ||
| 47 | Index: gdb-7.5/gdb/sh-linux-tdep.c | ||
| 48 | =================================================================== | ||
| 49 | --- gdb-7.5.orig/gdb/sh-linux-tdep.c 2012-05-07 06:17:29.000000000 -0700 | ||
| 50 | +++ gdb-7.5/gdb/sh-linux-tdep.c 2012-09-19 14:46:50.610623784 -0700 | ||
| 51 | @@ -18,14 +18,37 @@ | ||
| 52 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | ||
| 53 | |||
| 54 | #include "defs.h" | ||
| 55 | +#include "gdbcore.h" | ||
| 56 | +#include "frame.h" | ||
| 57 | +#include "frame-base.h" | ||
| 58 | +#include "frame-unwind.h" | ||
| 59 | +#include "dwarf2-frame.h" | ||
| 60 | +#include "value.h" | ||
| 61 | +#include "regcache.h" | ||
| 62 | +#include "inferior.h" | ||
| 63 | #include "osabi.h" | ||
| 64 | |||
| 65 | +#include "reggroups.h" | ||
| 66 | +#include "arch-utils.h" | ||
| 67 | +#include "floatformat.h" | ||
| 68 | #include "solib-svr4.h" | ||
| 69 | #include "symtab.h" | ||
| 70 | +#include "gdb_string.h" | ||
| 71 | +#include "command.h" | ||
| 72 | +#include "gdb_assert.h" | ||
| 73 | |||
| 74 | #include "trad-frame.h" | ||
| 75 | #include "tramp-frame.h" | ||
| 76 | |||
| 77 | +#include <sys/ptrace.h> | ||
| 78 | +#include <sys/types.h> | ||
| 79 | +#include <sys/param.h> | ||
| 80 | +#include <sys/user.h> | ||
| 81 | +#include <sys/syscall.h> | ||
| 82 | + | ||
| 83 | +#include <asm/ptrace.h> | ||
| 84 | + | ||
| 85 | +#include "regset.h" | ||
| 86 | #include "glibc-tdep.h" | ||
| 87 | #include "sh-tdep.h" | ||
| 88 | #include "linux-tdep.h" | ||
| 89 | @@ -180,9 +203,505 @@ | ||
| 90 | sh_linux_rt_sigreturn_init | ||
| 91 | }; | ||
| 92 | |||
| 93 | +/* Recognizing signal handler frames. */ | ||
| 94 | + | ||
| 95 | +/* GNU/Linux has two flavors of signals. Normal signal handlers, and | ||
| 96 | + "realtime" (RT) signals. The RT signals can provide additional | ||
| 97 | + information to the signal handler if the SA_SIGINFO flag is set | ||
| 98 | + when establishing a signal handler using `sigaction'. It is not | ||
| 99 | + unlikely that future versions of GNU/Linux will support SA_SIGINFO | ||
| 100 | + for normal signals too. */ | ||
| 101 | + | ||
| 102 | +/* When the SH Linux kernel calls a signal handler and the | ||
| 103 | + SA_RESTORER flag isn't set, the return address points to a bit of | ||
| 104 | + code on the stack. This function returns whether the PC appears to | ||
| 105 | + be within this bit of code. | ||
| 106 | + | ||
| 107 | + The instruction sequence for normal signals is | ||
| 108 | + mov.w 1f,r3 | ||
| 109 | + trapa #16 | ||
| 110 | + or r0, r0 | ||
| 111 | + or r0, r0 | ||
| 112 | + or r0, r0 | ||
| 113 | + or r0, r0 | ||
| 114 | + or r0, r0 | ||
| 115 | + 1: .word __NR_sigreturn | ||
| 116 | + or 0x9305 0xc310 0x200b 0x200b 0x200b 0x200b 0x200b 0x0077. | ||
| 117 | + | ||
| 118 | + Checking for the code sequence should be somewhat reliable, because | ||
| 119 | + the effect is to call the system call sigreturn. This is unlikely | ||
| 120 | + to occur anywhere other than a signal trampoline. | ||
| 121 | + | ||
| 122 | + It kind of sucks that we have to read memory from the process in | ||
| 123 | + order to identify a signal trampoline, but there doesn't seem to be | ||
| 124 | + any other way. The PC_IN_SIGTRAMP macro in tm-linux.h arranges to | ||
| 125 | + only call us if no function name could be identified, which should | ||
| 126 | + be the case since the code is on the stack. | ||
| 127 | + | ||
| 128 | + Detection of signal trampolines for handlers that set the | ||
| 129 | + SA_RESTORER flag is in general not possible. Unfortunately this is | ||
| 130 | + what the GNU C Library has been doing for quite some time now. | ||
| 131 | + However, as of version 2.1.2, the GNU C Library uses signal | ||
| 132 | + trampolines (named __restore and __restore_rt) that are identical | ||
| 133 | + to the ones used by the kernel. Therefore, these trampolines are | ||
| 134 | + supported too. */ | ||
| 135 | + | ||
| 136 | +#define MOVW(n) (0x9300|((n)-2)) /* Move mem word at PC+n to R3 */ | ||
| 137 | +#define TRAP16 0xc310 /* Syscall w/no args (NR in R3) */ | ||
| 138 | +#define OR_R0_R0 0x200b /* or r0,r0 (insert to avoid hardware bug) */ | ||
| 139 | + | ||
| 140 | +#define LINUX_SIGTRAMP_INSN0 MOVW(7) /* Move mem word at PC+7 to R3 */ | ||
| 141 | +#define LINUX_SIGTRAMP_INSN1 TRAP16 /* Syscall w/no args (NR in R3) */ | ||
| 142 | +#define LINUX_SIGTRAMP_INSN2 OR_R0_R0 /* or r0,r0 (insert to avoid hardware bug) */ | ||
| 143 | + | ||
| 144 | +static const unsigned short linux_sigtramp_code[] = | ||
| 145 | +{ | ||
| 146 | + LINUX_SIGTRAMP_INSN0, | ||
| 147 | + LINUX_SIGTRAMP_INSN1, | ||
| 148 | + LINUX_SIGTRAMP_INSN2, | ||
| 149 | + LINUX_SIGTRAMP_INSN2, | ||
| 150 | + LINUX_SIGTRAMP_INSN2, | ||
| 151 | + LINUX_SIGTRAMP_INSN2, | ||
| 152 | + LINUX_SIGTRAMP_INSN2, | ||
| 153 | + __NR_sigreturn | ||
| 154 | +}; | ||
| 155 | + | ||
| 156 | +#define LINUX_SIGTRAMP_LEN (sizeof linux_sigtramp_code) | ||
| 157 | + | ||
| 158 | +/* If PC is in a sigtramp routine, return the address of the start of | ||
| 159 | + the routine. Otherwise, return 0. */ | ||
| 160 | + | ||
| 161 | +static CORE_ADDR | ||
| 162 | +sh_linux_sigtramp_start (struct frame_info *next_frame) | ||
| 163 | +{ | ||
| 164 | + CORE_ADDR pc = get_frame_pc (next_frame); | ||
| 165 | + gdb_byte buf[LINUX_SIGTRAMP_LEN]; | ||
| 166 | + | ||
| 167 | + /* We only recognize a signal trampoline if PC is at the start of | ||
| 168 | + one of the three instructions. We optimize for finding the PC at | ||
| 169 | + the start, as will be the case when the trampoline is not the | ||
| 170 | + first frame on the stack. We assume that in the case where the | ||
| 171 | + PC is not at the start of the instruction sequence, there will be | ||
| 172 | + a few trailing readable bytes on the stack. */ | ||
| 173 | + | ||
| 174 | + if (!safe_frame_unwind_memory (next_frame, pc, buf, LINUX_SIGTRAMP_LEN)) | ||
| 175 | + return 0; | ||
| 176 | + | ||
| 177 | + if (buf[0] != LINUX_SIGTRAMP_INSN0) | ||
| 178 | + { | ||
| 179 | + if (buf[0] != LINUX_SIGTRAMP_INSN1) | ||
| 180 | + return 0; | ||
| 181 | + | ||
| 182 | + pc -= 2; | ||
| 183 | + | ||
| 184 | + if (!safe_frame_unwind_memory (next_frame, pc, buf, LINUX_SIGTRAMP_LEN)) | ||
| 185 | + return 0; | ||
| 186 | + } | ||
| 187 | + | ||
| 188 | + if (memcmp (buf, linux_sigtramp_code, LINUX_SIGTRAMP_LEN) != 0) | ||
| 189 | + return 0; | ||
| 190 | + | ||
| 191 | + return pc; | ||
| 192 | +} | ||
| 193 | + | ||
| 194 | +/* This function does the same for RT signals. Here the instruction | ||
| 195 | + sequence is | ||
| 196 | + mov.w 1f,r3 | ||
| 197 | + trapa #16 | ||
| 198 | + or r0, r0 | ||
| 199 | + or r0, r0 | ||
| 200 | + or r0, r0 | ||
| 201 | + or r0, r0 | ||
| 202 | + or r0, r0 | ||
| 203 | + 1: .word __NR_rt_sigreturn | ||
| 204 | + or 0x9305 0xc310 0x200b 0x200b 0x200b 0x200b 0x200b 0x00ad. | ||
| 205 | + | ||
| 206 | + The effect is to call the system call rt_sigreturn. */ | ||
| 207 | + | ||
| 208 | +#define LINUX_RT_SIGTRAMP_INSN0 MOVW(7) /* Move mem word at PC+7 to R3 */ | ||
| 209 | +#define LINUX_RT_SIGTRAMP_INSN1 TRAP16 /* Syscall w/no args (NR in R3) */ | ||
| 210 | +#define LINUX_RT_SIGTRAMP_INSN2 OR_R0_R0 /* or r0,r0 (insert to avoid hardware bug) */ | ||
| 211 | + | ||
| 212 | +static const unsigned short linux_rt_sigtramp_code[] = | ||
| 213 | +{ | ||
| 214 | + LINUX_RT_SIGTRAMP_INSN0, | ||
| 215 | + LINUX_RT_SIGTRAMP_INSN1, | ||
| 216 | + LINUX_RT_SIGTRAMP_INSN2, | ||
| 217 | + LINUX_RT_SIGTRAMP_INSN2, | ||
| 218 | + LINUX_RT_SIGTRAMP_INSN2, | ||
| 219 | + LINUX_RT_SIGTRAMP_INSN2, | ||
| 220 | + LINUX_RT_SIGTRAMP_INSN2, | ||
| 221 | + __NR_rt_sigreturn | ||
| 222 | +}; | ||
| 223 | + | ||
| 224 | +#define LINUX_RT_SIGTRAMP_LEN (sizeof linux_rt_sigtramp_code) | ||
| 225 | + | ||
| 226 | +/* If PC is in a RT sigtramp routine, return the address of the start | ||
| 227 | + of the routine. Otherwise, return 0. */ | ||
| 228 | + | ||
| 229 | +static CORE_ADDR | ||
| 230 | +sh_linux_rt_sigtramp_start (struct frame_info *next_frame) | ||
| 231 | +{ | ||
| 232 | + CORE_ADDR pc = get_frame_pc (next_frame); | ||
| 233 | + gdb_byte buf[LINUX_RT_SIGTRAMP_LEN]; | ||
| 234 | + | ||
| 235 | + /* We only recognize a signal trampoline if PC is at the start of | ||
| 236 | + one of the two instructions. We optimize for finding the PC at | ||
| 237 | + the start, as will be the case when the trampoline is not the | ||
| 238 | + first frame on the stack. We assume that in the case where the | ||
| 239 | + PC is not at the start of the instruction sequence, there will be | ||
| 240 | + a few trailing readable bytes on the stack. */ | ||
| 241 | + | ||
| 242 | + if (!safe_frame_unwind_memory (next_frame, pc, buf, LINUX_RT_SIGTRAMP_LEN)) | ||
| 243 | + return 0; | ||
| 244 | + | ||
| 245 | + if (buf[0] != LINUX_RT_SIGTRAMP_INSN0) | ||
| 246 | + { | ||
| 247 | + if (buf[0] != LINUX_RT_SIGTRAMP_INSN1) | ||
| 248 | + return 0; | ||
| 249 | + | ||
| 250 | + pc -= 2; | ||
| 251 | + | ||
| 252 | + if (!safe_frame_unwind_memory (next_frame, pc, buf, | ||
| 253 | + LINUX_RT_SIGTRAMP_LEN)) | ||
| 254 | + return 0; | ||
| 255 | + } | ||
| 256 | + | ||
| 257 | + if (memcmp (buf, linux_rt_sigtramp_code, LINUX_RT_SIGTRAMP_LEN) != 0) | ||
| 258 | + return 0; | ||
| 259 | + | ||
| 260 | + return pc; | ||
| 261 | +} | ||
| 262 | + | ||
| 263 | +/* Return whether PC is in a GNU/Linux sigtramp routine. */ | ||
| 264 | + | ||
| 265 | +static int | ||
| 266 | +sh_linux_sigtramp_p (struct frame_info *this_frame) | ||
| 267 | +{ | ||
| 268 | + CORE_ADDR pc = get_frame_pc (this_frame); | ||
| 269 | + char *name; | ||
| 270 | + | ||
| 271 | + find_pc_partial_function (pc, &name, NULL, NULL); | ||
| 272 | + | ||
| 273 | + /* If we have NAME, we can optimize the search. The trampolines are | ||
| 274 | + named __restore and __restore_rt. However, they aren't dynamically | ||
| 275 | + exported from the shared C library, so the trampoline may appear to | ||
| 276 | + be part of the preceding function. This should always be sigaction, | ||
| 277 | + __sigaction, or __libc_sigaction (all aliases to the same function). */ | ||
| 278 | + if (name == NULL || strstr (name, "sigaction") != NULL) | ||
| 279 | + return (sh_linux_sigtramp_start (this_frame) != 0 | ||
| 280 | + || sh_linux_rt_sigtramp_start (this_frame) != 0); | ||
| 281 | + | ||
| 282 | + return (strcmp ("__restore", name) == 0 | ||
| 283 | + || strcmp ("__restore_rt", name) == 0); | ||
| 284 | +} | ||
| 285 | + | ||
| 286 | +/* Offset to struct sigcontext in ucontext, from <asm/ucontext.h>. */ | ||
| 287 | +#define SH_LINUX_UCONTEXT_SIGCONTEXT_OFFSET 12 | ||
| 288 | + | ||
| 289 | + | ||
| 290 | +/* Assuming NEXT_FRAME is a frame following a GNU/Linux sigtramp | ||
| 291 | + routine, return the address of the associated sigcontext structure. */ | ||
| 292 | + | ||
| 293 | +static CORE_ADDR | ||
| 294 | +sh_linux_sigcontext_addr (struct frame_info *this_frame) | ||
| 295 | +{ | ||
| 296 | + CORE_ADDR pc; | ||
| 297 | + CORE_ADDR sp; | ||
| 298 | + | ||
| 299 | + sp = get_frame_register_unsigned (this_frame, SP_REGNUM); | ||
| 300 | + | ||
| 301 | + pc = sh_linux_sigtramp_start (this_frame); | ||
| 302 | + if (pc) | ||
| 303 | + { | ||
| 304 | + return sp; | ||
| 305 | + } | ||
| 306 | + | ||
| 307 | + pc = sh_linux_rt_sigtramp_start (this_frame); | ||
| 308 | + if (pc) | ||
| 309 | + { | ||
| 310 | + CORE_ADDR ucontext_addr; | ||
| 311 | + | ||
| 312 | + /* The sigcontext structure is part of the user context. A | ||
| 313 | + pointer to the user context is passed as the third argument | ||
| 314 | + to the signal handler. */ | ||
| 315 | + ucontext_addr = get_frame_register_unsigned (this_frame, ARG0_REGNUM+2); | ||
| 316 | + return ucontext_addr + SH_LINUX_UCONTEXT_SIGCONTEXT_OFFSET; | ||
| 317 | + } | ||
| 318 | + | ||
| 319 | + error ("Couldn't recognize signal trampoline."); | ||
| 320 | + return 0; | ||
| 321 | +} | ||
| 322 | + | ||
| 323 | +/* Signal trampolines. */ | ||
| 324 | +extern struct sh_frame_cache *sh_alloc_frame_cache (void); | ||
| 325 | + | ||
| 326 | +static struct sh_frame_cache * | ||
| 327 | +sh_linux_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache) | ||
| 328 | +{ | ||
| 329 | + struct sh_frame_cache *cache; | ||
| 330 | + struct gdbarch_tdep *tdep = gdbarch_tdep (get_current_arch ()); | ||
| 331 | + CORE_ADDR sigcontext_addr; | ||
| 332 | + | ||
| 333 | + if (*this_cache) | ||
| 334 | + return *this_cache; | ||
| 335 | + | ||
| 336 | + cache = sh_alloc_frame_cache (); | ||
| 337 | + | ||
| 338 | + cache->base = get_frame_register_unsigned (this_frame, SP_REGNUM); | ||
| 339 | + sigcontext_addr = tdep->sigcontext_addr (this_frame); | ||
| 340 | + if (tdep->sc_reg_offset) | ||
| 341 | + { | ||
| 342 | + int i; | ||
| 343 | + | ||
| 344 | + gdb_assert (tdep->sc_num_regs <= SH_NUM_REGS); | ||
| 345 | + | ||
| 346 | + for (i = 0; i < tdep->sc_num_regs; i++) | ||
| 347 | + if (tdep->sc_reg_offset[i] != -1) | ||
| 348 | + cache->saved_regs[i] = sigcontext_addr + tdep->sc_reg_offset[i]; | ||
| 349 | + } | ||
| 350 | + | ||
| 351 | + *this_cache = cache; | ||
| 352 | + return cache; | ||
| 353 | +} | ||
| 354 | + | ||
| 355 | +static void | ||
| 356 | +sh_linux_sigtramp_frame_this_id (struct frame_info *this_frame, void **this_cache, | ||
| 357 | + struct frame_id *this_id) | ||
| 358 | +{ | ||
| 359 | + struct sh_frame_cache *cache = | ||
| 360 | + sh_linux_sigtramp_frame_cache (this_frame, this_cache); | ||
| 361 | + | ||
| 362 | + (*this_id) = frame_id_build (cache->base + 64, cache->pc); | ||
| 363 | +} | ||
| 364 | + | ||
| 365 | +extern struct value * sh_frame_prev_register (); | ||
| 366 | +static struct value * | ||
| 367 | +sh_linux_sigtramp_frame_prev_register (struct frame_info *this_frame, | ||
| 368 | + void **this_cache, int regnum) | ||
| 369 | +{ | ||
| 370 | + sh_linux_sigtramp_frame_cache (this_frame, this_cache); | ||
| 371 | + | ||
| 372 | + return sh_frame_prev_register (this_frame, this_cache, regnum); | ||
| 373 | +} | ||
| 374 | + | ||
| 375 | +static int | ||
| 376 | +sh_linux_sigtramp_frame_sniffer (const struct frame_unwind *self, | ||
| 377 | + struct frame_info *this_frame, | ||
| 378 | + void **this_prologue_cache) | ||
| 379 | +{ | ||
| 380 | + struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (this_frame)); | ||
| 381 | + | ||
| 382 | + /* We shouldn't even bother if we don't have a sigcontext_addr | ||
| 383 | + handler. */ | ||
| 384 | + if (tdep->sigcontext_addr == NULL) | ||
| 385 | + return 0; | ||
| 386 | + | ||
| 387 | + if (tdep->sigtramp_p != NULL) | ||
| 388 | + { | ||
| 389 | + if (tdep->sigtramp_p (this_frame)) | ||
| 390 | + return 1; | ||
| 391 | + } | ||
| 392 | + | ||
| 393 | + return 0; | ||
| 394 | +} | ||
| 395 | + | ||
| 396 | +static const struct frame_unwind sh_linux_sigtramp_frame_unwind = | ||
| 397 | +{ | ||
| 398 | + SIGTRAMP_FRAME, | ||
| 399 | + sh_linux_sigtramp_frame_this_id, | ||
| 400 | + sh_linux_sigtramp_frame_prev_register, | ||
| 401 | + NULL, | ||
| 402 | + sh_linux_sigtramp_frame_sniffer | ||
| 403 | +}; | ||
| 404 | + | ||
| 405 | +/* Supply register REGNUM from the buffer specified by GREGS and LEN | ||
| 406 | + in the general-purpose register set REGSET to register cache | ||
| 407 | + REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */ | ||
| 408 | + | ||
| 409 | +void | ||
| 410 | +sh_supply_gregset (const struct regset *regset, struct regcache *regcache, | ||
| 411 | + int regnum, const void *gregs, size_t len) | ||
| 412 | +{ | ||
| 413 | + const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch); | ||
| 414 | + const char *regs = gregs; | ||
| 415 | + int i; | ||
| 416 | + | ||
| 417 | + gdb_assert (len == tdep->sizeof_gregset); | ||
| 418 | + | ||
| 419 | + for (i = 0; i < tdep->gregset_num_regs; i++) | ||
| 420 | + { | ||
| 421 | + if ((regnum == i || regnum == -1) | ||
| 422 | + && tdep->gregset_reg_offset[i] != -1) | ||
| 423 | + regcache_raw_supply (regcache, i, regs + tdep->gregset_reg_offset[i]); | ||
| 424 | + } | ||
| 425 | +} | ||
| 426 | + | ||
| 427 | +/* Collect register REGNUM from the register cache REGCACHE and store | ||
| 428 | + it in the buffer specified by GREGS and LEN as described by the | ||
| 429 | + general-purpose register set REGSET. If REGNUM is -1, do this for | ||
| 430 | + all registers in REGSET. */ | ||
| 431 | + | ||
| 432 | +void | ||
| 433 | +sh_collect_gregset (const struct regset *regset, | ||
| 434 | + const struct regcache *regcache, | ||
| 435 | + int regnum, void *gregs, size_t len) | ||
| 436 | +{ | ||
| 437 | + const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch); | ||
| 438 | + char *regs = gregs; | ||
| 439 | + int i; | ||
| 440 | + | ||
| 441 | + gdb_assert (len == tdep->sizeof_gregset); | ||
| 442 | + | ||
| 443 | + for (i = 0; i < tdep->gregset_num_regs; i++) | ||
| 444 | + { | ||
| 445 | + if ((regnum == i || regnum == -1) | ||
| 446 | + && tdep->gregset_reg_offset[i] != -1) | ||
| 447 | + regcache_raw_collect (regcache, i, regs + tdep->gregset_reg_offset[i]); | ||
| 448 | + } | ||
| 449 | +} | ||
| 450 | + | ||
| 451 | +/* Supply register REGNUM from the buffer specified by FPREGS and LEN | ||
| 452 | + in the floating-point register set REGSET to register cache | ||
| 453 | + REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */ | ||
| 454 | + | ||
| 455 | +static void | ||
| 456 | +sh_supply_fpregset (const struct regset *regset, struct regcache *regcache, | ||
| 457 | + int regnum, const void *fpregs, size_t len) | ||
| 458 | +{ | ||
| 459 | + const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch); | ||
| 460 | + const char *regs = fpregs; | ||
| 461 | + int i; | ||
| 462 | + | ||
| 463 | + gdb_assert (len == tdep->sizeof_fpregset); | ||
| 464 | + for (i = 0; i < 16; i++) | ||
| 465 | + { | ||
| 466 | + if (regnum == i+25 || regnum == -1) | ||
| 467 | + regcache_raw_supply (regcache, i+25, regs + i*4); | ||
| 468 | + } | ||
| 469 | + if (regnum == FPSCR_REGNUM || regnum == -1) | ||
| 470 | + regcache_raw_supply (regcache, FPSCR_REGNUM, regs + 32*4); | ||
| 471 | + if (regnum == FPUL_REGNUM || regnum == -1) | ||
| 472 | + regcache_raw_supply (regcache, FPUL_REGNUM, regs + 33*4); | ||
| 473 | +} | ||
| 474 | + | ||
| 475 | +/* Collect register REGNUM from the register cache REGCACHE and store | ||
| 476 | + it in the buffer specified by FPREGS and LEN as described by the | ||
| 477 | + floating-point register set REGSET. If REGNUM is -1, do this for | ||
| 478 | + all registers in REGSET. */ | ||
| 479 | + | ||
| 480 | +static void | ||
| 481 | +sh_collect_fpregset (const struct regset *regset, | ||
| 482 | + const struct regcache *regcache, | ||
| 483 | + int regnum, void *fpregs, size_t len) | ||
| 484 | +{ | ||
| 485 | + const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch); | ||
| 486 | + char *regs = fpregs; | ||
| 487 | + int i; | ||
| 488 | + | ||
| 489 | + gdb_assert (len == tdep->sizeof_fpregset); | ||
| 490 | + for (i = 0; i < 16; i++) | ||
| 491 | + { | ||
| 492 | + if (regnum == i+25 || regnum == -1) | ||
| 493 | + regcache_raw_collect (regcache, i+25, regs + i*4); | ||
| 494 | + } | ||
| 495 | + if (regnum == FPSCR_REGNUM || regnum == -1) | ||
| 496 | + regcache_raw_collect (regcache, FPSCR_REGNUM, regs + 32*4); | ||
| 497 | + if (regnum == FPUL_REGNUM || regnum == -1) | ||
| 498 | + regcache_raw_collect (regcache, FPUL_REGNUM, regs + 33*4); | ||
| 499 | +} | ||
| 500 | + | ||
| 501 | +/* Return the appropriate register set for the core section identified | ||
| 502 | + by SECT_NAME and SECT_SIZE. */ | ||
| 503 | + | ||
| 504 | +const struct regset * | ||
| 505 | +sh_linux_regset_from_core_section (struct gdbarch *gdbarch, | ||
| 506 | + const char *sect_name, size_t sect_size) | ||
| 507 | +{ | ||
| 508 | + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); | ||
| 509 | + | ||
| 510 | + if (strcmp (sect_name, ".reg") == 0 && sect_size == tdep->sizeof_gregset) | ||
| 511 | + { | ||
| 512 | + if (tdep->gregset == NULL) | ||
| 513 | + tdep->gregset = regset_alloc (gdbarch, sh_supply_gregset, | ||
| 514 | + sh_collect_gregset); | ||
| 515 | + return tdep->gregset; | ||
| 516 | + } | ||
| 517 | + | ||
| 518 | + if ((strcmp (sect_name, ".reg2") == 0 && sect_size == tdep->sizeof_fpregset)) | ||
| 519 | + { | ||
| 520 | + if (tdep->fpregset == NULL) | ||
| 521 | + tdep->fpregset = regset_alloc (gdbarch, sh_supply_fpregset, | ||
| 522 | + sh_collect_fpregset); | ||
| 523 | + return tdep->fpregset; | ||
| 524 | + } | ||
| 525 | + | ||
| 526 | + return NULL; | ||
| 527 | +} | ||
| 528 | + | ||
| 529 | +/* The register sets used in GNU/Linux ELF core-dumps are identical to | ||
| 530 | + the register sets in `struct user' that are used for a.out | ||
| 531 | + core-dumps. These are also used by ptrace(2). The corresponding | ||
| 532 | + types are `elf_gregset_t' for the general-purpose registers (with | ||
| 533 | + `elf_greg_t' the type of a single GP register) and `elf_fpregset_t' | ||
| 534 | + for the floating-point registers. | ||
| 535 | + | ||
| 536 | + Those types used to be available under the names `gregset_t' and | ||
| 537 | + `fpregset_t' too, and GDB used those names in the past. But those | ||
| 538 | + names are now used for the register sets used in the `mcontext_t' | ||
| 539 | + type, which have a different size and layout. */ | ||
| 540 | + | ||
| 541 | +/* Mapping between the general-purpose registers in `struct user' | ||
| 542 | + format and GDB's register cache layout. */ | ||
| 543 | + | ||
| 544 | +/* From <sys/reg.h>. */ | ||
| 545 | +static int sh_linux_gregset_reg_offset[] = | ||
| 546 | +{ | ||
| 547 | + 0, 4, 8, 12, 16, 20, 24, 28, | ||
| 548 | + 32, 36, 40, 44, 48, 52, 56, 60, | ||
| 549 | + | ||
| 550 | + REG_PC*4, REG_PR*4, REG_GBR*4, -1, | ||
| 551 | + REG_MACH*4, REG_MACL*4, REG_SR*4, | ||
| 552 | +}; | ||
| 553 | + | ||
| 554 | +/* Mapping between the general-purpose registers in `struct | ||
| 555 | + sigcontext' format and GDB's register cache layout. */ | ||
| 556 | + | ||
| 557 | +/* From <asm/sigcontext.h>. */ | ||
| 558 | +static int sh_linux_sc_reg_offset[] = | ||
| 559 | +{ | ||
| 560 | + 4, 8, 12, 16, 20, 24, 28, 32, | ||
| 561 | + 36, 40, 44, 48, 52, 56, 60, 64, | ||
| 562 | + 68, 72, 80, -1, | ||
| 563 | + 84, 88, 76 | ||
| 564 | +}; | ||
| 565 | + | ||
| 566 | static void | ||
| 567 | sh_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) | ||
| 568 | { | ||
| 569 | + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); | ||
| 570 | + bfd abfd; | ||
| 571 | + | ||
| 572 | + tdep->gregset_reg_offset = sh_linux_gregset_reg_offset; | ||
| 573 | + tdep->gregset_num_regs = ARRAY_SIZE (sh_linux_gregset_reg_offset); | ||
| 574 | + tdep->sizeof_gregset = 23 * 4; | ||
| 575 | + | ||
| 576 | + tdep->jb_pc_offset = 32; /* From <bits/setjmp.h>. */ | ||
| 577 | + | ||
| 578 | + tdep->sigtramp_p = sh_linux_sigtramp_p; | ||
| 579 | + tdep->sigcontext_addr = sh_linux_sigcontext_addr; | ||
| 580 | + tdep->sc_reg_offset = sh_linux_sc_reg_offset; | ||
| 581 | + tdep->sc_num_regs = ARRAY_SIZE (sh_linux_sc_reg_offset); | ||
| 582 | + | ||
| 583 | + frame_unwind_append_unwinder(gdbarch, &sh_linux_sigtramp_frame_unwind); | ||
| 584 | + | ||
| 585 | + /* If we have a register mapping, enable the generic core file | ||
| 586 | + support, unless it has already been enabled. */ | ||
| 587 | + if (tdep->gregset_reg_offset | ||
| 588 | + && !gdbarch_regset_from_core_section_p (gdbarch)) | ||
| 589 | + set_gdbarch_regset_from_core_section (gdbarch, | ||
| 590 | + sh_linux_regset_from_core_section); | ||
| 591 | + | ||
| 592 | linux_init_abi (info, gdbarch); | ||
| 593 | |||
| 594 | /* GNU/Linux uses SVR4-style shared libraries. */ | ||
| 595 | Index: gdb-7.5/gdb/sh-tdep.h | ||
| 596 | =================================================================== | ||
| 597 | --- gdb-7.5.orig/gdb/sh-tdep.h 2012-03-01 15:55:40.000000000 -0800 | ||
| 598 | +++ gdb-7.5/gdb/sh-tdep.h 2012-09-19 14:48:32.406627602 -0700 | ||
| 599 | @@ -21,6 +21,12 @@ | ||
| 600 | |||
| 601 | /* Contributed by Steve Chamberlain sac@cygnus.com. */ | ||
| 602 | |||
| 603 | +struct frame_info; | ||
| 604 | +struct gdbarch; | ||
| 605 | +struct reggroup; | ||
| 606 | +struct regset; | ||
| 607 | +struct regcache; | ||
| 608 | + | ||
| 609 | /* Registers for all SH variants. Used also by sh3-rom.c. */ | ||
| 610 | enum | ||
| 611 | { | ||
| 612 | @@ -29,6 +35,7 @@ | ||
| 613 | ARG0_REGNUM = 4, | ||
| 614 | ARGLAST_REGNUM = 7, | ||
| 615 | FP_REGNUM = 14, | ||
| 616 | + SP_REGNUM = 15, | ||
| 617 | PC_REGNUM = 16, | ||
| 618 | PR_REGNUM = 17, | ||
| 619 | GBR_REGNUM = 18, | ||
| 620 | @@ -81,6 +88,24 @@ | ||
| 621 | FV0_REGNUM = 76, | ||
| 622 | FV_LAST_REGNUM = 79 | ||
| 623 | }; | ||
| 624 | +#define SH_NUM_REGS 67 | ||
| 625 | + | ||
| 626 | +struct sh_frame_cache | ||
| 627 | +{ | ||
| 628 | + /* Base address. */ | ||
| 629 | + CORE_ADDR base; | ||
| 630 | + LONGEST sp_offset; | ||
| 631 | + CORE_ADDR pc; | ||
| 632 | + | ||
| 633 | + /* Flag showing that a frame has been created in the prologue code. */ | ||
| 634 | + int uses_fp; | ||
| 635 | + | ||
| 636 | + /* Saved registers. */ | ||
| 637 | + CORE_ADDR saved_regs[SH_NUM_REGS]; | ||
| 638 | + CORE_ADDR saved_sp; | ||
| 639 | +}; | ||
| 640 | + | ||
| 641 | +extern struct sh_frame_cache *sh_frame_cache (struct frame_info *next_frame, void **this_cache); | ||
| 642 | |||
| 643 | /* This structure describes a register in a core-file. */ | ||
| 644 | struct sh_corefile_regmap | ||
| 645 | @@ -89,8 +114,32 @@ | ||
| 646 | unsigned int offset; | ||
| 647 | }; | ||
| 648 | |||
| 649 | +/* sh architecture specific information. */ | ||
| 650 | struct gdbarch_tdep | ||
| 651 | { | ||
| 652 | + /* General-purpose registers. */ | ||
| 653 | + struct regset *gregset; | ||
| 654 | + int *gregset_reg_offset; | ||
| 655 | + int gregset_num_regs; | ||
| 656 | + size_t sizeof_gregset; | ||
| 657 | + | ||
| 658 | + /* Floating-point registers. */ | ||
| 659 | + struct regset *fpregset; | ||
| 660 | + size_t sizeof_fpregset; | ||
| 661 | + | ||
| 662 | + /* Offset of saved PC in jmp_buf. */ | ||
| 663 | + int jb_pc_offset; | ||
| 664 | + | ||
| 665 | + /* Detect sigtramp. */ | ||
| 666 | + int (*sigtramp_p) (struct frame_info *); | ||
| 667 | + | ||
| 668 | + /* Get address of sigcontext for sigtramp. */ | ||
| 669 | + CORE_ADDR (*sigcontext_addr) (struct frame_info *); | ||
| 670 | + | ||
| 671 | + /* Offset of registers in `struct sigcontext'. */ | ||
| 672 | + int *sc_reg_offset; | ||
| 673 | + int sc_num_regs; | ||
| 674 | + | ||
| 675 | /* Non-NULL when debugging from a core file. Provides the offset | ||
| 676 | where each general-purpose register is stored inside the associated | ||
| 677 | core file section. */ | ||
| 678 | Index: gdb-7.5/gdb/sh-linux-nat.c | ||
| 679 | =================================================================== | ||
| 680 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 681 | +++ gdb-7.5/gdb/sh-linux-nat.c 2012-09-19 14:40:42.978609771 -0700 | ||
| 682 | @@ -0,0 +1,269 @@ | ||
| 683 | +/* Low level SH interface to ptrace, for GDB when running native. | ||
| 684 | + Copyright (C) 2002, 2004 Free Software Foundation, Inc. | ||
| 685 | + | ||
| 686 | +This file is part of GDB. | ||
| 687 | + | ||
| 688 | +This program is free software; you can redistribute it and/or modify | ||
| 689 | +it under the terms of the GNU General Public License as published by | ||
| 690 | +the Free Software Foundation; either version 2 of the License, or | ||
| 691 | +(at your option) any later version. | ||
| 692 | + | ||
| 693 | +This program is distributed in the hope that it will be useful, | ||
| 694 | +but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 695 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 696 | +GNU General Public License for more details. | ||
| 697 | + | ||
| 698 | +You should have received a copy of the GNU General Public License | ||
| 699 | +along with this program; if not, write to the Free Software | ||
| 700 | +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | ||
| 701 | + | ||
| 702 | +#include "defs.h" | ||
| 703 | +#include "inferior.h" | ||
| 704 | +#include "gdbcore.h" | ||
| 705 | +#include "regcache.h" | ||
| 706 | +#include "linux-nat.h" | ||
| 707 | +#include "target.h" | ||
| 708 | +#include "arch-utils.h" | ||
| 709 | + | ||
| 710 | +#include "gdb_assert.h" | ||
| 711 | +#include "gdb_string.h" | ||
| 712 | +#include <sys/ptrace.h> | ||
| 713 | +#include <sys/user.h> | ||
| 714 | +#include <sys/procfs.h> | ||
| 715 | +#include <asm/ptrace.h> | ||
| 716 | + | ||
| 717 | +/* Prototypes for supply_gregset etc. */ | ||
| 718 | +#include "gregset.h" | ||
| 719 | +#include "sh-tdep.h" | ||
| 720 | + | ||
| 721 | +/* Defines ps_err_e, struct ps_prochandle. */ | ||
| 722 | +#include "gdb_proc_service.h" | ||
| 723 | + | ||
| 724 | +//#include <asm/elf.h> | ||
| 725 | + | ||
| 726 | +#define SH_LINUX_NUM_REGS 40 | ||
| 727 | +/* This table must line up with REGISTER_NAME in "sh-tdep.c". */ | ||
| 728 | +static const int regmap[] = | ||
| 729 | +{ | ||
| 730 | + /* general registers 0-15 */ | ||
| 731 | + REG_REG0 , REG_REG0+1 , REG_REG0+2 , REG_REG0+3, | ||
| 732 | + REG_REG0+4 , REG_REG0+5 , REG_REG0+6 , REG_REG0+7, | ||
| 733 | + REG_REG0+8 , REG_REG0+9 , REG_REG0+10, REG_REG0+11, | ||
| 734 | + REG_REG0+12, REG_REG0+13, REG_REG0+14, REG_REG0+15, | ||
| 735 | + /* 16 - 22 */ | ||
| 736 | + REG_PC, REG_PR, REG_GBR, -1, REG_MACH, REG_MACL, REG_SR, | ||
| 737 | + /* 23, 24 */ | ||
| 738 | + REG_FPUL, REG_FPSCR, | ||
| 739 | + /* floating point registers 25 - 40 */ | ||
| 740 | + REG_FPREG0 , REG_FPREG0+1 , REG_FPREG0+2 , REG_FPREG0+3 , | ||
| 741 | + REG_FPREG0+4 , REG_FPREG0+5 , REG_FPREG0+6 , REG_FPREG0+7 , | ||
| 742 | + REG_FPREG0+8 , REG_FPREG0+9 , REG_FPREG0+10, REG_FPREG0+11, | ||
| 743 | + REG_FPREG0+12, REG_FPREG0+13, REG_FPREG0+14, REG_FPREG0+15, | ||
| 744 | +}; | ||
| 745 | + | ||
| 746 | +CORE_ADDR | ||
| 747 | +register_u_addr (CORE_ADDR blockend, int regnum) | ||
| 748 | +{ | ||
| 749 | + if (regnum < 0 || regnum >= sizeof regmap/sizeof regmap[0]) | ||
| 750 | + return (CORE_ADDR)-1; | ||
| 751 | + return (blockend + 4 * regmap[regnum]); | ||
| 752 | +} | ||
| 753 | + | ||
| 754 | + | ||
| 755 | +/* Return the address in the core dump or inferior of register REGNO. | ||
| 756 | + BLOCKEND is the address of the end of the user structure. */ | ||
| 757 | + | ||
| 758 | +CORE_ADDR | ||
| 759 | +register_addr (int regno, CORE_ADDR blockend) | ||
| 760 | +{ | ||
| 761 | + CORE_ADDR addr; | ||
| 762 | + | ||
| 763 | + if (regno < 0 || regno >= SH_LINUX_NUM_REGS) { | ||
| 764 | + internal_error (__FILE__, __LINE__, | ||
| 765 | + _("Got request for bad register number %d."), regno); | ||
| 766 | + } | ||
| 767 | + | ||
| 768 | + REGISTER_U_ADDR (addr, blockend, regno); | ||
| 769 | + | ||
| 770 | + return addr; | ||
| 771 | +} | ||
| 772 | + | ||
| 773 | +/* Fetch one register. */ | ||
| 774 | + | ||
| 775 | +static void | ||
| 776 | +fetch_register (struct regcache *regcache, int tid, int regno) | ||
| 777 | +{ | ||
| 778 | + int val; | ||
| 779 | + | ||
| 780 | + if (cannot_fetch_register (regno)) | ||
| 781 | + { | ||
| 782 | + regcache_raw_supply (regcache, regno, NULL); | ||
| 783 | + return; | ||
| 784 | + } | ||
| 785 | + | ||
| 786 | + errno = 0; | ||
| 787 | + val = ptrace (PTRACE_PEEKUSER, tid, register_addr (regno, 0), 0); | ||
| 788 | + if (errno != 0) | ||
| 789 | + perror_with_name (_("Couldn't get registers")); | ||
| 790 | + | ||
| 791 | + regcache_raw_supply (regcache, regno, &val); | ||
| 792 | +} | ||
| 793 | + | ||
| 794 | +/* Store one register. */ | ||
| 795 | + | ||
| 796 | +static void | ||
| 797 | +store_register (struct regcache *regcache, int tid, int regno) | ||
| 798 | +{ | ||
| 799 | + int val; | ||
| 800 | + | ||
| 801 | + if (cannot_store_register (regno)) | ||
| 802 | + return; | ||
| 803 | + | ||
| 804 | + errno = 0; | ||
| 805 | + regcache_raw_collect (regcache, regno, &val); | ||
| 806 | + ptrace (PTRACE_POKEUSER, tid, register_addr (regno, 0), val); | ||
| 807 | + if (errno != 0) | ||
| 808 | + perror_with_name (_("Couldn't write registers")); | ||
| 809 | +} | ||
| 810 | + | ||
| 811 | +/* Transfering the general-purpose registers between GDB, inferiors | ||
| 812 | + and core files. */ | ||
| 813 | + | ||
| 814 | +/* Fill GDB's register array with the general-purpose register values | ||
| 815 | + in *GREGSETP. */ | ||
| 816 | + | ||
| 817 | +void | ||
| 818 | +supply_gregset (struct regcache *regcache, const elf_gregset_t *gregsetp) | ||
| 819 | +{ | ||
| 820 | + elf_greg_t *regp = (elf_greg_t *) gregsetp; | ||
| 821 | + int i; | ||
| 822 | + | ||
| 823 | + for (i = 0; i < 23; i++) | ||
| 824 | + if (regmap[i] == -1) | ||
| 825 | + regcache_raw_supply (regcache, i, NULL); | ||
| 826 | + else | ||
| 827 | + regcache_raw_supply (regcache, i, (char *) (regp + regmap[i])); | ||
| 828 | +} | ||
| 829 | + | ||
| 830 | +/* Fill register REGNO (if it is a general-purpose register) in | ||
| 831 | + *GREGSETPS with the value in GDB's register array. If REGNO is -1, | ||
| 832 | + do this for all registers. */ | ||
| 833 | + | ||
| 834 | +void | ||
| 835 | +fill_gregset (const struct regcache *regcache, elf_gregset_t *gregsetp, int regno) | ||
| 836 | +{ | ||
| 837 | + elf_greg_t *regp = (elf_greg_t *) gregsetp; | ||
| 838 | + int i; | ||
| 839 | + | ||
| 840 | + for (i = 0; i < 23; i++) | ||
| 841 | + if (regmap[i] != -1 && (regno == -1 || regno == i)) | ||
| 842 | + regcache_raw_collect (regcache, i, (char *) (regp + regmap[i])); | ||
| 843 | +} | ||
| 844 | + | ||
| 845 | +/* Transfering floating-point registers between GDB, inferiors and cores. */ | ||
| 846 | + | ||
| 847 | +/* Fill GDB's register array with the floating-point register values in | ||
| 848 | + *FPREGSETP. */ | ||
| 849 | + | ||
| 850 | +void | ||
| 851 | +supply_fpregset (struct regcache *regcache, const elf_fpregset_t *fpregsetp) | ||
| 852 | +{ | ||
| 853 | + int i; | ||
| 854 | + long *regp = (long *)fpregsetp; | ||
| 855 | + | ||
| 856 | + for (i = 0; i < 16; i++) | ||
| 857 | + regcache_raw_supply (regcache, 25 + i, (char *) (regp + i)); | ||
| 858 | + regcache_raw_supply (regcache, FPUL_REGNUM, (char *) (regp + REG_FPUL - REG_FPREG0)); | ||
| 859 | + regcache_raw_supply (regcache, FPSCR_REGNUM, (char *) (regp + REG_FPSCR - REG_FPREG0)); | ||
| 860 | +} | ||
| 861 | + | ||
| 862 | +/* Fill register REGNO (if it is a floating-point register) in | ||
| 863 | + *FPREGSETP with the value in GDB's register array. If REGNO is -1, | ||
| 864 | + do this for all registers. */ | ||
| 865 | + | ||
| 866 | +void | ||
| 867 | +fill_fpregset (const struct regcache *regcache, elf_fpregset_t *fpregsetp, int regno) | ||
| 868 | +{ | ||
| 869 | + int i; | ||
| 870 | + long *regp = (long *)fpregsetp; | ||
| 871 | + | ||
| 872 | + for (i = 0; i < 16; i++) | ||
| 873 | + if ((regno == -1) || (regno == i)) | ||
| 874 | + regcache_raw_collect (regcache, 25 + i, (char *) (regp + i)); | ||
| 875 | + if ((regno == -1) || regno == FPSCR_REGNUM) | ||
| 876 | + regcache_raw_collect (regcache, FPSCR_REGNUM, (char *) (regp + REG_FPSCR - REG_FPREG0)); | ||
| 877 | + if ((regno == -1) || regno == FPUL_REGNUM) | ||
| 878 | + regcache_raw_collect (regcache, FPUL_REGNUM, (char *) (regp + REG_FPUL - REG_FPREG0)); | ||
| 879 | +} | ||
| 880 | + | ||
| 881 | +/* Transferring arbitrary registers between GDB and inferior. */ | ||
| 882 | + | ||
| 883 | +/* Check if register REGNO in the child process is accessible. | ||
| 884 | + If we are accessing registers directly via the U area, only the | ||
| 885 | + general-purpose registers are available. | ||
| 886 | + All registers should be accessible if we have GETREGS support. */ | ||
| 887 | + | ||
| 888 | +int | ||
| 889 | +cannot_fetch_register (int regno) | ||
| 890 | +{ | ||
| 891 | + return (regno < 0 || regno >= sizeof regmap / sizeof regmap[0] || regmap[regno] == -1); | ||
| 892 | +} | ||
| 893 | + | ||
| 894 | +int | ||
| 895 | +cannot_store_register (int regno) | ||
| 896 | +{ | ||
| 897 | + return (regno < 0 || regno >= sizeof regmap / sizeof regmap[0] || regmap[regno] == -1); | ||
| 898 | +} | ||
| 899 | + | ||
| 900 | +/* Fetch register values from the inferior. | ||
| 901 | + If REGNO is negative, do this for all registers. | ||
| 902 | + Otherwise, REGNO specifies which register (so we can save time). */ | ||
| 903 | + | ||
| 904 | +static void | ||
| 905 | +sh_linux_fetch_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regno) | ||
| 906 | +{ | ||
| 907 | + int i; | ||
| 908 | + int tid; | ||
| 909 | + | ||
| 910 | + /* GNU/Linux LWP ID's are process ID's. */ | ||
| 911 | + if ((tid = TIDGET (inferior_ptid)) == 0) | ||
| 912 | + tid = PIDGET (inferior_ptid); /* Not a threaded program. */ | ||
| 913 | + | ||
| 914 | + for (i = 0; i < SH_LINUX_NUM_REGS; i++) | ||
| 915 | + if (regno == -1 || regno == i) | ||
| 916 | + fetch_register (regcache, tid, i); | ||
| 917 | +} | ||
| 918 | +/* Store our register values back into the inferior. | ||
| 919 | + If REGNO is negative, do this for all registers. | ||
| 920 | + Otherwise, REGNO specifies which register (so we can save time). */ | ||
| 921 | + | ||
| 922 | +static void | ||
| 923 | +sh_linux_store_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regno) | ||
| 924 | +{ | ||
| 925 | + int i; | ||
| 926 | + int tid; | ||
| 927 | + | ||
| 928 | + /* GNU/Linux LWP ID's are process ID's. */ | ||
| 929 | + if ((tid = TIDGET (inferior_ptid)) == 0) | ||
| 930 | + tid = PIDGET (inferior_ptid); /* Not a threaded program. */ | ||
| 931 | + | ||
| 932 | + for (i = 0; i < SH_LINUX_NUM_REGS; i++) | ||
| 933 | + if (regno == -1 || regno == i) | ||
| 934 | + store_register (regcache, tid, i); | ||
| 935 | +} | ||
| 936 | + | ||
| 937 | +void | ||
| 938 | +_initialize_sh_linux_nat (void) | ||
| 939 | +{ | ||
| 940 | + struct target_ops *t; | ||
| 941 | + | ||
| 942 | + /* Fill in the generic GNU/Linux methods. */ | ||
| 943 | + t = linux_target (); | ||
| 944 | + | ||
| 945 | + /* Add our register access methods. */ | ||
| 946 | + t->to_fetch_registers = sh_linux_fetch_inferior_registers; | ||
| 947 | + t->to_store_registers = sh_linux_store_inferior_registers; | ||
| 948 | + | ||
| 949 | + /* Register the target. */ | ||
| 950 | + linux_nat_add_target (t); | ||
| 951 | +} | ||
| 952 | Index: gdb-7.5/gdb/sh-tdep.c | ||
| 953 | =================================================================== | ||
| 954 | --- gdb-7.5.orig/gdb/sh-tdep.c 2012-06-08 07:24:57.000000000 -0700 | ||
| 955 | +++ gdb-7.5/gdb/sh-tdep.c 2012-09-19 14:45:09.770619943 -0700 | ||
| 956 | @@ -21,6 +21,9 @@ | ||
| 957 | sac@cygnus.com. */ | ||
| 958 | |||
| 959 | #include "defs.h" | ||
| 960 | +#include "arch-utils.h" | ||
| 961 | +#include "command.h" | ||
| 962 | +#include "dummy-frame.h" | ||
| 963 | #include "frame.h" | ||
| 964 | #include "frame-base.h" | ||
| 965 | #include "frame-unwind.h" | ||
| 966 | @@ -37,6 +40,7 @@ | ||
| 967 | #include "arch-utils.h" | ||
| 968 | #include "floatformat.h" | ||
| 969 | #include "regcache.h" | ||
| 970 | +#include "regset.h" | ||
| 971 | #include "doublest.h" | ||
| 972 | #include "osabi.h" | ||
| 973 | #include "reggroups.h" | ||
| 974 | @@ -69,23 +73,6 @@ | ||
| 975 | |||
| 976 | static const char *sh_active_calling_convention = sh_cc_gcc; | ||
| 977 | |||
| 978 | -#define SH_NUM_REGS 67 | ||
| 979 | - | ||
| 980 | -struct sh_frame_cache | ||
| 981 | -{ | ||
| 982 | - /* Base address. */ | ||
| 983 | - CORE_ADDR base; | ||
| 984 | - LONGEST sp_offset; | ||
| 985 | - CORE_ADDR pc; | ||
| 986 | - | ||
| 987 | - /* Flag showing that a frame has been created in the prologue code. */ | ||
| 988 | - int uses_fp; | ||
| 989 | - | ||
| 990 | - /* Saved registers. */ | ||
| 991 | - CORE_ADDR saved_regs[SH_NUM_REGS]; | ||
| 992 | - CORE_ADDR saved_sp; | ||
| 993 | -}; | ||
| 994 | - | ||
| 995 | static int | ||
| 996 | sh_is_renesas_calling_convention (struct type *func_type) | ||
| 997 | { | ||
| 998 | @@ -1045,7 +1032,7 @@ | ||
| 999 | return 0; | ||
| 1000 | /* Otherwise if the type of that member is float, the whole type is | ||
| 1001 | treated as float. */ | ||
| 1002 | - if (TYPE_CODE (TYPE_FIELD_TYPE (type, 0)) == TYPE_CODE_FLT) | ||
| 1003 | + if (TYPE_CODE (check_typedef (TYPE_FIELD_TYPE (type, 0))) == TYPE_CODE_FLT) | ||
| 1004 | return 1; | ||
| 1005 | /* Otherwise it's not treated as float. */ | ||
| 1006 | return 0; | ||
| 1007 | @@ -1095,7 +1082,7 @@ | ||
| 1008 | in four registers available. Loop thru args from first to last. */ | ||
| 1009 | for (argnum = 0; argnum < nargs; argnum++) | ||
| 1010 | { | ||
| 1011 | - type = value_type (args[argnum]); | ||
| 1012 | + type = check_typedef (value_type (args[argnum])); | ||
| 1013 | len = TYPE_LENGTH (type); | ||
| 1014 | val = sh_justify_value_in_reg (gdbarch, args[argnum], len); | ||
| 1015 | |||
| 1016 | @@ -1809,7 +1796,7 @@ | ||
| 1017 | reg->how = DWARF2_FRAME_REG_UNDEFINED; | ||
| 1018 | } | ||
| 1019 | |||
| 1020 | -static struct sh_frame_cache * | ||
| 1021 | +struct sh_frame_cache * | ||
| 1022 | sh_alloc_frame_cache (void) | ||
| 1023 | { | ||
| 1024 | struct sh_frame_cache *cache; | ||
| 1025 | @@ -1836,7 +1823,7 @@ | ||
| 1026 | return cache; | ||
| 1027 | } | ||
| 1028 | |||
| 1029 | -static struct sh_frame_cache * | ||
| 1030 | +struct sh_frame_cache * | ||
| 1031 | sh_frame_cache (struct frame_info *this_frame, void **this_cache) | ||
| 1032 | { | ||
| 1033 | struct gdbarch *gdbarch = get_frame_arch (this_frame); | ||
| 1034 | @@ -1903,9 +1890,9 @@ | ||
| 1035 | return cache; | ||
| 1036 | } | ||
| 1037 | |||
| 1038 | -static struct value * | ||
| 1039 | -sh_frame_prev_register (struct frame_info *this_frame, | ||
| 1040 | - void **this_cache, int regnum) | ||
| 1041 | +struct value * | ||
| 1042 | +sh_frame_prev_register (struct frame_info *this_frame, void **this_cache, | ||
| 1043 | + int regnum) | ||
| 1044 | { | ||
| 1045 | struct gdbarch *gdbarch = get_frame_arch (this_frame); | ||
| 1046 | struct sh_frame_cache *cache = sh_frame_cache (this_frame, this_cache); | ||
| 1047 | @@ -1919,7 +1906,7 @@ | ||
| 1048 | the current frame. Frob regnum so that we pull the value from | ||
| 1049 | the correct place. */ | ||
| 1050 | if (regnum == gdbarch_pc_regnum (gdbarch)) | ||
| 1051 | - regnum = PR_REGNUM; | ||
| 1052 | + regnum = PR_REGNUM; /* XXX: really? */ | ||
| 1053 | |||
| 1054 | if (regnum < SH_NUM_REGS && cache->saved_regs[regnum] != -1) | ||
| 1055 | return frame_unwind_got_memory (this_frame, regnum, | ||
| 1056 | @@ -2225,8 +2212,8 @@ | ||
| 1057 | static struct gdbarch * | ||
| 1058 | sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) | ||
| 1059 | { | ||
| 1060 | - struct gdbarch *gdbarch; | ||
| 1061 | struct gdbarch_tdep *tdep; | ||
| 1062 | + struct gdbarch *gdbarch; | ||
| 1063 | |||
| 1064 | /* SH5 is handled entirely in sh64-tdep.c. */ | ||
| 1065 | if (info.bfd_arch_info->mach == bfd_mach_sh5) | ||
| 1066 | @@ -2242,6 +2229,18 @@ | ||
| 1067 | tdep = XZALLOC (struct gdbarch_tdep); | ||
| 1068 | gdbarch = gdbarch_alloc (&info, tdep); | ||
| 1069 | |||
| 1070 | + /* General-purpose registers. */ | ||
| 1071 | + tdep->gregset = NULL; | ||
| 1072 | + tdep->gregset_reg_offset = NULL; | ||
| 1073 | + tdep->gregset_num_regs = 23; | ||
| 1074 | + tdep->sizeof_gregset = 0; | ||
| 1075 | + | ||
| 1076 | + /* Floating-point registers. */ | ||
| 1077 | + tdep->fpregset = NULL; | ||
| 1078 | + tdep->sizeof_fpregset = 34*4; | ||
| 1079 | + | ||
| 1080 | + tdep->jb_pc_offset = -1; | ||
| 1081 | + | ||
| 1082 | set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT); | ||
| 1083 | set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT); | ||
| 1084 | set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT); | ||
| 1085 | @@ -2389,10 +2388,11 @@ | ||
| 1086 | break; | ||
| 1087 | } | ||
| 1088 | |||
| 1089 | + dwarf2_append_unwinders (gdbarch); | ||
| 1090 | + | ||
| 1091 | /* Hook in ABI-specific overrides, if they have been registered. */ | ||
| 1092 | gdbarch_init_osabi (info, gdbarch); | ||
| 1093 | |||
| 1094 | - dwarf2_append_unwinders (gdbarch); | ||
| 1095 | frame_unwind_append_unwinder (gdbarch, &sh_stub_unwind); | ||
| 1096 | frame_unwind_append_unwinder (gdbarch, &sh_frame_unwind); | ||
| 1097 | |||
| 1098 | Index: gdb-7.5/gdb/testsuite/gdb.asm/sh-linux.inc | ||
| 1099 | =================================================================== | ||
| 1100 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1101 | +++ gdb-7.5/gdb/testsuite/gdb.asm/sh-linux.inc 2012-09-19 14:40:42.978609771 -0700 | ||
| 1102 | @@ -0,0 +1,78 @@ | ||
| 1103 | +# You'll find a bunch of nop opcodes in the below macros. They are | ||
| 1104 | +# there to keep the code correctly aligned. Be careful to maintain | ||
| 1105 | +# them when changing the code. | ||
| 1106 | + | ||
| 1107 | + comment "subroutine declare" | ||
| 1108 | + .purgem gdbasm_declare | ||
| 1109 | + .macro gdbasm_declare name | ||
| 1110 | + .align 1 | ||
| 1111 | + .global \name | ||
| 1112 | +\name: | ||
| 1113 | + .endm | ||
| 1114 | + | ||
| 1115 | + comment "subroutine prologue" | ||
| 1116 | + .macro gdbasm_enter | ||
| 1117 | + mov.l r14,@-r15 | ||
| 1118 | + sts.l pr,@-r15 | ||
| 1119 | + mov r15,r14 | ||
| 1120 | + nop | ||
| 1121 | + .endm | ||
| 1122 | + | ||
| 1123 | + comment "subroutine epilogue" | ||
| 1124 | + .macro gdbasm_leave | ||
| 1125 | + mov r14,r15 | ||
| 1126 | + lds.l @r15+,pr | ||
| 1127 | + mov.l @r15+,r14 | ||
| 1128 | + rts | ||
| 1129 | + nop | ||
| 1130 | + nop | ||
| 1131 | + .endm | ||
| 1132 | + | ||
| 1133 | + comment "subroutine end" | ||
| 1134 | + .purgem gdbasm_end | ||
| 1135 | + .macro gdbasm_end name | ||
| 1136 | + .size \name, .-_foo1 | ||
| 1137 | + .align 1 | ||
| 1138 | + .endm | ||
| 1139 | + | ||
| 1140 | + comment "subroutine call" | ||
| 1141 | + .macro gdbasm_call subr | ||
| 1142 | + mov.l .Lconst\@,r1 | ||
| 1143 | + bra .Lafterconst\@ | ||
| 1144 | + nop | ||
| 1145 | + .align 2 | ||
| 1146 | +.Lconst\@: | ||
| 1147 | + .long \subr | ||
| 1148 | +.Lafterconst\@: | ||
| 1149 | + jsr @r1 | ||
| 1150 | + nop | ||
| 1151 | + .endm | ||
| 1152 | + | ||
| 1153 | + .macro gdbasm_several_nops | ||
| 1154 | + nop | ||
| 1155 | + nop | ||
| 1156 | + nop | ||
| 1157 | + nop | ||
| 1158 | + .endm | ||
| 1159 | + | ||
| 1160 | + comment "exit (0)" | ||
| 1161 | + .macro gdbasm_exit0 | ||
| 1162 | + sleep | ||
| 1163 | + nop | ||
| 1164 | + .endm | ||
| 1165 | + | ||
| 1166 | + comment "crt0 startup" | ||
| 1167 | + .macro gdbasm_startup | ||
| 1168 | + mov #0,r14 | ||
| 1169 | + .endm | ||
| 1170 | + | ||
| 1171 | + comment "Declare a data variable" | ||
| 1172 | + .purgem gdbasm_datavar | ||
| 1173 | + .macro gdbasm_datavar name value | ||
| 1174 | + .data | ||
| 1175 | + .align 2 | ||
| 1176 | + .type \name, @object | ||
| 1177 | + .size \name, 4 | ||
| 1178 | +\name: | ||
| 1179 | + .long \value | ||
| 1180 | + .endm | ||
| 1181 | Index: gdb-7.5/gdb/testsuite/gdb.asm/sh.inc | ||
| 1182 | =================================================================== | ||
| 1183 | --- gdb-7.5.orig/gdb/testsuite/gdb.asm/sh.inc 2012-04-16 01:02:09.000000000 -0700 | ||
| 1184 | +++ gdb-7.5/gdb/testsuite/gdb.asm/sh.inc 2012-09-19 14:40:42.978609771 -0700 | ||
| 1185 | @@ -40,9 +40,8 @@ | ||
| 1186 | mov.l .Lconst\@,r1 | ||
| 1187 | bra .Lafterconst\@ | ||
| 1188 | nop | ||
| 1189 | - nop | ||
| 1190 | -.Lconst\@: | ||
| 1191 | .align 2 | ||
| 1192 | +.Lconst\@: | ||
| 1193 | .long \subr | ||
| 1194 | .align 1 | ||
| 1195 | .Lafterconst\@: | ||
| 1196 | Index: gdb-7.5/gdb/testsuite/gdb.asm/asm-source.exp | ||
| 1197 | =================================================================== | ||
| 1198 | --- gdb-7.5.orig/gdb/testsuite/gdb.asm/asm-source.exp 2012-06-25 13:11:43.000000000 -0700 | ||
| 1199 | +++ gdb-7.5/gdb/testsuite/gdb.asm/asm-source.exp 2012-09-19 14:40:42.978609771 -0700 | ||
| 1200 | @@ -108,6 +108,11 @@ | ||
| 1201 | append link-flags " -m elf32ppc" | ||
| 1202 | } | ||
| 1203 | } | ||
| 1204 | + "sh*-linux*" { | ||
| 1205 | + set asm-arch sh-linux | ||
| 1206 | + set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}" | ||
| 1207 | + set debug-flags "-gdwarf-2" | ||
| 1208 | + } | ||
| 1209 | "sh*-*-*" { | ||
| 1210 | set asm-arch sh | ||
| 1211 | set debug-flags "-gdwarf-2" | ||
| 1212 | Index: gdb-7.5/gdb/testsuite/gdb.base/sigall.c | ||
| 1213 | =================================================================== | ||
| 1214 | --- gdb-7.5.orig/gdb/testsuite/gdb.base/sigall.c 2012-02-28 02:24:15.000000000 -0800 | ||
| 1215 | +++ gdb-7.5/gdb/testsuite/gdb.base/sigall.c 2012-09-19 14:42:02.202612808 -0700 | ||
| 1216 | @@ -5,6 +5,10 @@ | ||
| 1217 | /* Signal handlers, we set breakpoints in them to make sure that the | ||
| 1218 | signals really get delivered. */ | ||
| 1219 | |||
| 1220 | +#ifdef __sh__ | ||
| 1221 | +#define signal(a,b) /* Signals not supported on this target - make them go away */ | ||
| 1222 | +#endif | ||
| 1223 | + | ||
| 1224 | #ifdef PROTOTYPES | ||
| 1225 | void | ||
| 1226 | handle_ABRT (int sig) | ||
| 1227 | Index: gdb-7.5/gdb/testsuite/gdb.base/signals.c | ||
| 1228 | =================================================================== | ||
| 1229 | --- gdb-7.5.orig/gdb/testsuite/gdb.base/signals.c 2012-02-28 02:24:15.000000000 -0800 | ||
| 1230 | +++ gdb-7.5/gdb/testsuite/gdb.base/signals.c 2012-09-19 14:43:22.034615831 -0700 | ||
| 1231 | @@ -3,6 +3,10 @@ | ||
| 1232 | #include <signal.h> | ||
| 1233 | #include <unistd.h> | ||
| 1234 | |||
| 1235 | +#ifdef __sh__ | ||
| 1236 | +#define signal(a,b) /* Signals not supported on this target - make them go away */ | ||
| 1237 | +#define alarm(a) /* Ditto for alarm() */ | ||
| 1238 | +#endif | ||
| 1239 | |||
| 1240 | static int count = 0; | ||
| 1241 | |||
| 1242 | Index: gdb-7.5/gdb/testsuite/gdb.base/annota1.c | ||
| 1243 | =================================================================== | ||
| 1244 | --- gdb-7.5.orig/gdb/testsuite/gdb.base/annota1.c 2012-02-28 14:40:48.000000000 -0800 | ||
| 1245 | +++ gdb-7.5/gdb/testsuite/gdb.base/annota1.c 2012-09-19 14:42:42.074614308 -0700 | ||
| 1246 | @@ -1,6 +1,9 @@ | ||
| 1247 | #include <stdio.h> | ||
| 1248 | #include <signal.h> | ||
| 1249 | |||
| 1250 | +#ifdef __sh__ | ||
| 1251 | +#define signal(a,b) /* Signals not supported on this target - make them go away */ | ||
| 1252 | +#endif | ||
| 1253 | |||
| 1254 | #ifdef PROTOTYPES | ||
| 1255 | void | ||
| 1256 | Index: gdb-7.5/gdb/testsuite/gdb.base/annota3.c | ||
| 1257 | =================================================================== | ||
| 1258 | --- gdb-7.5.orig/gdb/testsuite/gdb.base/annota3.c 2012-02-28 14:40:48.000000000 -0800 | ||
| 1259 | +++ gdb-7.5/gdb/testsuite/gdb.base/annota3.c 2012-09-19 14:43:54.410617081 -0700 | ||
| 1260 | @@ -1,6 +1,10 @@ | ||
| 1261 | #include <stdio.h> | ||
| 1262 | #include <signal.h> | ||
| 1263 | |||
| 1264 | +#ifdef __sh__ | ||
| 1265 | +#define signal(a,b) /* Signals not supported on this target - make them go away */ | ||
| 1266 | +#endif | ||
| 1267 | + | ||
| 1268 | |||
| 1269 | #ifdef PROTOTYPES | ||
| 1270 | void | ||
| 1271 | Index: gdb-7.5/gdb/config/sh/xm-linux.h | ||
| 1272 | =================================================================== | ||
| 1273 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1274 | +++ gdb-7.5/gdb/config/sh/xm-linux.h 2012-09-19 14:40:42.994609807 -0700 | ||
| 1275 | @@ -0,0 +1,32 @@ | ||
| 1276 | +/* Native support for GNU/Linux, for GDB, the GNU debugger. | ||
| 1277 | + Copyright (C) 2000 Free Software Foundation, Inc. | ||
| 1278 | + | ||
| 1279 | +This file is part of GDB. | ||
| 1280 | + | ||
| 1281 | +This program is free software; you can redistribute it and/or modify | ||
| 1282 | +it under the terms of the GNU General Public License as published by | ||
| 1283 | +the Free Software Foundation; either version 2 of the License, or | ||
| 1284 | +(at your option) any later version. | ||
| 1285 | + | ||
| 1286 | +This program is distributed in the hope that it will be useful, | ||
| 1287 | +but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 1288 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 1289 | +GNU General Public License for more details. | ||
| 1290 | + | ||
| 1291 | +You should have received a copy of the GNU General Public License | ||
| 1292 | +along with this program; if not, write to the Free Software | ||
| 1293 | +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | ||
| 1294 | + | ||
| 1295 | +#ifndef XM_LINUX_H | ||
| 1296 | +#define XM_LINUX_H | ||
| 1297 | + | ||
| 1298 | +#define HOST_BYTE_ORDER LITTLE_ENDIAN | ||
| 1299 | + | ||
| 1300 | +#define HAVE_TERMIOS | ||
| 1301 | + | ||
| 1302 | +#define NEED_POSIX_SETPGID | ||
| 1303 | + | ||
| 1304 | +/* Need R_OK etc, but USG isn't defined. */ | ||
| 1305 | +#include <unistd.h> | ||
| 1306 | + | ||
| 1307 | +#endif /* #ifndef XM_LINUX_H */ | ||
| 1308 | Index: gdb-7.5/gdb/config/sh/nm-linux.h | ||
| 1309 | =================================================================== | ||
| 1310 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1311 | +++ gdb-7.5/gdb/config/sh/nm-linux.h 2012-09-19 14:40:42.994609807 -0700 | ||
| 1312 | @@ -0,0 +1,54 @@ | ||
| 1313 | +/* Native-dependent definitions for SuperH running Linux, for GDB. | ||
| 1314 | + Copyright 2004 Free Software Foundation, Inc. | ||
| 1315 | + | ||
| 1316 | + This file is part of GDB. | ||
| 1317 | + | ||
| 1318 | + This program is free software; you can redistribute it and/or modify | ||
| 1319 | + it under the terms of the GNU General Public License as published by | ||
| 1320 | + the Free Software Foundation; either version 2 of the License, or | ||
| 1321 | + (at your option) any later version. | ||
| 1322 | + | ||
| 1323 | + This program is distributed in the hope that it will be useful, | ||
| 1324 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 1325 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 1326 | + GNU General Public License for more details. | ||
| 1327 | + | ||
| 1328 | + You should have received a copy of the GNU General Public License | ||
| 1329 | + along with this program; if not, write to the Free Software | ||
| 1330 | + Foundation, Inc., 59 Temple Place - Suite 330, | ||
| 1331 | + Boston, MA 02111-1307, USA. */ | ||
| 1332 | + | ||
| 1333 | +#ifndef NM_LINUX_H | ||
| 1334 | +#define NM_LINUX_H | ||
| 1335 | + | ||
| 1336 | +/* Get generic Linux native definitions. */ | ||
| 1337 | +#include "config/nm-linux.h" | ||
| 1338 | +/* Support for the user area. */ | ||
| 1339 | + | ||
| 1340 | +/* Return the size of the user struct. */ | ||
| 1341 | +extern int kernel_u_size (void); | ||
| 1342 | +#define KERNEL_U_SIZE kernel_u_size() | ||
| 1343 | + | ||
| 1344 | +/* This is the amount to substract from u.u_ar0 to get the offset in | ||
| 1345 | + the core file of the register values. */ | ||
| 1346 | +#define KERNEL_U_ADDR 0 | ||
| 1347 | + | ||
| 1348 | +#define U_REGS_OFFSET 0 | ||
| 1349 | + | ||
| 1350 | +extern CORE_ADDR register_u_addr (CORE_ADDR blockend, int regnum); | ||
| 1351 | +#define REGISTER_U_ADDR(addr, blockend, regnum) \ | ||
| 1352 | + (addr) = register_u_addr (blockend, regnum) | ||
| 1353 | + | ||
| 1354 | +/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */ | ||
| 1355 | +#define FETCH_INFERIOR_REGISTERS | ||
| 1356 | + | ||
| 1357 | +/* Nevertheless, define CANNOT_{FETCH,STORE}_REGISTER, because we | ||
| 1358 | + might fall back on the code `infptrace.c' (well a copy of that code | ||
| 1359 | + in `sh-linux-nat.c' for now) and we can access only the | ||
| 1360 | + general-purpose registers in that way. */ | ||
| 1361 | +extern int cannot_fetch_register (int regno); | ||
| 1362 | +extern int cannot_store_register (int regno); | ||
| 1363 | +#define CANNOT_FETCH_REGISTER(regno) cannot_fetch_register (regno) | ||
| 1364 | +#define CANNOT_STORE_REGISTER(regno) cannot_store_register (regno) | ||
| 1365 | + | ||
| 1366 | +#endif /* NM_LINUX_H */ | ||
| 1367 | Index: gdb-7.5/gdb/config/sh/linux.mh | ||
| 1368 | =================================================================== | ||
| 1369 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
| 1370 | +++ gdb-7.5/gdb/config/sh/linux.mh 2012-09-19 14:40:42.994609807 -0700 | ||
| 1371 | @@ -0,0 +1,8 @@ | ||
| 1372 | +# Host: Renesas Super-H running GNU/Linux | ||
| 1373 | +NAT_FILE= config/sh/nm-linux.h | ||
| 1374 | +NATDEPFILES= inf-ptrace.o fork-child.o corelow.o sh-linux-nat.o \ | ||
| 1375 | + proc-service.o linux-thread-db.o gcore.o \ | ||
| 1376 | + linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o | ||
| 1377 | + | ||
| 1378 | +NAT_CDEPS = $(srcdir)/proc-service.list | ||
| 1379 | +LOADLIBES= -ldl $(RDYNAMIC) | ||
diff --git a/meta/recipes-devtools/gdb/gdb/run-ptest b/meta/recipes-devtools/gdb/gdb/run-ptest new file mode 100755 index 0000000000..e8587e8961 --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb/run-ptest | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | make -C testsuite check-single | sed -e 's/XFAIL/PASS/' -e 's/UNRESOLVED/SKIP/' -e 's/UNTESTED/SKIP/' -e 's/UNSUPPORTED/SKIP/' | ||
diff --git a/meta/recipes-devtools/gdb/gdb/runtest-flags.patch b/meta/recipes-devtools/gdb/gdb/runtest-flags.patch new file mode 100644 index 0000000000..054abc32d1 --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb/runtest-flags.patch | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | Description: add -a to runtest | ||
| 2 | Pass "-a" to runtest so that everything is printed to output | ||
| 3 | (e.g. unsupported test cases) | ||
| 4 | |||
| 5 | Author: "Gordon.Sun" <gordon.sun@enea.com> | ||
| 6 | Date: Wed, 28 Nov 2012 03:39:58 +0100 | ||
| 7 | |||
| 8 | Upstream-Status: Inappropriate (other) | ||
| 9 | |||
| 10 | Signed-off-by: Gordon.Sun <gordon.sun@enea.com> | ||
| 11 | Signed-off-by: Ciprian Barbu <ciprian.barbu@enea.com> | ||
| 12 | --- | ||
| 13 | gdb/testsuite/Makefile.in | 2 +- | ||
| 14 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in | ||
| 17 | index fab124e..f5cddb2 100644 | ||
| 18 | --- a/gdb/testsuite/Makefile.in | ||
| 19 | +++ b/gdb/testsuite/Makefile.in | ||
| 20 | @@ -46,7 +46,7 @@ EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \ | ||
| 21 | |||
| 22 | RUNTEST = $(RUNTEST_FOR_TARGET) | ||
| 23 | |||
| 24 | -RUNTESTFLAGS = | ||
| 25 | +RUNTESTFLAGS = -a | ||
| 26 | |||
| 27 | FORCE_PARALLEL = | ||
| 28 | |||
| 29 | -- | ||
| 30 | 1.7.5.4 | ||
diff --git a/meta/recipes-devtools/gdb/gdb/sim-install-6.6.patch b/meta/recipes-devtools/gdb/gdb/sim-install-6.6.patch new file mode 100644 index 0000000000..f67c25d50e --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb/sim-install-6.6.patch | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | Upstream-Status: Inappropriate [embedded specific] | ||
| 2 | |||
| 3 | --- gdb-6.1/sim/common/Makefile.in~ 2004-01-15 21:25:06.000000000 +0000 | ||
| 4 | +++ gdb-6.1/sim/common/Makefile.in 2004-07-22 17:07:46.237809032 +0100 | ||
| 5 | @@ -34,7 +34,7 @@ | ||
| 6 | |||
| 7 | datadir = @datadir@ | ||
| 8 | mandir = @mandir@ | ||
| 9 | -man1dir = $(mandir)/man1 | ||
| 10 | +man1dir = $(DESTDIR)$(mandir)/man1 | ||
| 11 | infodir = @infodir@ | ||
| 12 | includedir = @includedir@ | ||
| 13 | |||
| 14 | |||
diff --git a/meta/recipes-devtools/gdb/gdb/sim-install.patch b/meta/recipes-devtools/gdb/gdb/sim-install.patch new file mode 100644 index 0000000000..a663ba7b81 --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb/sim-install.patch | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | Upstream-Status: Inappropriate [embedded specific] | ||
| 2 | |||
| 3 | --- gdb-6.1/sim/common/Makefile.in~ 2004-01-15 21:25:06.000000000 +0000 | ||
| 4 | +++ gdb-6.1/sim/common/Makefile.in 2004-07-22 17:07:46.237809032 +0100 | ||
| 5 | @@ -34,7 +34,7 @@ | ||
| 6 | |||
| 7 | datadir = @datadir@ | ||
| 8 | mandir = @mandir@ | ||
| 9 | -man1dir = $(mandir)/man1 | ||
| 10 | +man1dir = $(DESTDIR)$(mandir)/man1 | ||
| 11 | infodir = @infodir@ | ||
| 12 | includedir = @includedir@ | ||
| 13 | |||
| 14 | |||
| 15 | --- gdb-6.1/sim/common/Make-common.in~sim-install.patch 2003-09-08 18:24:59.000000000 +0100 | ||
| 16 | +++ gdb-6.1/sim/common/Make-common.in 2004-07-22 17:56:18.947423032 +0100 | ||
| 17 | @@ -581,14 +581,14 @@ | ||
| 18 | |||
| 19 | install-common: installdirs | ||
| 20 | n=`echo run | sed '$(program_transform_name)'`; \ | ||
| 21 | - $(INSTALL_PROGRAM) run$(EXEEXT) $(bindir)/$$n$(EXEEXT) | ||
| 22 | + $(INSTALL_PROGRAM) run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT) | ||
| 23 | n=`echo libsim.a | sed s/libsim.a/lib$(target_alias)-sim.a/`; \ | ||
| 24 | - $(INSTALL_DATA) libsim.a $(libdir)/$$n ; \ | ||
| 25 | - ( cd $(libdir) ; $(RANLIB) $$n ) | ||
| 26 | + $(INSTALL_DATA) libsim.a $(DESTDIR)$(libdir)/$$n ; \ | ||
| 27 | + ( cd $(DESTDIR)$(libdir) ; $(RANLIB) $$n ) | ||
| 28 | |||
| 29 | installdirs: | ||
| 30 | - $(SHELL) $(srcdir)/../../mkinstalldirs $(bindir) | ||
| 31 | - $(SHELL) $(srcdir)/../../mkinstalldirs $(libdir) | ||
| 32 | + $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir) | ||
| 33 | + $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(libdir) | ||
| 34 | |||
| 35 | check: | ||
| 36 | cd ../testsuite && $(MAKE) check RUNTESTFLAGS="$(RUNTESTFLAGS)" | ||
diff --git a/meta/recipes-devtools/gdb/gdb/uclibc.patch b/meta/recipes-devtools/gdb/gdb/uclibc.patch new file mode 100644 index 0000000000..f5fd518fcf --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb/uclibc.patch | |||
| @@ -0,0 +1,196 @@ | |||
| 1 | Upstream-Status: Pending | ||
| 2 | |||
| 3 | --- binutils-2.15.91.0.1/bfd/config.bfd~binutils-2.15.90.0.3-uclibc-100-conf | ||
| 4 | +++ binutils-2.15.91.0.1/bfd/config.bfd | ||
| 5 | @@ -128,7 +128,7 @@ | ||
| 6 | targ_defvec=ecoffalpha_little_vec | ||
| 7 | targ_selvecs=bfd_elf64_alpha_vec | ||
| 8 | ;; | ||
| 9 | - alpha*-*-linux-gnu* | alpha*-*-elf*) | ||
| 10 | + alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*) | ||
| 11 | targ_defvec=bfd_elf64_alpha_vec | ||
| 12 | targ_selvecs=ecoffalpha_little_vec | ||
| 13 | ;; | ||
| 14 | @@ -138,7 +138,7 @@ | ||
| 15 | alpha*-*-*) | ||
| 16 | targ_defvec=ecoffalpha_little_vec | ||
| 17 | ;; | ||
| 18 | - ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu) | ||
| 19 | + ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-linux-uclibc* | ia64*-*-kfreebsd*-gnu) | ||
| 20 | targ_defvec=bfd_elf64_ia64_little_vec | ||
| 21 | targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec" | ||
| 22 | ;; | ||
| 23 | @@ -215,7 +215,7 @@ | ||
| 24 | targ_defvec=bfd_elf32_littlearm_vec | ||
| 25 | targ_selvecs=bfd_elf32_bigarm_vec | ||
| 26 | ;; | ||
| 27 | - armeb-*-elf | arm*b-*-linux-gnu*) | ||
| 28 | + armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*) | ||
| 29 | targ_defvec=bfd_elf32_bigarm_vec | ||
| 30 | targ_selvecs=bfd_elf32_littlearm_vec | ||
| 31 | ;; | ||
| 32 | @@ -223,8 +223,8 @@ | ||
| 33 | targ_defvec=bfd_elf32_littlearm_vec | ||
| 34 | targ_selvecs=bfd_elf32_bigarm_vec | ||
| 35 | ;; | ||
| 36 | - arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \ | ||
| 37 | - arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks) | ||
| 38 | + arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | \ | ||
| 39 | + arm*-*-conix* | arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks) | ||
| 40 | targ_defvec=bfd_elf32_littlearm_vec | ||
| 41 | targ_selvecs=bfd_elf32_bigarm_vec | ||
| 42 | ;; | ||
| 43 | @@ -367,7 +367,7 @@ | ||
| 44 | ;; | ||
| 45 | |||
| 46 | #ifdef BFD64 | ||
| 47 | - hppa*64*-*-linux-gnu*) | ||
| 48 | + hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) | ||
| 49 | targ_defvec=bfd_elf64_hppa_linux_vec | ||
| 50 | targ_selvecs=bfd_elf64_hppa_vec | ||
| 51 | ;; | ||
| 52 | @@ -378,7 +378,7 @@ | ||
| 53 | ;; | ||
| 54 | #endif | ||
| 55 | |||
| 56 | - hppa*-*-linux-gnu* | hppa*-*-netbsd*) | ||
| 57 | + hppa*-*-linux-gnu* | hppa*-*-netbsd* | hppa*-*-linux-uclibc*) | ||
| 58 | targ_defvec=bfd_elf32_hppa_linux_vec | ||
| 59 | targ_selvecs=bfd_elf32_hppa_vec | ||
| 60 | ;; | ||
| 61 | @@ -501,7 +501,7 @@ | ||
| 62 | targ_selvecs=bfd_elf32_i386_vec | ||
| 63 | targ_underscore=yes | ||
| 64 | ;; | ||
| 65 | - i[3-7]86-*-linux-gnu*) | ||
| 66 | + i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) | ||
| 67 | targ_defvec=bfd_elf32_i386_vec | ||
| 68 | targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec" | ||
| 69 | targ64_selvecs=bfd_elf64_x86_64_vec | ||
| 70 | @@ -515,7 +515,7 @@ | ||
| 71 | targ_defvec=bfd_elf64_x86_64_vec | ||
| 72 | targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec" | ||
| 73 | ;; | ||
| 74 | - x86_64-*-linux-gnu*) | ||
| 75 | + x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) | ||
| 76 | targ_defvec=bfd_elf64_x86_64_vec | ||
| 77 | targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec" | ||
| 78 | ;; | ||
| 79 | @@ -690,7 +690,7 @@ | ||
| 80 | targ_selvecs=bfd_elf32_m68k_vec | ||
| 81 | targ_underscore=yes | ||
| 82 | ;; | ||
| 83 | - m68*-*-linux-gnu*) | ||
| 84 | + m68*-*-linux-gnu* | m68*-*-linux-uclibc*) | ||
| 85 | targ_defvec=bfd_elf32_m68k_vec | ||
| 86 | targ_selvecs=m68klinux_vec | ||
| 87 | ;; | ||
| 88 | @@ -966,7 +966,8 @@ | ||
| 89 | ;; | ||
| 90 | #endif | ||
| 91 | powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \ | ||
| 92 | - powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \ | ||
| 93 | + powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \ | ||
| 94 | + powerpc-*-rtems* | \ | ||
| 95 | powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*) | ||
| 96 | targ_defvec=bfd_elf32_powerpc_vec | ||
| 97 | targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec" | ||
| 98 | @@ -1003,8 +1004,8 @@ | ||
| 99 | targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" | ||
| 100 | ;; | ||
| 101 | powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \ | ||
| 102 | - powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\ | ||
| 103 | - powerpcle-*-rtems*) | ||
| 104 | + powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\ | ||
| 105 | + powerpcle-*-vxworks* | powerpcle-*-rtems*) | ||
| 106 | targ_defvec=bfd_elf32_powerpcle_vec | ||
| 107 | targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" | ||
| 108 | targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" | ||
| 109 | @@ -1165,7 +1166,7 @@ | ||
| 110 | targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec" | ||
| 111 | targ_underscore=yes | ||
| 112 | ;; | ||
| 113 | - sparc-*-linux-gnu*) | ||
| 114 | + sparc-*-linux-gnu* | sparc-*-linux-uclibc*) | ||
| 115 | targ_defvec=bfd_elf32_sparc_vec | ||
| 116 | targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec" | ||
| 117 | ;; | ||
| 118 | @@ -1212,7 +1213,7 @@ | ||
| 119 | targ_defvec=sunos_big_vec | ||
| 120 | targ_underscore=yes | ||
| 121 | ;; | ||
| 122 | - sparc64-*-linux-gnu*) | ||
| 123 | + sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) | ||
| 124 | targ_defvec=bfd_elf64_sparc_vec | ||
| 125 | targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec" | ||
| 126 | ;; | ||
| 127 | --- binutils-2.15.91.0.1/bfd/configure~binutils-2.15.90.0.3-uclibc-100-conf | ||
| 128 | +++ binutils-2.15.91.0.1/bfd/configure | ||
| 129 | @@ -1687,6 +1687,11 @@ | ||
| 130 | lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` | ||
| 131 | ;; | ||
| 132 | |||
| 133 | +linux-uclibc*) | ||
| 134 | + lt_cv_deplibs_check_method=pass_all | ||
| 135 | + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` | ||
| 136 | + ;; | ||
| 137 | + | ||
| 138 | netbsd*) | ||
| 139 | if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then | ||
| 140 | lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' | ||
| 141 | @@ -5266,7 +5271,7 @@ | ||
| 142 | alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) | ||
| 143 | COREFILE='' | ||
| 144 | ;; | ||
| 145 | - alpha*-*-linux-gnu*) | ||
| 146 | + alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*) | ||
| 147 | COREFILE=trad-core.lo | ||
| 148 | TRAD_HEADER='"hosts/alphalinux.h"' | ||
| 149 | ;; | ||
| 150 | @@ -5326,7 +5331,7 @@ | ||
| 151 | COREFILE=trad-core.lo | ||
| 152 | TRAD_HEADER='"hosts/i386mach3.h"' | ||
| 153 | ;; | ||
| 154 | - i[3-7]86-*-linux-gnu*) | ||
| 155 | + i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) | ||
| 156 | COREFILE=trad-core.lo | ||
| 157 | TRAD_HEADER='"hosts/i386linux.h"' | ||
| 158 | ;; | ||
| 159 | @@ -5364,7 +5369,7 @@ | ||
| 160 | COREFILE=trad-core.lo | ||
| 161 | TRAD_HEADER='"hosts/hp300bsd.h"' | ||
| 162 | ;; | ||
| 163 | - m68*-*-linux-gnu*) | ||
| 164 | + m68*-*-linux-gnu* | m68*-*-linux-uclibc*) | ||
| 165 | COREFILE=trad-core.lo | ||
| 166 | TRAD_HEADER='"hosts/m68klinux.h"' | ||
| 167 | ;; | ||
| 168 | --- binutils-2.15.91.0.1/bfd/configure.in~binutils-2.15.90.0.3-uclibc-100-conf | ||
| 169 | +++ binutils-2.15.91.0.1/bfd/configure.in | ||
| 170 | @@ -164,7 +164,7 @@ | ||
| 171 | alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) | ||
| 172 | COREFILE='' | ||
| 173 | ;; | ||
| 174 | - alpha*-*-linux-gnu*) | ||
| 175 | + alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*) | ||
| 176 | COREFILE=trad-core.lo | ||
| 177 | TRAD_HEADER='"hosts/alphalinux.h"' | ||
| 178 | ;; | ||
| 179 | @@ -245,7 +245,7 @@ | ||
| 180 | TRAD_HEADER='"hosts/i386mach3.h"' | ||
| 181 | ;; | ||
| 182 | changequote(,)dnl | ||
| 183 | - i[3-7]86-*-linux-gnu*) | ||
| 184 | + i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) | ||
| 185 | changequote([,])dnl | ||
| 186 | COREFILE=trad-core.lo | ||
| 187 | TRAD_HEADER='"hosts/i386linux.h"' | ||
| 188 | @@ -286,7 +286,7 @@ | ||
| 189 | COREFILE=trad-core.lo | ||
| 190 | TRAD_HEADER='"hosts/hp300bsd.h"' | ||
| 191 | ;; | ||
| 192 | - m68*-*-linux-gnu*) | ||
| 193 | + m68*-*-linux-gnu* | m68*-*-linux-uclibc*) | ||
| 194 | COREFILE=trad-core.lo | ||
| 195 | TRAD_HEADER='"hosts/m68klinux.h"' | ||
| 196 | ;; | ||
diff --git a/meta/recipes-devtools/gdb/gdb_7.6.bb b/meta/recipes-devtools/gdb/gdb_7.6.bb new file mode 100644 index 0000000000..54082b80e3 --- /dev/null +++ b/meta/recipes-devtools/gdb/gdb_7.6.bb | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | require gdb.inc | ||
| 2 | require gdb-7.6.inc | ||
| 3 | |||
| 4 | inherit python-dir | ||
| 5 | |||
| 6 | PACKAGECONFIG ??= "" | ||
| 7 | PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,python" | ||
| 8 | |||
| 9 | do_configure_prepend() { | ||
| 10 | if [ -n "${@base_contains('PACKAGECONFIG', 'python', 'python', '', d)}" ]; then | ||
| 11 | cat > ${WORKDIR}/python << EOF | ||
| 12 | #!/bin/sh | ||
| 13 | case "\$2" in | ||
| 14 | --includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}/" ;; | ||
| 15 | --ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;; | ||
| 16 | --exec-prefix) echo "${exec_prefix}" ;; | ||
| 17 | *) exit 1 ;; | ||
| 18 | esac | ||
| 19 | exit 0 | ||
| 20 | EOF | ||
| 21 | chmod +x ${WORKDIR}/python | ||
| 22 | fi | ||
| 23 | } | ||
