Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [ob] Correct ovldbreak.exp KFAILs
@ 2009-07-06 19:20 Daniel Jacobowitz
  2009-07-06 19:41 ` Mark Kettenis
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2009-07-06 19:20 UTC (permalink / raw)
  To: gdb-patches

Tom confirmed for me that GDB is expected to print \3 instead of \003
nowadays.  This change caused a PASS -> KFAIL transition that I
noticed when diffing logs.  Fix tested on x86_64-linux and committed.

-- 
Daniel Jacobowitz
CodeSourcery

2009-07-06  Daniel Jacobowitz  <dan@codesourcery.com>

	* gdb.cp/ovldbreak.exp: Update expected output for character constants.

Index: gdb.cp/ovldbreak.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/ovldbreak.exp,v
retrieving revision 1.11
diff -u -p -r1.11 ovldbreak.exp
--- gdb.cp/ovldbreak.exp	3 Jan 2009 05:58:04 -0000	1.11
+++ gdb.cp/ovldbreak.exp	6 Jul 2009 19:18:14 -0000
@@ -341,9 +341,9 @@ proc continue_to_bp_overloaded {might_kf
 }
 
 continue_to_bp_overloaded 0 25 "(void|)" ""
-continue_to_bp_overloaded 1 24 "char" "arg=2 \\'\\\\002\\'"
-continue_to_bp_overloaded 1 23 "signed char" "arg=3 \\'\\\\003\\'"
-continue_to_bp_overloaded 1 22 "unsigned char" "arg=4 \\'\\\\004\\'"
+continue_to_bp_overloaded 1 24 "char" "arg=2 \\'\\\\2\\'"
+continue_to_bp_overloaded 1 23 "signed char" "arg=3 \\'\\\\3\\'"
+continue_to_bp_overloaded 1 22 "unsigned char" "arg=4 \\'\\\\4\\'"
 continue_to_bp_overloaded 1 21 "short" "arg=5"
 continue_to_bp_overloaded 1 20 "unsigned short" "arg=6"
 continue_to_bp_overloaded 0 19 "int" "arg=7"


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ob] Correct ovldbreak.exp KFAILs
  2009-07-06 19:20 [ob] Correct ovldbreak.exp KFAILs Daniel Jacobowitz
@ 2009-07-06 19:41 ` Mark Kettenis
  2009-07-06 19:47   ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Kettenis @ 2009-07-06 19:41 UTC (permalink / raw)
  To: drow; +Cc: gdb-patches

> Date: Mon, 6 Jul 2009 15:20:00 -0400
> From: Daniel Jacobowitz <drow@false.org>
> 
> Tom confirmed for me that GDB is expected to print \3 instead of \003
> nowadays.

Sorry, but I think that's a regression; \003 obviously is an octal
character escape sequence, \3 isn't.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ob] Correct ovldbreak.exp KFAILs
  2009-07-06 19:41 ` Mark Kettenis
@ 2009-07-06 19:47   ` Daniel Jacobowitz
  2009-07-07  1:54     ` Tom Tromey
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2009-07-06 19:47 UTC (permalink / raw)
  To: Mark Kettenis, Tom Tromey; +Cc: gdb-patches

On Mon, Jul 06, 2009 at 09:41:19PM +0200, Mark Kettenis wrote:
> > Date: Mon, 6 Jul 2009 15:20:00 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> > 
> > Tom confirmed for me that GDB is expected to print \3 instead of \003
> > nowadays.
> 
> Sorry, but I think that's a regression; \003 obviously is an octal
> character escape sequence, \3 isn't.

Tom, could you expand on the reason for the change?  On IRC you only
mentioned that there was one...

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ob] Correct ovldbreak.exp KFAILs
  2009-07-06 19:47   ` Daniel Jacobowitz
@ 2009-07-07  1:54     ` Tom Tromey
  2009-07-07 14:10       ` Tom Tromey
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2009-07-07  1:54 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:

Mark> Sorry, but I think that's a regression; \003 obviously is an octal
Mark> character escape sequence, \3 isn't.

Daniel> Tom, could you expand on the reason for the change?  On IRC you only
Daniel> mentioned that there was one...

My reading of 6.4.4.4 is that it is an octal character escape
sequence.

escape-sequence:
        octal-escape-sequence

octal-escape-sequence:
        \ octal-digit
        \ octal-digit octal-digit
        \ octal-digit octal-digit octal-digit

I do see now that I wrote the character-constant-parsing code
incorrectly.  I'll make a note to write a patch for that.

