This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [RFA] Testsuite centralize -DSYMBOL_PREFIX uses
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Pedro Alves'" <pedro at codesourcery dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Tue, 24 May 2011 13:42:53 +0200
- Subject: RE: [RFA] Testsuite centralize -DSYMBOL_PREFIX uses
- References: <005001cc19e6$fe446750$facd35f0$@muller@ics-cnrs.unistra.fr> <201105240951.07933.pedro@codesourcery.com>
> -----Message d'origine-----
> De?: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pedro Alves
> Envoyé?: mardi 24 mai 2011 10:51
> À?: gdb-patches@sourceware.org
> Cc?: Pierre Muller
> Objet?: Re: [RFA] Testsuite centralize -DSYMBOL_PREFIX uses
>
> On Tuesday 24 May 2011 08:48:38, Pierre Muller wrote:
>
> > +# gdb_target_symbol_prefix_flags returns a string that can be added
> > +# to gdb_compile options to define SYMBOL_PREFIX macro value
> > +# symbol_prefix_flags returns a string that can be added
> > +# for targets that use underscore as symbol prefix.
>
> > +# The list of targets is incomplete and should be enhanced as
> > +# reports about missing targets come in.
>
> This sentence is useless, IMO.
Removed,
> > +# TODO: find out automatically if the target needs this.
> > +
> > +proc gdb_target_symbol_prefix_flags {} {
> > +if { [istarget "*-*-cygwin*"] || [istarget "i?86-*-mingw*"]
>
> Missing indentation.
This should be 4 spaces and 1 tab for double indent, is that right?
> > + || [istarget "*-*-msdosdjgpp*"] || [istarget "*-*-go32*"]
> > + || [istarget "arm*-*-wince*"] || [istarget "arm*-*-mingwce*"]} {
> > + return "additional_flags=-DSYMBOL_PREFIX=\"_\""
>
> ARM Windows CE is not underscored. Is DJGPP/GO32? bfd/config.bfd
> appears to indicate it isn't. None of the places you touched listed
> wince or djgpp, afaics.
I did a search:
grep TARGET_UNDERSCORE in bfd directory,
$ grep "TARGET_UNDERSCORE[[:space:]]*'_'" *.[hc]
coff-arm.c:#define TARGET_UNDERSCORE '_'
coff-go32.c:#define TARGET_UNDERSCORE '_'
coff-stgo32.c:#define TARGET_UNDERSCORE '_'
pe-i386.c:#define TARGET_UNDERSCORE '_'
pe-sh.c:#define TARGET_UNDERSCORE '_'
pe-x86_64.c:#define TARGET_UNDERSCORE '_'
pei-i386.c:#define TARGET_UNDERSCORE '_'
pei-ia64.c:#define TARGET_UNDERSCORE '_'
pei-sh.c:#define TARGET_UNDERSCORE '_'
pei-x86_64.c:#define TARGET_UNDERSCORE '_'
I knew that there was a change in win64 x86_64 target
leading underscore was default for a moment, but now is
only used if USE_MINGW64_LEADING_UNDERSCORES
The coff-arm.c lead to my confusion about arm windows CE
pe-arm-wince.c and pei-arm-wince.c
both use
#define TARGET_UNDERSCORE 0
so that coff-arm.c doesn't change its value
(the :#define TARGET_UNDERSCORE '_'
in guarded inside a #ifndef TARGET_UNDERSCORE)
I remember that djgpp/go32 targets are using the prefix
as I used DJGPP/go32 quite a lot ...
(dgjpp/go32 was not listed in any test because
using expect for djgpp is quite tricky and only works partially
in windows environment with a special target board that I wrote a while
ago...)
Below is an update lib/gdb.exp change,
does this look better?
Pierre
$ cvs diff -u -p gdb.exp
Index: gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.176
diff -u -p -r1.176 gdb.exp
--- gdb.exp 20 May 2011 14:37:20 -0000 1.176
+++ gdb.exp 24 May 2011 11:39:40 -0000
@@ -3658,3 +3658,19 @@ proc core_find {binfile {deletefiles {}}
}
return $destcore
}
+
+# gdb_target_symbol_prefix_flags returns a string that can be added
+# to gdb_compile options to define SYMBOL_PREFIX macro value
+# symbol_prefix_flags returns a string that can be added
+# for targets that use underscore as symbol prefix.
+# TODO: find out automatically if the target needs this.
+
+proc gdb_target_symbol_prefix_flags {} {
+ if { [istarget "*-*-cygwin*"] || [istarget "i?86-*-mingw*"]
+ || [istarget "*-*-msdosdjgpp*"] || [istarget "*-*-go32*"] } {
+ return "additional_flags=-DSYMBOL_PREFIX=\"_\""
+ } else {
+ return ""
+ }
+}
+