summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/charset.exp
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2009-07-07 21:33:48 +0000
committerTom Tromey <tromey@redhat.com>2009-07-07 21:33:48 +0000
commit98e3eafe23fd42d4744de2e6192d025f8a509ec6 (patch)
treecb2ea1b5a37b6f2618a68391b2cd25cc695c517a /gdb/testsuite/gdb.base/charset.exp
parent301f55165a0298671b8bdded97fd3900af02739b (diff)
downloadgdb-98e3eafe23fd42d4744de2e6192d025f8a509ec6.tar.gz
gdb
* c-lang.c (convert_octal): Only allow 3 octal digits. (print_wchar): Prefer 3-digit octal form. Fall back to hex if needed. * c-exp.y (c_parse_escape): Only allow 3 octal digits. gdb/testsuite * gdb.base/call-rt-st.exp: Update for change to escape output. * gdb.base/callfuncs.exp: Likewise. * gdb.base/charset.exp: Likewise. * gdb.base/constvars.exp: Likewise. * gdb.base/long_long.exp: Likewise. * gdb.base/pointers.exp: Likewise. * gdb.base/printcmds.exp: Likewise. * gdb.base/setvar.exp: Likewise. * gdb.base/store.exp: Likewise. * gdb.cp/ref-types.exp: Likewise. * gdb.mi/mi-var-child.exp: Likewise. * gdb.mi/mi-var-display.exp: Likewise. * gdb.mi/mi2-var-display.exp: Likewise. * gdb.base/charset.exp: Test octal escape sequence length. Update for change to escape output.
Diffstat (limited to 'gdb/testsuite/gdb.base/charset.exp')
-rw-r--r--gdb/testsuite/gdb.base/charset.exp7
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp
index 85885c8e25c..fe1fbb0efdd 100644
--- a/gdb/testsuite/gdb.base/charset.exp
+++ b/gdb/testsuite/gdb.base/charset.exp
@@ -409,7 +409,7 @@ foreach target_charset $charset_subset {
# gdb_test that requires us to use gdb_expect here.
send_gdb "print $L'\\0'\n"
gdb_expect {
- -re "\\\$${decimal} = 0 $L'\\\\0'\[\r\n\]+$gdb_prompt $" {
+ -re "\\\$${decimal} = 0 $L'\\\\000'\[\r\n\]+$gdb_prompt $" {
pass "print the null character in ${target_charset}"
}
-re "$gdb_prompt $" {
@@ -552,6 +552,9 @@ gdb_test "print '\\x'" "\\\\x escape without a following hex digit."
gdb_test "print '\\u'" "\\\\u escape without a following hex digit."
gdb_test "print '\\9'" " = \[0-9\]+ '9'"
+# An octal escape can only be 3 digits.
+gdb_test "print \"\\1011\"" " = \"A1\""
+
# Tests for wide- or unicode- strings. L is the prefix letter to use,
# either "L" (for wide strings), "u" (for UCS-2), or "U" (for UCS-4).
# NAME is used in the test names and should be related to the prefix
@@ -563,7 +566,7 @@ proc test_wide_or_unicode {L name} {
"narrow and $name string concatenation"
gdb_test "print \"ab\" $L\"c\"" " = $L\"abc\"" \
"$name and narrow string concatenation"
- gdb_test "print $L\"\\xe\" $L\"c\"" " = $L\"\\\\16c\"" \
+ gdb_test "print $L\"\\xe\" $L\"c\"" " = $L\"\\\\016c\"" \
"$name string concatenation with escape"
gdb_test "print $L\"\" \"abcdef\" \"g\"" \
"$L\"abcdefg\"" \