From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5268 invoked by alias); 4 Dec 2001 18:34:02 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 5203 invoked from network); 4 Dec 2001 18:33:47 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 4 Dec 2001 18:33:47 -0000 Received: from cygbert.vinschen.de (cse.cygnus.com [205.180.230.236]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id KAA18885 for ; Tue, 4 Dec 2001 10:33:43 -0800 (PST) Received: (from corinna@localhost) by cygbert.vinschen.de (8.9.3/8.9.3/Linux sendmail 8.9.3) id TAA08031 for gdb-patches@sources.redhat.com; Tue, 4 Dec 2001 19:33:48 +0100 Date: Tue, 04 Dec 2001 10:34:00 -0000 From: Corinna Vinschen To: gdb-patches Subject: [RFA]: arm changes to run gdb.asm/asm-source.exp successfully Message-ID: <20011204193348.B10634@cygbert.vinschen.de> Reply-To: gdb-patches Mail-Followup-To: gdb-patches Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-SW-Source: 2001-12/txt/msg00110.txt.bz2 Hi, the following patch allows ARM targets to run the gdb.asm test successfully. The change consists basically of a change to asm-tdep.c, function arm_skip_prologue() to scan the prologue the hard way when the source is assembler code and of adding the appropriate arm.inc file plus some additional lines in asm-source.exp and configure.in to support the new target. Corinna ChangeLog: 2001-12-04 Corinna Vinschen * arm-tdep.c (arm_skip_prologue): Skip prologue by scanning the prologue if source is assembler. testsuite/ChangeLog: * gdb.asm/arm.inc: New file. * gdb.asm/asm-source.exp: Add arm targets. * gdb.asm/configure.in: Ditto. * gdb.asm/configure: Recreated from configure.in. The new gdb.asm/arm.inc file: comment "subroutine prologue" .macro gdbasm_enter mov ip, sp stmdb sp!, {fp, ip, lr, pc} sub fp, ip, #4 .endm comment "subroutine epilogue" .macro gdbasm_leave ldmea fp, {fp, sp, pc} .endm .macro gdbasm_call subr bl \subr .endm .macro gdbasm_several_nops nop nop nop nop .endm comment "exit (0)" .macro gdbasm_exit0 mov r0, #0 swi 0x00123456 .endm comment "crt0 startup" .macro gdbasm_startup mov sp, #0 .endm Index: arm-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/arm-tdep.c,v retrieving revision 1.18 diff -u -p -r1.18 arm-tdep.c --- arm-tdep.c 2001/11/30 20:27:08 1.18 +++ arm-tdep.c 2001/12/04 18:18:25 @@ -402,15 +402,24 @@ arm_skip_prologue (CORE_ADDR pc) unsigned long inst; CORE_ADDR skip_pc; CORE_ADDR func_addr, func_end; + char *func_name; struct symtab_and_line sal; /* See what the symbol table says. */ - if (find_pc_partial_function (pc, NULL, &func_addr, &func_end)) + if (find_pc_partial_function (pc, &func_name, &func_addr, &func_end)) { - sal = find_pc_line (func_addr, 0); - if ((sal.line != 0) && (sal.end < func_end)) - return sal.end; + struct symbol *sym; + + /* Found a function. */ + sym = lookup_symbol (func_name, NULL, VAR_NAMESPACE, NULL, NULL); + if (sym && SYMBOL_LANGUAGE (sym) != language_asm) + { + /* Don't use this trick for assembly source files. */ + sal = find_pc_line (func_addr, 0); + if ((sal.line != 0) && (sal.end < func_end)) + return sal.end; + } } /* Check if this is Thumb code. */ Index: testsuite/gdb.asm/asm-source.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/asm-source.exp,v retrieving revision 1.10 diff -u -p -r1.10 asm-source.exp --- asm-source.exp 2001/12/01 01:13:27 1.10 +++ asm-source.exp 2001/12/04 18:18:27 @@ -35,6 +35,12 @@ set asm-arch "" set asm-flags "" set link-flags "" +if [istarget "*arm-*-*"] then { + set asm-arch arm +} +if [istarget "xscale-*-*"] then { + set asm-arch arm +} if [istarget "d10v-*-*"] then { set asm-arch d10v } Index: testsuite/gdb.asm/configure =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/configure,v retrieving revision 1.6 diff -u -p -r1.6 configure --- configure 2001/12/01 01:13:27 1.6 +++ configure 2001/12/04 18:18:28 @@ -28,7 +28,6 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= -sitefile= srcdir= target=NONE verbose= @@ -143,7 +142,6 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages - --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -314,11 +312,6 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$ac_optarg" ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -484,16 +477,12 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$sitefile"; then - if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -else - CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -582,7 +571,7 @@ else { echo "configure: error: can not r fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:586: checking host system type" >&5 +echo "configure:575: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -603,7 +592,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)- echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:607: checking target system type" >&5 +echo "configure:596: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -621,7 +610,7 @@ target_os=`echo $target | sed 's/^\([^-] echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:625: checking build system type" >&5 +echo "configure:614: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -646,6 +635,8 @@ test "$host_alias" != "$target_alias" && archinc=common.inc case ${target} in +*arm-*-*) archinc=arm.inc ;; +xscale-*-*) archinc=arm.inc ;; d10v-*-*) archinc=d10v.inc ;; s390-*-*) archinc=s390.inc ;; i[3456]86*) archinc=i386.inc ;; Index: testsuite/gdb.asm/configure.in =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/configure.in,v retrieving revision 1.6 diff -u -p -r1.6 configure.in --- configure.in 2001/12/01 01:13:27 1.6 +++ configure.in 2001/12/04 18:18:28 @@ -15,6 +15,8 @@ AC_CANONICAL_SYSTEM dnl In default case we need to link with some file so use common.inc. archinc=common.inc case ${target} in +*arm-*-*) archinc=arm.inc ;; +xscale-*-*) archinc=arm.inc ;; d10v-*-*) archinc=d10v.inc ;; s390-*-*) archinc=s390.inc ;; i[[3456]]86*) archinc=i386.inc ;; -- Corinna Vinschen Cygwin Developer Red Hat, Inc. mailto:vinschen@redhat.com