From: Corinna Vinschen <vinschen@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [RFA] testsuite/gdb.arch/i386-prologue.c: Fix compiling on Cygwin
Date: Tue, 29 Jun 2004 08:13:00 -0000 [thread overview]
Message-ID: <20040629081328.GM19325@cygbert.vinschen.de> (raw)
In-Reply-To: <20040628175738.F35DF4B104@berman.michael-chastain.com>
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.
next prev parent reply other threads:[~2004-06-29 8:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-28 17:57 Michael Elizabeth Chastain
2004-06-29 8:13 ` Corinna Vinschen [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-06-29 18:16 Michael Elizabeth Chastain
2004-06-29 17:27 Michael Elizabeth Chastain
2004-06-29 17:53 ` Corinna Vinschen
2004-06-29 17:25 Michael Elizabeth Chastain
2004-06-28 17:54 Michael Elizabeth Chastain
2004-06-29 8:12 ` Corinna Vinschen
2004-06-28 11:41 Corinna Vinschen
2004-06-28 11:35 Corinna Vinschen
2004-06-29 14:39 ` [RFA] testsuite/gdb.arch/i386-prologue.c: Fix compiling on cygwin Christopher Faylor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040629081328.GM19325@cygbert.vinschen.de \
--to=vinschen@redhat.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox