From ee5683ab05022bd68d5200b74cf00def28785076 Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Tue, 24 May 2011 12:01:22 +0000 Subject: [PATCH] ../commit.txt~ --- gdb/testsuite/ChangeLog | 17 +++++++++++++++++ gdb/testsuite/gdb.arch/i386-bp_permanent.exp | 6 +----- gdb/testsuite/gdb.arch/i386-gnu-cfi.exp | 6 +----- gdb/testsuite/gdb.arch/i386-permbkpt.exp | 8 ++------ gdb/testsuite/gdb.arch/i386-prologue.exp | 6 +----- gdb/testsuite/gdb.arch/i386-size-overlap.exp | 6 +----- gdb/testsuite/gdb.arch/i386-size.exp | 6 +----- gdb/testsuite/gdb.arch/i386-unwind.exp | 6 +----- gdb/testsuite/gdb.reverse/i386-precsave.exp | 6 +----- gdb/testsuite/gdb.reverse/i386-reverse.exp | 6 +----- gdb/testsuite/gdb.reverse/i386-sse-reverse.exp | 6 +----- gdb/testsuite/gdb.reverse/i387-env-reverse.exp | 6 +----- .../gdb.reverse/i387-stack-reverse.exp | 6 +----- gdb/testsuite/lib/gdb.exp | 16 ++++++++++++++++ 14 files changed, 46 insertions(+), 61 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index b21ca76d8ad..fad1f652575 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,20 @@ +2011-05-24 Pierre Muller + + 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 * gdb.trace/tfile.exp: Add test that opening the basic.tf trace diff --git a/gdb/testsuite/gdb.arch/i386-bp_permanent.exp b/gdb/testsuite/gdb.arch/i386-bp_permanent.exp index 3b39d78f03d..fd3640a7f55 100644 --- a/gdb/testsuite/gdb.arch/i386-bp_permanent.exp +++ b/gdb/testsuite/gdb.arch/i386-bp_permanent.exp @@ -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. diff --git a/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp b/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp index 10d57401597..016302cb35c 100644 --- a/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp +++ b/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp @@ -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 diff --git a/gdb/testsuite/gdb.arch/i386-permbkpt.exp b/gdb/testsuite/gdb.arch/i386-permbkpt.exp index 4805ca4585e..9e10bb74ed5 100644 --- a/gdb/testsuite/gdb.arch/i386-permbkpt.exp +++ b/gdb/testsuite/gdb.arch/i386-permbkpt.exp @@ -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 diff --git a/gdb/testsuite/gdb.arch/i386-prologue.exp b/gdb/testsuite/gdb.arch/i386-prologue.exp index 46962f34526..f69c42bb3c7 100644 --- a/gdb/testsuite/gdb.arch/i386-prologue.exp +++ b/gdb/testsuite/gdb.arch/i386-prologue.exp @@ -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. diff --git a/gdb/testsuite/gdb.arch/i386-size-overlap.exp b/gdb/testsuite/gdb.arch/i386-size-overlap.exp index 96ec641cf21..b2c8dbf72a4 100644 --- a/gdb/testsuite/gdb.arch/i386-size-overlap.exp +++ b/gdb/testsuite/gdb.arch/i386-size-overlap.exp @@ -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]] != "" } { diff --git a/gdb/testsuite/gdb.arch/i386-size.exp b/gdb/testsuite/gdb.arch/i386-size.exp index 09b057d3110..0fc51072b1e 100644 --- a/gdb/testsuite/gdb.arch/i386-size.exp +++ b/gdb/testsuite/gdb.arch/i386-size.exp @@ -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]] != "" } { diff --git a/gdb/testsuite/gdb.arch/i386-unwind.exp b/gdb/testsuite/gdb.arch/i386-unwind.exp index 9b3f67b8417..c6c215e2ce1 100644 --- a/gdb/testsuite/gdb.arch/i386-unwind.exp +++ b/gdb/testsuite/gdb.arch/i386-unwind.exp @@ -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 diff --git a/gdb/testsuite/gdb.reverse/i386-precsave.exp b/gdb/testsuite/gdb.reverse/i386-precsave.exp index bb3fecaa641..10d8ba3c4a8 100644 --- a/gdb/testsuite/gdb.reverse/i386-precsave.exp +++ b/gdb/testsuite/gdb.reverse/i386-precsave.exp @@ -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 diff --git a/gdb/testsuite/gdb.reverse/i386-reverse.exp b/gdb/testsuite/gdb.reverse/i386-reverse.exp index adb17cfb0ca..f9fda5ee477 100644 --- a/gdb/testsuite/gdb.reverse/i386-reverse.exp +++ b/gdb/testsuite/gdb.reverse/i386-reverse.exp @@ -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 diff --git a/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp b/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp index 6de49c5bd17..3e7664342bc 100644 --- a/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp +++ b/gdb/testsuite/gdb.reverse/i386-sse-reverse.exp @@ -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 diff --git a/gdb/testsuite/gdb.reverse/i387-env-reverse.exp b/gdb/testsuite/gdb.reverse/i387-env-reverse.exp index 57b4346439c..d56cbe5cb9f 100644 --- a/gdb/testsuite/gdb.reverse/i387-env-reverse.exp +++ b/gdb/testsuite/gdb.reverse/i387-env-reverse.exp @@ -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 diff --git a/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp b/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp index 14b1b7e5b32..10ea55ee1b9 100644 --- a/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp +++ b/gdb/testsuite/gdb.reverse/i387-stack-reverse.exp @@ -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 diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 169ae1cef4f..4f5b796e90b 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -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 "" + } +} + -- 2.30.2