From: mec.gnu@mindspring.com (Michael Elizabeth Chastain)
To: gdb-patches@sources.redhat.com
Cc: vinschen@redhat.com
Subject: Re: [RFA] testsuite/gdb.arch/i386-prologue.c: Fix compiling on Cygwin
Date: Mon, 28 Jun 2004 17:54:00 -0000 [thread overview]
Message-ID: <20040628175505.1C1504B104@berman.michael-chastain.com> (raw)
> the gdb.arch/i386-prologue.c testcase doesn't compile on Cygwin since
> on Cygwin the assenmbler labels need leading underscores to match the
> same names in C. The below patch fixes that.
I acknowledge the problem, but I don't like to see #ifdef __CYGWIN__
in the middle of i386-prologue.c. So I am declining this patch.
Can you add a layer to this? Use a new symbol such as SYMBOL_PREFIX so
that i386-prologue.exp can tell i386-prologue.c whether to add a leading
underscore or not.
In i386-prologue.exp, something like this:
# some targets have leading underscores on assembly symbols.
# TODO: detect this automatically
set additional_flags ""
if { [istarget "i?86-*-cygwin*"] {
set additional_flags "additional_flags=-DSYMBOL_PREFIX=_"
}
...
gdb_compile ... executable {debug $additional_flags} ...
It would be better to auto-detect the need for a leading underscore,
perhaps by compiling a test program. But you don't need to do that
for this patch.
i386-prologue.exp would look like this. First there is some
preprocessor gunk to add "..." around the value of SYMBOL_PREFIX:
#define xstringify(arg) stringify(arg)
#define stringify(arg) #arg
/* add "..." around SYMBOL_PREFIX to make SP_STRING */
#ifdef SYMBOL_PREFIX
#define SP_STRING xstringify(SYMBOL_PREFIX)
#else
#define SP_STRING ""
#endif
...
Then in the places where you want optional leading underscores, just add
SP_STRING to the big asm string. The big asm string already depends on
string concatenation so this ought to work fine:
" .align 8\n"
SP_STRING "gdb1253:\n"
" pushl %ebp\n"
I'm open to ideas if you have improvements or a different idea. My goal
here is that i386-prologue.c does not have any target-specific tests in
it.
Michael C
===
* gdb.arch/i386-prologue.c: Conditionalize label names to build
on Cygwin.
next reply other threads:[~2004-06-28 17:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-28 17:54 Michael Elizabeth Chastain [this message]
2004-06-29 8:12 ` Corinna Vinschen
-- 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:57 Michael Elizabeth Chastain
2004-06-29 8:13 ` 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=20040628175505.1C1504B104@berman.michael-chastain.com \
--to=mec.gnu@mindspring.com \
--cc=gdb-patches@sources.redhat.com \
--cc=vinschen@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