+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
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.
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
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
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.
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]] != "" } {
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]] != "" } {
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
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
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
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
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
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
}
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 ""
+ }
+}
+