aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.stabs/weird.exp
diff options
context:
space:
mode:
authorPierre Muller <muller@sourceware.org>2010-04-05 22:43:49 +0000
committerPierre Muller <muller@sourceware.org>2010-04-05 22:43:49 +0000
commitec8a089a3021e52b4e686dd75d84e6ef26511737 (patch)
tree7c347e89526868d1331a59624981b65f68486a4d /gdb/testsuite/gdb.stabs/weird.exp
parent2244ba2e4ab60c3d509b78893ade3a7efb6618cc (diff)
downloadfsf-binutils-gdb-ec8a089a3021e52b4e686dd75d84e6ef26511737.zip
fsf-binutils-gdb-ec8a089a3021e52b4e686dd75d84e6ef26511737.tar.gz
fsf-binutils-gdb-ec8a089a3021e52b4e686dd75d84e6ef26511737.tar.bz2
* gdb/stabsread.c (define_symbol): Add support for char
and string constants. * gdb/testsuite/gdb.stabs/aout.sed: Convert all backslash to double backslash within one line, unless it is followed by a double quote. * gdb/testsuite/gdb.stabs/hppa.sed: Idem. * gdb/testsuite/gdb.stabs/weird.def: Add char and String constants * gdb/testsuite/gdb.stabs/weird.exp: Check for correct parsing of chhar and string constants. * gdb/testsuite/gdb.stabs/xcoff.sed: Ignore escaped quote quotes in .stabs to .stabx substitution.
Diffstat (limited to 'gdb/testsuite/gdb.stabs/weird.exp')
-rw-r--r--gdb/testsuite/gdb.stabs/weird.exp13
1 files changed, 12 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.stabs/weird.exp b/gdb/testsuite/gdb.stabs/weird.exp
index 114c9ec..04dca73 100644
--- a/gdb/testsuite/gdb.stabs/weird.exp
+++ b/gdb/testsuite/gdb.stabs/weird.exp
@@ -164,6 +164,12 @@ proc do_tests {} {
gdb_test "p sizeof (const70)" " = 2" "'e' constant with embedded type"
+ gdb_test "p constchar" " = 97 'a'" "char constant"
+ gdb_test "p constString1" " = \"Single quote String1\"" "String constant 1"
+ gdb_test "p constString2" " = \"Double quote String2\"" "String constant 2"
+
+ gdb_test "p constString3" " = \"String3 with embedded quote ' in the middle\"" "String constant 3"
+ gdb_test "p constString4" { = "String4 with embedded quote \\" in the middle"} "String constant 4"
gdb_test "p bad_neg0" " = \{field0 = 42, field2 =.*field3 = 45\}" "p bad_neg0"
gdb_test "ptype inttype" "type = (unsigned int|inttype)" "ptype on inttype"
@@ -251,6 +257,8 @@ proc print_weird_var { var } {
global target_os
set sedscript ${srcdir}/${subdir}/aout.sed
+set sedoptions ""
+
switch -glob ${target_triplet} {
"hppa*-*-*" {
set sedscript ${srcdir}/${subdir}/hppa.sed
@@ -260,15 +268,18 @@ switch -glob ${target_triplet} {
}
"powerpc-*-aix*" {
set sedscript ${srcdir}/${subdir}/xcoff.sed
+ set sedoptions "-r"
}
"rs6000-*-aix*" {
set sedscript ${srcdir}/${subdir}/xcoff.sed
+ set sedoptions "-r"
}
"*-*-aout" {
set sedscript ${srcdir}/${subdir}/aout.sed
}
"*-*-xcoff" {
set sedscript ${srcdir}/${subdir}/xcoff.sed
+ set sedoptions "-r"
}
"alpha-*-*" {
set sedscript ${srcdir}/${subdir}/ecoff.sed
@@ -276,7 +287,7 @@ switch -glob ${target_triplet} {
}
# Hope this is a Unix box.
-set exec_output [remote_exec build "sed" "-f ${sedscript}" "${srcdir}/${subdir}/weird.def" "${srcfile}"]
+set exec_output [remote_exec build "sed" "${sedoptions} -f ${sedscript}" "${srcdir}/${subdir}/weird.def" "${srcfile}"]
if { [lindex $exec_output 0] != 0 } {
perror "Couldn't make test case. $exec_output"
return -1