../commit.txt~
authorPierre Muller <muller@sourceware.org>
Tue, 24 May 2011 12:01:22 +0000 (12:01 +0000)
committerPierre Muller <muller@sourceware.org>
Tue, 24 May 2011 12:01:22 +0000 (12:01 +0000)
14 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/i386-bp_permanent.exp
gdb/testsuite/gdb.arch/i386-gnu-cfi.exp
gdb/testsuite/gdb.arch/i386-permbkpt.exp
gdb/testsuite/gdb.arch/i386-prologue.exp
gdb/testsuite/gdb.arch/i386-size-overlap.exp
gdb/testsuite/gdb.arch/i386-size.exp
gdb/testsuite/gdb.arch/i386-unwind.exp
gdb/testsuite/gdb.reverse/i386-precsave.exp
gdb/testsuite/gdb.reverse/i386-reverse.exp
gdb/testsuite/gdb.reverse/i386-sse-reverse.exp
gdb/testsuite/gdb.reverse/i387-env-reverse.exp
gdb/testsuite/gdb.reverse/i387-stack-reverse.exp
gdb/testsuite/lib/gdb.exp

index b21ca76d8ad7952fad4715bb7a44c7778f470fa3..fad1f652575a22967691c6cb60c1ef10a7083318 100644 (file)
@@ -1,3 +1,20 @@
+2011-05-24  Pierre Muller  <muller@ics.u-strasbg.fr>
+
+       Centralize -DSYMBOL_PREFIX=\"_\" additional flags in gdb.exp.
+       * lib/gdb.exp (gdb_target_symbol_prefix_flags): New procedure.
+       * gdb.arch/i386-bp_permanent.exp: Use gdb_target_symbol_prefix_flags.
+       * gdb.arch/i386-gnu-cfi.exp: Likewise.
+       * gdb.arch/i386-permbkpt.exp: Likewise.
+       * gdb.arch/i386-prologue.exp: Likewise.
+       * gdb.arch/i386-size-overlap.exp: Likewise.
+       * gdb.arch/i386-size.exp: Likewise.
+       * gdb.arch/i386-unwind.exp: Likewise.
+       * gdb.reverse/i386-precsave.exp: Likewise.
+       * gdb.reverse/i386-reverse.exp: Likewise.
+       * gdb.reverse/i386-sse-reverse.exp: Likewise.
+       * gdb.reverse/i387-env-reverse.exp: Likewise.
+       * gdb.reverse/i387-stack-reverse.exp: Likewise.
+
 2011-05-24  Pedro Alves  <pedro@codesourcery.com>
 
        * gdb.trace/tfile.exp: Add test that opening the basic.tf trace
index 3b39d78f03ddb4fc45928605715bd02e2e9f5eff..fd3640a7f556030465e326a885f9beb7a9f647b1 100644 (file)
@@ -32,11 +32,7 @@ set srcfile i386-prologue.c
 set binfile ${objdir}/${subdir}/${testfile}
 
 # 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=\"_\""
-}
+set additional_flags [gdb_target_symbol_prefix_flags]
 
 # Don't use "debug", so that we don't have line information for the assembly
 # fragments.
index 10d57401597f8e8a3e54141cb80525f6cec14133..016302cb35c4c49844917eb5d64eb86f576b0177 100644 (file)
@@ -38,11 +38,7 @@ set srcfileasm ${testfile}-asm.S
 set binfile ${objdir}/${subdir}/${testfile}
 
 # some targets have leading underscores on assembly symbols.
-# TODO: detect this automatically
-set additional_flags ""
-if { [istarget "*-*-cygwin*"] || [istarget "*-*-mingw*"] } then {
-  set additional_flags "additional_flags=-DSYMBOL_PREFIX=\"_\""
-}
+set additional_flags [gdb_target_symbol_prefix_flags]
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfilec} ${srcdir}/${subdir}/${srcfileasm}" "${binfile}" executable [list debug $additional_flags]] != "" } {
     untested i386-gnu-cfi.exp
index 4805ca4585ea9fcabba5991f878094c989f90217..9e10bb74ed5ff823204077904bd9af011d2a222a 100644 (file)
@@ -31,12 +31,8 @@ set testfile "i386-permbkpt"
 set srcfile ${testfile}.S
 set binfile ${objdir}/${subdir}/${testfile}
 