Tom


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ob] Correct ovldbreak.exp KFAILs
  2009-07-07  1:54     ` Tom Tromey
@ 2009-07-07 14:10       ` Tom Tromey
  2009-07-07 15:00         ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2009-07-07 14:10 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:

Mark> Sorry, but I think that's a regression; \003 obviously is an octal
Mark> character escape sequence, \3 isn't.

Daniel> Tom, could you expand on the reason for the change?  On IRC you only
Daniel> mentioned that there was one...

Tom> My reading of 6.4.4.4 is that it is an octal character escape
Tom> sequence.

It took me a while to realize I hadn't actually answered the question.

Yes, I believe there was a reason, but I can't remember it.  And, I
can't figure out what it might have been.  I assume I was mistaken
about the need for this change.

I will write a patch to change this back and see what happens.

Tom


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ob] Correct ovldbreak.exp KFAILs
  2009-07-07 14:10       ` Tom Tromey
@ 2009-07-07 15:00         ` Daniel Jacobowitz
  2009-07-07 20:37           ` Tom Tromey
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2009-07-07 15:00 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Mark Kettenis, gdb-patches

On Tue, Jul 07, 2009 at 08:10:40AM -0600, Tom Tromey wrote:
> Yes, I believe there was a reason, but I can't remember it.  And, I
> can't figure out what it might have been.  I assume I was mistaken
> about the need for this change.
> 
> I will write a patch to change this back and see what happens.

Thanks!  I've discovered I failed to check in the patch at top of
thread, anyway - so I shall drop it, until we see if we can revert.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ob] Correct ovldbreak.exp KFAILs
  2009-07-07 15:00         ` Daniel Jacobowitz
