From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3987 invoked by alias); 29 Jun 2004 08:13:34 -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 3977 invoked from network); 29 Jun 2004 08:13:33 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 29 Jun 2004 08:13:33 -0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i5T8DXe1026629 for ; Tue, 29 Jun 2004 04:13:33 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i5T8DWw15724 for ; Tue, 29 Jun 2004 04:13:32 -0400 Received: from cygbert.vinschen.de (vpn50-41.rdu.redhat.com [172.16.50.41]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id i5T8DVP24591 for ; Tue, 29 Jun 2004 01:13:31 -0700 Received: by cygbert.vinschen.de (Postfix, from userid 500) id 1A76A582E2; Tue, 29 Jun 2004 10:13:29 +0200 (CEST) Date: Tue, 29 Jun 2004 08:13:00 -0000 From: Corinna Vinschen To: gdb-patches@sources.redhat.com Subject: Re: [RFA] testsuite/gdb.arch/i386-prologue.c: Fix compiling on Cygwin Message-ID: <20040629081328.GM19325@cygbert.vinschen.de> Reply-To: gdb-patches@sources.redhat.com Mail-Followup-To: gdb-patches@sources.redhat.com References: <20040628175738.F35DF4B104@berman.michael-chastain.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040628175738.F35DF4B104@berman.michael-chastain.com> User-Agent: Mutt/1.4.2i X-SW-Source: 2004-06/txt/msg00665.txt.bz2 On Jun 28 13:57, Michael Elizabeth Chastain wrote: > Same response as i386-prologue.c. I would like to see: > > " call " SP_PREFIX "trap\n" > " .globl " SP_PREFIX "main\n" > > Or a similar design with > > " call " SYMBOL(trap) "\n" > " .globl " SYMBOL(main) "\n" Same here as for i386-prologue.*. Corinna * gdb.arch/i386-unwind.c: Use preprocessor directives to conditionalize symbol prefixing. * gdb.arch/i386-unwind.exp: Allow symbol prefixing by adding additional_flags handling. Add underscore prefix for Cygwin. Index: gdb.arch/i386-unwind.c =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.arch/i386-unwind.c,v retrieving revision 1.1 diff -u -p -r1.1 i386-unwind.c --- gdb.arch/i386-unwind.c 19 Nov 2003 17:42:43 -0000 1.1 +++ gdb.arch/i386-unwind.c 29 Jun 2004 08:04:48 -0000 @@ -19,6 +19,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifdef SYMBOL_PREFIX +#define SYMBOL(str) SYMBOL_PREFIX #str +#else +#define SYMBOL(str) #str +#endif + void trap (void) { @@ -34,9 +40,9 @@ asm(".text\n" "gdb1435:\n" " pushl %ebp\n" " mov %esp, %ebp\n" - " call trap\n" - " .globl main\n" - "main:\n" + " call " SYMBOL (trap) "\n" + " .globl " SYMBOL (main) "\n" + SYMBOL (main) ":\n" " pushl %ebp\n" " mov %esp, %ebp\n" " call gdb1435\n"); Index: gdb.arch/i386-unwind.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.arch/i386-unwind.exp,v retrieving revision 1.3 diff -u -p -r1.3 i386-unwind.exp --- gdb.arch/i386-unwind.exp 23 Nov 2003 21:14:45 -0000 1.3 +++ gdb.arch/i386-unwind.exp 29 Jun 2004 08:04:48 -0000 @@ -36,7 +36,15 @@ if ![istarget "i?86-*-*"] then { set testfile "i386-unwind" set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { + +# some targets have leading underscores on assembly symbols. +# TODO: detect this automatically +set additional_flags "" +if [istarget "i?86-*-cygwin*"] then { + set additional_flags "additional_flags=-DSYMBOL_PREFIX=\"_\"" +} + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } -- Corinna Vinschen Cygwin Co-Project Leader Red Hat, Inc.