-# Some targets have leading underscores on assembly symbols.
-# TODO: detect this automatically
-set additional_flags ""
-if { [istarget "*-*-cygwin*"] || [istarget "*-*-mingw*"] } then {
-    set additional_flags "additional_flags=-DSYMBOL_PREFIX=_"
-}
+# some targets have leading underscores on assembly symbols.
+set additional_flags [gdb_target_symbol_prefix_flags]
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
     untested i386-permbkpt.exp
index 46962f34526c4d00b4adf515b7c2766901dfc795..f69c42bb3c76ebf47b017962322c8ab98b6b3c45 100644 (file)
@@ -36,11 +36,7 @@ set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
 
 # some targets have leading underscores on assembly symbols.
-# TODO: detect this automatically
-set additional_flags ""
-if { [istarget "*-*-cygwin*"] || [istarget "*-*-mingw*"] } then {
-  set additional_flags "additional_flags=-DSYMBOL_PREFIX=\"_\""
-}   
+set additional_flags [gdb_target_symbol_prefix_flags]
 
 # Don't use "debug", so that we don't have line information for the assembly
 # fragments.
index 96ec641cf21aa7d91e4327e78a01d7551c388d99..b2c8dbf72a404559a7821a16f54345933e1ff57d 100644 (file)
@@ -31,11 +31,7 @@ set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
 
 # 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=\"_\""
-}
+set additional_flags [gdb_target_symbol_prefix_flags]
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
          executable [list debug $additional_flags]] != "" } {
index 09b057d3110ba02d481f5145dd8c4adaaf662757..0fc51072b1e21d492b2831be3d59d44091f57e96 100644 (file)
@@ -34,11 +34,7 @@ set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
 
 # 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=\"_\""
-}
+set additional_flags [gdb_target_symbol_prefix_flags]
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
          executable [list debug $additional_flags]] != "" } {
index 9b3f67b8417ec63f5c08b4240c620b6901c2eaba..c6c215e2ce14c1470addbb174eaf4797f4f1f404 100644 (file)
@@ -36,11 +36,7 @@ set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
 
 # some targets have leading underscores on assembly symbols.
-# TODO: detect this automatically
-set additional_flags ""
-if { [istarget "*-*-cygwin*"] || [istarget "*-*-mingw*"] } then {
-  set additional_flags "additional_flags=-DSYMBOL_PREFIX=\"_\""
-}
+set additional_flags [gdb_target_symbol_prefix_flags]
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
     untested i386-unwind.exp
index bb3fecaa641a0b4b7c47c526a1f91a81725910ad..10d8ba3c4a8feb4926089a758c3cd43babfa8ec0 100644 (file)
@@ -39,11 +39,7 @@ set srcfile i386-reverse.c
 set binfile ${objdir}/${subdir}/${testfile}
 
 # 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=\"_\""
-}
+set additional_flags [gdb_target_symbol_prefix_flags]
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
     untested ${testfile}.exp
index adb17cfb0cacedb5290f2ee4da0f4a2d087651bc..f9fda5ee47730ea0b36ec5c4b97d3d5e67deb397 100644 (file)
@@ -38,11 +38,7 @@ set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
 
 # 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=\"_\""
-}
+set additional_flags [gdb_target_symbol_prefix_flags]
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
     untested i386-reverse
index 6de49c5bd17e64234fd276d342c966273ec274ff..3e7664342bcbd088b71d46bb57f832db731a6cc1 100644 (file)
@@ -38,11 +38,7 @@ set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
 
 # 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=\"_\""
-}
+set additional_flags [gdb_target_symbol_prefix_flags]
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
     untested i386-sse-reverse
index 57b4346439c9d1dd134c421097e3abb5536e5eaa..d56cbe5cb9fd86391801f82a1926f0697093f332 100644 (file)
@@ -30,11 +30,7 @@ set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
 
 # 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=\"_\""
-}
+set additional_flags [gdb_target_symbol_prefix_flags]
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
     untested ${testfile}.exp
index 14b1b7e5b32ec9947414e067ccd12910f01eb9a3..10ea55ee1b9dc6adbd680764b8420d8867321cc5 100644 (file)
@@ -30,11 +30,7 @@ set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
 
 # 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=\"_\""
-}
+set additional_flags [gdb_target_symbol_prefix_flags]
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
     untested ${testfile}.exp
index 169ae1cef4fceca68b1fd48ca52d421440c3dbda..4f5b796e90b4f5b86bd9a12dd170784f3ae8ec08 100644 (file)
@@ -3658,3 +3658,19 @@ proc core_find {binfile {deletefiles {}} {arg ""}} {
     }
     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 ""
+    }
+}
+