@ 2009-07-07 20:37           ` Tom Tromey
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Tromey @ 2009-07-07 20:37 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:

Daniel> Thanks!  I've discovered I failed to check in the patch at top of
Daniel> thread, anyway - so I shall drop it, until we see if we can revert.

Here it is.  Built & regtested on x86-64 (compile farm).
This also fixes the octal escape parsing buglet.

I'll check this in shortly.

Tom

2009-07-07  Tom Tromey  <tromey@redhat.com>

	* 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.

2009-07-07  Tom Tromey  <tromey@redhat.com>

	* gdb.base/call-rt-st.exp: Update for change to escape output.
	* testsuite/gdb.base/callfuncs.exp: Likewise.
	* testsuite/gdb.base/charset.exp: Likewise.
	* testsuite/gdb.base/constvars.exp: Likewise.
	* testsuite/gdb.base/long_long.exp: Likewise.
	* testsuite/gdb.base/pointers.exp: Likewise.
	* testsuite/gdb.base/printcmds.exp: Likewise.
	* testsuite/gdb.base/setvar.exp: Likewise.
	* testsuite/gdb.base/store.exp: Likewise.
	* testsuite/gdb.cp/ref-types.exp: Likewise.
	* testsuite/gdb.mi/mi-var-child.exp: Likewise.
	* testsuite/gdb.mi/mi-var-display.exp: Likewise.
	* testsuite/gdb.mi/mi2-var-display.exp: Likewise.
	* gdb.base/charset.exp: Test octal escape sequence length.
	Update for change to escape output.

diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 75851d0..0a4d5f1 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -1437,14 +1437,19 @@ c_parse_escape (char **ptr, struct obstack *output)
     case '5':
     case '6':
     case '7':
-      if (output)
-	obstack_grow_str (output, "\\");
-      while (isdigit (*tokptr) && *tokptr != '8' && *tokptr != '9')
-	{
-	  if (output)
-	    obstack_1grow (output, *tokptr);
-	  ++tokptr;
-	}
+      {
+	int i;
+	if (output)
+	  obstack_grow_str (output, "\\");
+	for (i = 0;
+	     i < 3 && isdigit (*tokptr) && *tokptr != '8' && *tokptr != '9';
+	     ++i)
+	  {
+	    if (output)
+	      obstack_1grow (output, *tokptr);
+	    ++tokptr;
+	  }
+      }
       break;
 
       /* We handle UCNs later.  We could handle them here, but that
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 5718143..e24b36d 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -220,7 +220,12 @@ print_wchar (gdb_wint_t w, const gdb_byte *orig, int orig_len,
 	      {
 		char octal[30];
 		ULONGEST value = extract_unsigned_integer (&orig[i], width);
-		sprintf (octal, "\\%lo", (long) value);
+		/* If the value fits in 3 octal digits, print it that
+		   way.  Otherwise, print it as a hex escape.  */
+		if (value <= 0777)
+		  sprintf (octal, "\\%.3o", (int) (value & 0777));
+		else
+		  sprintf (octal, "\\x%lx", (long) value);
 		append_string_as_wide (octal, output);
 	      }
 	    /* If we somehow have extra bytes, print them now.  */
@@ -759,9 +764,12 @@ emit_numeric_character (struct type *type, unsigned long value,
 static char *
 convert_octal (struct type *type, char *p, char *limit, struct obstack *output)
 {
+  int i;
   unsigned long value = 0;
 
-  while (p < limit && isdigit (*p) && *p != '8' && *p != '9')
+  for (i = 0;
+       i < 3 && p < limit && isdigit (*p) && *p != '8' && *p != '9';
+       ++i)
     {
       value = 8 * value + host_hex_value (*p);
       ++p;
diff --git a/gdb/testsuite/gdb.base/call-rt-st.exp b/gdb/testsuite/gdb.base/call-rt-st.exp
index f73dd7f..ff68e20 100644
--- a/gdb/testsuite/gdb.base/call-rt-st.exp
+++ b/gdb/testsuite/gdb.base/call-rt-st.exp
@@ -186,7 +186,7 @@ if {![gdb_skip_float_test "print print_two_floats(*f3)"] && \
 
 if ![gdb_skip_stdio_test "print print_bit_flags_char(*cflags)"] {
     print_struct_call "print_bit_flags_char(*cflags)" \
-            ".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+.\[0-9\]+ = \\{alpha = 1 '\\\\1', beta = 0 '\\\\0', gamma = 1 '\\\\1', delta = 0 '\\\\0', epsilon = 1 '\\\\1', omega = 0 '\\\\0'\\}"
+            ".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+.\[0-9\]+ = \\{alpha = 1 '\\\\001', beta = 0 '\\\\000', gamma = 1 '\\\\001', delta = 0 '\\\\000', epsilon = 1 '\\\\001', omega = 0 '\\\\000'\\}"
 }
 
 if ![gdb_skip_stdio_test "print print_bit_flags_short(*sflags)"] {
diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp
index b17b0ba..2b5112d 100644
--- a/gdb/testsuite/gdb.base/callfuncs.exp
+++ b/gdb/testsuite/gdb.base/callfuncs.exp
@@ -439,7 +439,7 @@ gdb_test "print t_small_values(1,3,5,7,9,11,13,15,17,19)" \
 	"The program being debugged stopped while.*" \
 	"stop at nested call level 4"
 gdb_test "backtrace" \
-	"\#0  t_small_values \\(arg1=1 '.1', arg2=3, arg3=5, arg4=7 '.a', arg5=9, arg6=11 '.v', arg7=13, arg8=15, arg9=17, arg10=19\\).*\#2  sum10 \\(i0=2, i1=4, i2=6, i3=8, i4=10, i5=12, i6=14, i7=16, i8=18, i9=20\\).*\#3  <function called from gdb>.*\#4  add \\(a=4, b=5\\).*\#5  <function called from gdb>.*\#6  add \\(a=2, b=3\\).*\#7  <function called from gdb>.*\#8  main.*" \
+	"\#0  t_small_values \\(arg1=1 '.001', arg2=3, arg3=5, arg4=7 '.a', arg5=9, arg6=11 '.v', arg7=13, arg8=15, arg9=17, arg10=19\\).*\#2  sum10 \\(i0=2, i1=4, i2=6, i3=8, i4=10, i5=12, i6=14, i7=16, i8=18, i9=20\\).*\#3  <function called from gdb>.*\#4  add \\(a=4, b=5\\).*\#5  <function called from gdb>.*\#6  add \\(a=2, b=3\\).*\#7  <function called from gdb>.*\#8  main.*" \
 	"backtrace at nested call level 4"
 gdb_test "finish" "Value returned is .* = 100" \
 	"Finish from nested call level 4"
diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp
index 85885c8..fe1fbb0 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\"" \
diff --git a/gdb/testsuite/gdb.base/constvars.exp b/gdb/testsuite/gdb.base/constvars.exp
index 6d1bd12..d53a826 100644
--- a/gdb/testsuite/gdb.base/constvars.exp
+++ b/gdb/testsuite/gdb.base/constvars.exp
@@ -161,7 +161,7 @@ proc do_constvar_tests {} {
     gdb_test "print laconic" " = 65 'A'"
     local_compiler_xfail_check
     gdb_test "ptype laconic" "type = const char"
-    gdb_test "print laggard" " = 1 '.1'"
+    gdb_test "print laggard" " = 1 '.001'"
     local_compiler_xfail_check
     gdb_test "ptype laggard" "type = const unsigned char"
     gdb_test "print lagoon" " = 2"
@@ -209,7 +209,7 @@ proc do_constvar_tests {} {
     gdb_test "print *lewd" " = 65 'A'"
     local_compiler_xfail_check
     gdb_test "ptype lewd" "type = const char \\* const"
-    gdb_test "print *lexicographer" " = 1 '.1'"
+    gdb_test "print *lexicographer" " = 1 '.001'"
     local_compiler_xfail_check
     gdb_test "ptype lexicographer" "type = const unsigned char \\* const"
     gdb_test "print *lexicon" " = 2"
@@ -233,7 +233,7 @@ proc do_constvar_tests {} {
     gdb_test "print *languish" " = 65 'A'"
     local_compiler_xfail_check
     gdb_test "ptype languish" "type = const char \\*"
-    gdb_test "print *languor" " = 1 '.1'"
+    gdb_test "print *languor" " = 1 '.001'"
     local_compiler_xfail_check
     gdb_test "ptype languor" "type = const unsigned char \\*"
     gdb_test "print *lank" " = 2"
diff --git a/gdb/testsuite/gdb.base/long_long.exp b/gdb/testsuite/gdb.base/long_long.exp
index 5189324..5a591e4 100644
--- a/gdb/testsuite/gdb.base/long_long.exp
+++ b/gdb/testsuite/gdb.base/long_long.exp
@@ -210,7 +210,7 @@ gdb_test_char "p/o *(char *)c" "01"
 gdb_test_char "p/t *(char *)c" "1"
 gdb_test_char "p/a *(char *)c" "0x1( <.*>)?"
 gdb_test_char "p/f *(char *)c" "1"
-gdb_test_char "p/c *(char *)c" "1 '.1'"
+gdb_test_char "p/c *(char *)c" "1 '.001'"
 
 gdb_test_short "p/x *(short *)s" "" "0x123" ""
 gdb_test_short "p/d *(short *)s" "" "291" ""
@@ -257,7 +257,7 @@ gdb_test "x/u w" "19088743"
 gdb_test "x/o w" "0110642547"
 gdb_test "x/t w" "00000001001000110100010101100111"
 gdb_test_xptr "x/a" { b "" } { h "" } { w "0x1234567" } { g "0x123456789abcdef" }
-gdb_test "x/c b" "1 '.1'"
+gdb_test "x/c b" "1 '.001'"
 if { $sizeof_double == 8 || $sizeof_long_double == 8 } {
     gdb_test "x/f &val.oct" "-5.9822653797615723e-120"
 } else {
@@ -273,7 +273,7 @@ gdb_test "x/2u g" "81985529216486895.*12046818088235383159"
 gdb_test "x/2o g" "04432126361152746757.*01234567123456701234567"
 gdb_test "x/2t g" "0000000100100011010001010110011110001001101010111100110111101111.*1010011100101110111001010011100101110111000001010011100101110111"
 gdb_test_xptr "x/2a" { b "" } { h "" } { w "0x1234567.*0xa72ee539" } { g "0x123456789abcdef.*0xa72ee53977053977" }
-gdb_test "x/2c b" "1 '.1'.*-89 '.\[0-9\]*'"
+gdb_test "x/2c b" "1 '.001'.*-89 '.\[0-9\]*'"
 if { $sizeof_double == 8 || $sizeof_long_double == 8 } {
     gdb_test "x/2f &val.oct" "-5.9822653797615723e-120.*-5.9041889495880968e-100"
 } else {
@@ -288,7 +288,7 @@ gdb_test "x/2bu b" "1.*167"
 gdb_test "x/2bo b" "01.*0247"
 gdb_test "x/2bt b" "00000001.*10100111"
 gdb_test_ptr "x/2ba b" "" "" "0x1.*0xffffffa7" "0x1.*0xffffffffffffffa7"
-gdb_test "x/2bc b" "1 '.1'.*-89 '.\[0-9\]*'"
+gdb_test "x/2bc b" "1 '.001'.*-89 '.\[0-9\]*'"
 gdb_test "x/2bf b" "1.*-89"
 
 gdb_test "x/2hx h" "0x0123.*0xa72e"
diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp
index 2d0a70e..91838a2 100644
--- a/gdb/testsuite/gdb.base/pointers.exp
+++ b/gdb/testsuite/gdb.base/pointers.exp
@@ -389,7 +389,7 @@ gdb_expect {
 
 send_gdb "print *pUC\n"
 gdb_expect {
-    -re ".\[0-9\]* = 21 \'.25\'.*$gdb_prompt $" {
+    -re ".\[0-9\]* = 21 \'.025\'.*$gdb_prompt $" {
         pass "print value of *pUC"
       }
     -re ".*$gdb_prompt $" { fail "print value of *pUC" }
diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp
index 65ab3a4..0cbcdfa 100644
--- a/gdb/testsuite/gdb.base/printcmds.exp
+++ b/gdb/testsuite/gdb.base/printcmds.exp
@@ -136,13 +136,13 @@ proc test_integer_literals_rejected {} {
 proc test_print_all_chars {} {
     global gdb_prompt
 
-    gdb_test "p ctable1\[0\]"   " = 0 '\\\\0'"
-    gdb_test "p ctable1\[1\]"   " = 1 '\\\\1'"
-    gdb_test "p ctable1\[2\]"   " = 2 '\\\\2'"
-    gdb_test "p ctable1\[3\]"   " = 3 '\\\\3'"
-    gdb_test "p ctable1\[4\]"   " = 4 '\\\\4'"
-    gdb_test "p ctable1\[5\]"   " = 5 '\\\\5'"
-    gdb_test "p ctable1\[6\]"   " = 6 '\\\\6'"
+    gdb_test "p ctable1\[0\]"   " = 0 '\\\\000'"
+    gdb_test "p ctable1\[1\]"   " = 1 '\\\\001'"
+    gdb_test "p ctable1\[2\]"   " = 2 '\\\\002'"
+    gdb_test "p ctable1\[3\]"   " = 3 '\\\\003'"
+    gdb_test "p ctable1\[4\]"   " = 4 '\\\\004'"
+    gdb_test "p ctable1\[5\]"   " = 5 '\\\\005'"
+    gdb_test "p ctable1\[6\]"   " = 6 '\\\\006'"
     gdb_test "p ctable1\[7\]"   " = 7 '\\\\a'"
     gdb_test "p ctable1\[8\]"   " = 8 '\\\\b'"
     gdb_test "p ctable1\[9\]"   " = 9 '\\\\t'"
@@ -150,24 +150,24 @@ proc test_print_all_chars {} {
     gdb_test "p ctable1\[11\]"  " = 11 '\\\\v'"
     gdb_test "p ctable1\[12\]"  " = 12 '\\\\f'"
     gdb_test "p ctable1\[13\]"  " = 13 '\\\\r'"
-    gdb_test "p ctable1\[14\]"  " = 14 '\\\\16'"
-    gdb_test "p ctable1\[15\]"  " = 15 '\\\\17'"
-    gdb_test "p ctable1\[16\]"  " = 16 '\\\\20'"
-    gdb_test "p ctable1\[17\]"  " = 17 '\\\\21'"
-    gdb_test "p ctable1\[18\]"  " = 18 '\\\\22'"
-    gdb_test "p ctable1\[19\]"  " = 19 '\\\\23'"
-    gdb_test "p ctable1\[20\]"  " = 20 '\\\\24'"
-    gdb_test "p ctable1\[21\]"  " = 21 '\\\\25'"
-    gdb_test "p ctable1\[22\]"  " = 22 '\\\\26'"
-    gdb_test "p ctable1\[23\]"  " = 23 '\\\\27'"
-    gdb_test "p ctable1\[24\]"  " = 24 '\\\\30'"
-    gdb_test "p ctable1\[25\]"  " = 25 '\\\\31'"
-    gdb_test "p ctable1\[26\]"  " = 26 '\\\\32'"
-    gdb_test "p ctable1\[27\]"  " = 27 '\\\\33'"
-    gdb_test "p ctable1\[28\]"  " = 28 '\\\\34'"
-    gdb_test "p ctable1\[29\]"  " = 29 '\\\\35'"
-    gdb_test "p ctable1\[30\]"  " = 30 '\\\\36'"
-    gdb_test "p ctable1\[31\]"  " = 31 '\\\\37'"
+    gdb_test "p ctable1\[14\]"  " = 14 '\\\\016'"
+    gdb_test "p ctable1\[15\]"  " = 15 '\\\\017'"
+    gdb_test "p ctable1\[16\]"  " = 16 '\\\\020'"
+    gdb_test "p ctable1\[17\]"  " = 17 '\\\\021'"
+    gdb_test "p ctable1\[18\]"  " = 18 '\\\\022'"
+    gdb_test "p ctable1\[19\]"  " = 19 '\\\\023'"
+    gdb_test "p ctable1\[20\]"  " = 20 '\\\\024'"
+    gdb_test "p ctable1\[21\]"  " = 21 '\\\\025'"
+    gdb_test "p ctable1\[22\]"  " = 22 '\\\\026'"
+    gdb_test "p ctable1\[23\]"  " = 23 '\\\\027'"
+    gdb_test "p ctable1\[24\]"  " = 24 '\\\\030'"
+    gdb_test "p ctable1\[25\]"  " = 25 '\\\\031'"
+    gdb_test "p ctable1\[26\]"  " = 26 '\\\\032'"
+    gdb_test "p ctable1\[27\]"  " = 27 '\\\\033'"
+    gdb_test "p ctable1\[28\]"  " = 28 '\\\\034'"
+    gdb_test "p ctable1\[29\]"  " = 29 '\\\\035'"
+    gdb_test "p ctable1\[30\]"  " = 30 '\\\\036'"
+    gdb_test "p ctable1\[31\]"  " = 31 '\\\\037'"
     gdb_test "p ctable1\[32\]"  " = 32 ' '"
     gdb_test "p ctable1\[33\]"  " = 33 '!'"
     gdb_test "p ctable1\[34\]"  " = 34 '\"'"
@@ -475,13 +475,13 @@ proc test_print_strings {} {
     gdb_test "p &ctable1\[0\]" \
 	" = \\(unsigned char \\*\\) \"\""
     gdb_test "p &ctable1\[1\]" \
-	" = \\(unsigned char \\*\\) \"\\\\1\\\\2\\\\3\\\\4\\\\5\\\\6\\\\a\\\\b\"..."
+	" = \\(unsigned char \\*\\) \"\\\\001\\\\002\\\\003\\\\004\\\\005\\\\006\\\\a\\\\b\"..."
     gdb_test "p &ctable1\[1*8\]" \
-	" = \\(unsigned char \\*\\) \"\\\\b\\\\t\\\\n\\\\v\\\\f\\\\r\\\\16\\\\17\"..."
+	" = \\(unsigned char \\*\\) \"\\\\b\\\\t\\\\n\\\\v\\\\f\\\\r\\\\016\\\\017\"..."
     gdb_test "p &ctable1\[2*8\]" \
-	" = \\(unsigned char \\*\\) \"\\\\20\\\\21\\\\22\\\\23\\\\24\\\\25\\\\26\\\\27\"..."
+	" = \\(unsigned char \\*\\) \"\\\\020\\\\021\\\\022\\\\023\\\\024\\\\025\\\\026\\\\027\"..."
     gdb_test "p &ctable1\[3*8\]" \
-	" = \\(unsigned char \\*\\) \"\\\\30\\\\31\\\\32\\\\33\\\\34\\\\35\\\\36\\\\37\"..."
+	" = \\(unsigned char \\*\\) \"\\\\030\\\\031\\\\032\\\\033\\\\034\\\\035\\\\036\\\\037\"..."
     gdb_test "p &ctable1\[4*8\]" \
 	" = \\(unsigned char \\*\\) \" !\\\\\"#\\\$%&'\"..."
     gdb_test "p &ctable1\[5*8\]" \
@@ -622,7 +622,7 @@ proc test_print_string_constants {} {
     set timeout 60;
 
     gdb_test "p \"a string\""		" = \"a string\""
-    gdb_test "p \"embedded \\000 null\"" " = \"embedded \\\\0 null\""
+    gdb_test "p \"embedded \\000 null\"" " = \"embedded \\\\000 null\""
     gdb_test "p \"abcd\"\[2\]"	" = 99 'c'"
     gdb_test "p sizeof (\"abcdef\")"	" = 7"
     gdb_test "ptype \"foo\""		" = char \\\[4\\\]"
diff --git a/gdb/testsuite/gdb.base/setvar.exp b/gdb/testsuite/gdb.base/setvar.exp
index 3be8424..1783d1a 100644
--- a/gdb/testsuite/gdb.base/setvar.exp
+++ b/gdb/testsuite/gdb.base/setvar.exp
@@ -120,8 +120,8 @@ proc test_set { args } {
 # range of values that are common to both (0-127).
 #    
 
-test_set "set variable v_char=0" "print v_char" ".\[0-9\]* = 0 \'.0\'"        "set variable char=0" 
-test_set "set variable v_char=1" "print v_char" ".\[0-9\]* = 1 \'.1\'"        "set variable char=1" 
+test_set "set variable v_char=0" "print v_char" ".\[0-9\]* = 0 \'.000\'"        "set variable char=0" 
+test_set "set variable v_char=1" "print v_char" ".\[0-9\]* = 1 \'.001\'"        "set variable char=1" 
 test_set "set variable v_char=7" "print v_char" ".\[0-9\]* = 7 \'.a\'"        "set variable char=7 (Bel)" 
 test_set "set variable v_char=32" "print v_char" ".\[0-9\]* = 32 \' \'"        "set variable char=32 (SPC)" 
 test_set "set variable v_char=65" "print v_char" ".\[0-9\]* = 65 \'A\'"        "set variable char=65 ('A')" 
@@ -131,8 +131,8 @@ test_set "set variable v_char=127" "print v_char" ".\[0-9\]* = 127 \'.177\'"
 #
 # test "set variable" for type "signed char"
 #    
-test_set "set variable v_char=0" "print v_signed_char" ".\[0-9\]* = 0 \'.0\'"                 "set variable signed char=0" 
-test_set "set variable v_signed_char=1" "print v_signed_char" ".\[0-9\]* = 1 \'.1\'"        "set variable signed char=1" 
+test_set "set variable v_char=0" "print v_signed_char" ".\[0-9\]* = 0 \'.000\'"                 "set variable signed char=0" 
+test_set "set variable v_signed_char=1" "print v_signed_char" ".\[0-9\]* = 1 \'.001\'"        "set variable signed char=1" 
 test_set "set variable v_signed_char=7" "print v_signed_char" ".\[0-9\]* = 7 \'.a\'"        "set variable signed char=7 (Bel)" 
 test_set "set variable v_signed_char=32" "print v_signed_char" ".\[0-9\]* = 32 \' \'"        "set variable signed char=32 (SPC)" 
 test_set "set variable v_signed_char=65" "print v_signed_char" ".\[0-9\]* = 65 \'A\'"        "set variable signed char=65 ('A')" 
@@ -150,8 +150,8 @@ gdb_test "print v_signed_char" ".\[0-9\]* = -1 \'.377\'" \
 #
 # test "set variable" for type "unsigned char"
 #
-test_set "set variable v_unsigned_char=0" "print v_unsigned_char" ".\[0-9\]* = 0 \'.0\'"        "set variable unsigned char=0" 
-test_set "set variable v_unsigned_char=1" "print v_unsigned_char" ".\[0-9\]* = 1 \'.1\'"        "set variable unsigned char=1" 
+test_set "set variable v_unsigned_char=0" "print v_unsigned_char" ".\[0-9\]* = 0 \'.000\'"        "set variable unsigned char=0" 
+test_set "set variable v_unsigned_char=1" "print v_unsigned_char" ".\[0-9\]* = 1 \'.001\'"        "set variable unsigned char=1" 
 test_set "set variable v_unsigned_char=7" "print v_unsigned_char" ".\[0-9\]* = 7 \'.a\'"        "set variable unsigned char=7 (Bel)" 
 test_set "set variable v_unsigned_char=32" "print v_unsigned_char" ".\[0-9\]* = 32 \' \'"        "set variable unsigned char=32 (SPC)" 
 test_set "set variable v_unsigned_char=65" "print v_unsigned_char" ".\[0-9\]* = 65 \'A\'"        "set variable unsigned char=65 ('A')" 
diff --git a/gdb/testsuite/gdb.base/store.exp b/gdb/testsuite/gdb.base/store.exp
index feab6bd..963bb19 100644
--- a/gdb/testsuite/gdb.base/store.exp
+++ b/gdb/testsuite/gdb.base/store.exp
@@ -74,7 +74,7 @@ proc check_set { t l r new add } {
 	"${prefix}; print incremented l, expecting ${add}"
 }
 
-check_set "charest" "-1 .*" "-2 .*" "4 ..4." "2 ..2."
+check_set "charest" "-1 .*" "-2 .*" "4 ..004." "2 ..002."
 check_set "short" "-1" "-2" "4" "2"
 check_set "int" "-1" "-2" "4" "2"
 check_set "long" "-1" "-2" "4" "2"
@@ -102,7 +102,7 @@ proc up_set { t l r new } {
 	"${prefix}; print new l, expecting ${new}"
 }
 
-up_set "charest" "-1 .*" "-2 .*" "4 ..4."
+up_set "charest" "-1 .*" "-2 .*" "4 ..004."
 up_set "short" "-1" "-2" "4"
 up_set "int" "-1" "-2" "4"
 up_set "long" "-1" "-2" "4"
diff --git a/gdb/testsuite/gdb.cp/ref-types.exp b/gdb/testsuite/gdb.cp/ref-types.exp
index b2e55cf..4784cb2 100644
--- a/gdb/testsuite/gdb.cp/ref-types.exp
+++ b/gdb/testsuite/gdb.cp/ref-types.exp
@@ -284,7 +284,7 @@ gdb_expect {
 
 send_gdb "print UC\n"
 gdb_expect {
-    -re ".\[0-9\]* = 21 '\.25'\.*$gdb_prompt $" {
+    -re ".\[0-9\]* = 21 '\.025'\.*$gdb_prompt $" {
         pass "print value of UC"
       }
     -re ".*$gdb_prompt $" { fail "print value of UC" }
@@ -557,7 +557,7 @@ gdb_expect {
 
 send_gdb "print rUC\n"
 gdb_expect {
-    -re ".\[0-9\]* = \\(unsigned char &\\) @$hex: 21 \'.25\'.*$gdb_prompt $" {
+    -re ".\[0-9\]* = \\(unsigned char &\\) @$hex: 21 \'.025\'.*$gdb_prompt $" {
         pass "print value of rUC"
       }
     -re ".*$gdb_prompt $" { fail "print value of rUC" }
diff --git a/gdb/testsuite/gdb.mi/mi-var-child.exp b/gdb/testsuite/gdb.mi/mi-var-child.exp
index 6299e3c..1f4bdc6 100644
--- a/gdb/testsuite/gdb.mi/mi-var-child.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-child.exp
@@ -801,7 +801,7 @@ mi_list_varobj_children {struct_declarations.long_array --all-values} {
 mi_list_varobj_children {struct_declarations --simple-values} \
     [list \
          {struct_declarations.integer integer 0 int 123} \
-         {struct_declarations.character character 0 char {0 '\\\\0'}} \
+         {struct_declarations.character character 0 char {0 '\\\\000'}} \
          [list struct_declarations.char_ptr char_ptr 1 "char \\*" "$hex \\\\\"hello\\\\\""] \
          {struct_declarations.long_int long_int 0 "long int" 0} \
          [list struct_declarations.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*" "$hex"] \
diff --git a/gdb/testsuite/gdb.mi/mi-var-display.exp b/gdb/testsuite/gdb.mi/mi-var-display.exp
index 59be6b2..4b02e50 100644
--- a/gdb/testsuite/gdb.mi/mi-var-display.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-display.exp
@@ -259,7 +259,7 @@ mi_gdb_test "-var-set-format weird.integer natural" \
 	"set format variable weird.integer"
 
 mi_gdb_test "-var-set-format weird.character natural" \
-	"\\^done,format=\"natural\",value=\"0 '\\\\\\\\0'\"" \
+	"\\^done,format=\"natural\",value=\"0 '\\\\\\\\000'\"" \
 	"set format variable weird.character"
 
 mi_gdb_test "-var-set-format weird.char_ptr natural" \
diff --git a/gdb/testsuite/gdb.mi/mi2-var-display.exp b/gdb/testsuite/gdb.mi/mi2-var-display.exp
index 9c98694..d6ce673 100644
--- a/gdb/testsuite/gdb.mi/mi2-var-display.exp
+++ b/gdb/testsuite/gdb.mi/mi2-var-display.exp
@@ -258,7 +258,7 @@ mi_gdb_test "-var-set-format weird.integer natural" \
 	"set format variable weird.integer"
 
 mi_gdb_test "-var-set-format weird.character natural" \
-	"\\^done,format=\"natural\",value=\"0 '\\\\\\\\0'\"" \
+	"\\^done,format=\"natural\",value=\"0 '\\\\\\\\000'\"" \
 	"set format variable weird.character"
 
 mi_gdb_test "-var-set-format weird.char_ptr natural" \


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-07-07 20:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-06 19:20 [ob] Correct ovldbreak.exp KFAILs Daniel Jacobowitz
2009-07-06 19:41 ` Mark Kettenis
2009-07-06 19:47   ` Daniel Jacobowitz
2009-07-07  1:54     ` Tom Tromey
2009-07-07 14:10       ` Tom Tromey
2009-07-07 15:00         ` Daniel Jacobowitz
2009-07-07 20:37           ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox