Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] Changes to signed char and unsigned char handling
@ 2007-07-05 13:54 Daniel Jacobowitz
  2007-07-06 10:33 ` Eli Zaretskii
  2007-08-25  1:18 ` Daniel Jacobowitz
  0 siblings, 2 replies; 13+ messages in thread
From: Daniel Jacobowitz @ 2007-07-05 13:54 UTC (permalink / raw)
  To: gdb-patches

This patch is a follow-up to Jan's patch to change the behavior of
"print" for uint8_t.  It follows option #3 from my earlier mail on
this subject:

 3.  Treat "char" as a character, but "unsigned char" and "signed char"
 as numbers (Jan's patch started down this road and Jim's went a bit
 further).  Treat pointers/arrays of char as strings and
 pointers/arrays of unsigned or signed char as numbers.  Add a "/s"
 flag to the print command that treats single byte types as
 characters or strings.

 (From: http://sourceware.org/ml/gdb/2007-04/msg00057.html )

I started with one of Jim's patches from that thread, which makes our
handling of single character variables consistent with our handling
for strings by adding a single function which decides whether a type
is "textual".  Char is textual; unsigned char and signed char are not.
So an array of unsigned char now prints like this:

(gdb) p ctable1
$3 = {0, 1, 2, 3, 4...}

Then I added a way to override the decision.  You could already by
using a cast:

(gdb) p (*(char *) ctable1)@256
$8 = "\000\001\002\003\004"...

But sometimes having the format letter is more convenient:

(gdb) p/s ctable1
$4 = "\000\001\002\003\004"...

The /s format converts anything that it readily can to a string.  All
other values are left as their natural type.  This makes "p/s
struct_var" behave sensibly.

I did not add any wide character support, but while doing this I
definitely kept the possibility in mind.  It should be relatively
straightforward now; we could even add x/hs and x/ws for 16-bit and
32-bit wchar_t.  Unfortunately wchar_t is not definitively identified
in debug output, so we might have to rely on language hints or type
names.  I'd rather offer someone else advice on how to do this than
do it myself, since I know next to nothing about character encoding
and wide character usage.

Then I updated NEWS, the manual, and the testsuite to match.  What do
you think - is this an appropriate resolution for GDB 6.7?  All
comments welcome.

-- 
Daniel Jacobowitz
CodeSourcery

2007-07-05  Daniel Jacobowitz  <dan@codesourcery.com>
	    Jim Blandy  <jimb@codesourcery.com>

	* NEWS: Update description of string changes.  Mention print/s.
	* c-valprint.c (textual_element_type): New.
	(c_val_print): Use it.  Do not skip address printing for pointers
	with a string format.
	(c_value_print): Doc update.
	* gdbtypes.c (gdbtypes_post_init): Initialize
	builtin_true_unsigned_char.
	* gdbtypes.h (struct builtin_type): Add builtin_true_unsigned_char.
	* printcmd.c (print_formatted): Only handle 's' and 'i' for examine.
	Call the language print routine for string format.
	(print_scalar_formatted): Call val_print for string format.  Handle
	unsigned original types for char format.
	(validate_format): Do not reject string format.

	* gdb.texinfo (Output Formats): Update 'c' description.  Describe 's'.
	(Examining Memory): Update mentions of the 's' format.
	(Automatic Display): Likewise.

	* gdb.base/bitfields.exp, gdb.base/call-rt-st.exp,
	gdb.base/charsign.exp, gdb.base/constvars.exp,
	gdb.base/display.exp, gdb.base/funcargs.exp, gdb.base/pointers.exp,
	gdb.base/printcmds.exp, gdb.base/setvar.exp, gdb.base/store.exp,
	gdb.cp/ctti.exp, gdb.cp/gdb1355.exp, gdb.cp/ovldbreak.exp,
	gdb.cp/ref-types.exp: Update tests to not expect character constants
	for signed char or unsigned char without an explicit output format.

Index: NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.234
diff -u -p -r1.234 NEWS
--- NEWS	3 Jul 2007 12:14:43 -0000	1.234
+++ NEWS	5 Jul 2007 13:27:39 -0000
@@ -23,8 +23,14 @@ frequency signals (e.g. SIGALRM) via the
 target's overall architecture.  GDB can read a description from
 a local file or over the remote serial protocol.
 
-* Arrays of explicitly SIGNED or UNSIGNED CHARs are now printed as arrays
-of numbers.
+* Arrays of explicitly signed or unsigned char are now printed as
+arrays of numbers.  Pointers to signed or unsigned char are no
+longer printed as strings.  Single signed and unsigned char values
+are no longer printed as character constants.
+
+* The /s format now works with the print command.  It displays
+arrays of single-byte integers and pointers to single-byte integers
+as strings.
 
 * Target descriptions can now describe target-specific registers,
 for architectures which have implemented the support (currently
Index: c-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/c-valprint.c,v
retrieving revision 1.43
diff -u -p -r1.43 c-valprint.c
--- c-valprint.c	18 May 2007 19:42:42 -0000	1.43
+++ c-valprint.c	5 Jul 2007 13:27:39 -0000
@@ -56,6 +56,57 @@ print_function_pointer_address (CORE_ADD
 }
 
 
+/* Apply a heuristic to decide whether an array of TYPE or a pointer
+   to TYPE should be printed as a textual string.  Return non-zero if
+   it should, or zero if it should be treated as an array of integers
+   or pointer to integers.  FORMAT is the current format letter,
+   or 0 if none.
+
+   We guess that "char" is a character, and explicitly signed or
+   unsigned character types are numbers.  The user can override this
+   by using the /s format letter.  */
+
+static int
+textual_element_type (struct type *type, char format)
+{
+  /* GDB doesn't use TYPE_CODE_CHAR for the C 'char' types; instead,
+     it uses one-byte TYPE_CODE_INT types, with TYPE_NAMEs like
+     "char", "unsigned char", etc. and appropriate flags.  For various
+     reasons, this works out well in some places.  */
+
+  struct type *true_type = check_typedef (type);
+
+  if (format != 0 && format != 's')
+    return 0;
+
+  /* TYPE_CODE_CHAR is always textual.  But I don't think it ever
+     occurs in C code.  */
+  if (TYPE_CODE (true_type) == TYPE_CODE_CHAR)
+    return 1;
+
+  if (format == 's')
+    {
+      /* Print this as a string if we can manage it.  For now, no
+	 wide character support.  */
+      if (TYPE_CODE (true_type) == TYPE_CODE_INT
+	  && TYPE_LENGTH (true_type) == 1)
+	return 1;
+    }
+  else
+    {
+      /* If a one-byte TYPE_CODE_INT has no explicit sign, then we
+	 treat it as text; otherwise, we assume it's being used as
+	 data.  */
+      if (TYPE_CODE (true_type) == TYPE_CODE_INT
+	  && TYPE_LENGTH (true_type) == 1
+	  && TYPE_NOSIGN (true_type))
+	return 1;
+    }
+
+  return 0;
+}
+
+
 /* Print data of type TYPE located at VALADDR (within GDB), which came from
    the inferior at address ADDRESS, onto stdio stream STREAM according to
    FORMAT (a letter or 0 for natural format).  The data at VALADDR is in
@@ -94,12 +145,9 @@ c_val_print (struct type *type, const gd
 	    {
 	      print_spaces_filtered (2 + 2 * recurse, stream);
 	    }
-	  /* For an array of chars, print with string syntax.  */
-	  if (eltlen == 1 &&
-	      ((TYPE_CODE (elttype) == TYPE_CODE_INT && TYPE_NOSIGN (elttype))
-	       || ((current_language->la_language == language_m2)
-		   && (TYPE_CODE (elttype) == TYPE_CODE_CHAR)))
-	      && (format == 0 || format == 's'))
+
+	  /* Print arrays of textual chars with a string syntax.  */
+          if (textual_element_type (elttype, format))
 	    {
 	      /* If requested, look for the first null char and only print
 	         elements up to it.  */
@@ -186,19 +234,16 @@ c_val_print (struct type *type, const gd
 	      return (0);
 	    }
 
-	  if (addressprint && format != 's')
+	  if (addressprint)
 	    {
 	      deprecated_print_address_numeric (addr, 1, stream);
 	    }
 
-	  /* For a pointer to char or unsigned char, also print the string
+	  /* For a pointer to a textual type, also print the string
 	     pointed to, unless pointer is null.  */
 	  /* FIXME: need to handle wchar_t here... */
 
-	  if (TYPE_LENGTH (elttype) == 1
-	      && TYPE_CODE (elttype) == TYPE_CODE_INT
-	      && (format == 0 || format == 's')
-	      && addr != 0)
+	  if (textual_element_type (elttype, format) && addr != 0)
 	    {
 	      i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream);
 	    }
@@ -397,8 +442,8 @@ c_val_print (struct type *type, const gd
 	  /* C and C++ has no single byte int type, char is used instead.
 	     Since we don't know whether the value is really intended to
 	     be used as an integer or a character, print the character
-	     equivalent as well. */
-	  if (TYPE_LENGTH (type) == 1)
+	     equivalent as well.  */
+	  if (textual_element_type (type, format))
 	    {
 	      fputs_filtered (" ", stream);
 	      LA_PRINT_CHAR ((unsigned char) unpack_long (type, valaddr + embedded_offset),
@@ -500,7 +545,9 @@ c_value_print (struct value *val, struct
       || TYPE_CODE (type) == TYPE_CODE_REF)
     {
       /* Hack:  remove (char *) for char strings.  Their
-         type is indicated by the quoted string anyway. */
+         type is indicated by the quoted string anyway.
+         (Don't use textual_element_type here; quoted strings
+         are always exactly (char *).  */
       if (TYPE_CODE (type) == TYPE_CODE_PTR
 	  && TYPE_NAME (type) == NULL
 	  && TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL
Index: gdbtypes.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.c,v
retrieving revision 1.127
diff -u -p -r1.127 gdbtypes.c
--- gdbtypes.c	22 Jun 2007 12:32:19 -0000	1.127
+++ gdbtypes.c	5 Jul 2007 13:27:40 -0000
@@ -3319,6 +3319,10 @@ gdbtypes_post_init (struct gdbarch *gdba
     init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
 	       0,
 	       "true character", (struct objfile *) NULL);
+  builtin_type->builtin_true_unsigned_char =
+    init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+	       TYPE_FLAG_UNSIGNED,
+	       "true character", (struct objfile *) NULL);
   builtin_type->builtin_signed_char =
     init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
 	       0,
Index: gdbtypes.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.h,v
retrieving revision 1.75
diff -u -p -r1.75 gdbtypes.h
--- gdbtypes.h	22 Jun 2007 12:32:19 -0000	1.75
+++ gdbtypes.h	5 Jul 2007 13:27:40 -0000
@@ -1011,10 +1011,11 @@ struct builtin_type
 
   /* Integral types.  */
 
-  /* We use this for the '/c' print format, because c_char is just a
+  /* We use these for the '/c' print format, because c_char is just a
      one-byte integral type, which languages less laid back than C
      will print as ... well, a one-byte integral type.  */
   struct type *builtin_true_char;
+  struct type *builtin_true_unsigned_char;
 
   /* Implicit size/sign (based on the the architecture's ABI).  */
   struct type *builtin_void;
Index: printcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/printcmd.c,v
retrieving revision 1.107
diff -u -p -r1.107 printcmd.c
--- printcmd.c	21 Jun 2007 15:26:04 -0000	1.107
+++ printcmd.c	5 Jul 2007 13:27:40 -0000
@@ -252,7 +252,8 @@ decode_format (char **string_ptr, int of
    Do not end with a newline.
    0 means print VAL according to its own type.
    SIZE is the letter for the size of datum being printed.
-   This is used to pad hex numbers so they line up.  */
+   This is used to pad hex numbers so they line up.  SIZE is 0
+   for print / output and set for examine.  */
 
 static void
 print_formatted (struct value *val, int format, int size,
@@ -264,45 +265,41 @@ print_formatted (struct value *val, int 
   if (VALUE_LVAL (val) == lval_memory)
     next_address = VALUE_ADDRESS (val) + len;
 
-  switch (format)
+  if (size)
     {
-    case 's':
-      /* FIXME: Need to handle wchar_t's here... */
-      next_address = VALUE_ADDRESS (val)
-	+ val_print_string (VALUE_ADDRESS (val), -1, 1, stream);
-      break;
-
-    case 'i':
-      /* The old comment says
-         "Force output out, print_insn not using _filtered".
-         I'm not completely sure what that means, I suspect most print_insn
-         now do use _filtered, so I guess it's obsolete.
-         --Yes, it does filter now, and so this is obsolete.  -JB  */
-
-      /* We often wrap here if there are long symbolic names.  */
-      wrap_here ("    ");
-      next_address = (VALUE_ADDRESS (val)
-		      + gdb_print_insn (VALUE_ADDRESS (val), stream,
-					&branch_delay_insns));
-      break;
+      switch (format)
+	{
+	case 's':
+	  /* FIXME: Need to handle wchar_t's here... */
+	  next_address = VALUE_ADDRESS (val)
+	    + val_print_string (VALUE_ADDRESS (val), -1, 1, stream);
+	  return;
 
-    default:
-      if (format == 0
-	  || TYPE_CODE (type) == TYPE_CODE_ARRAY
-	  || TYPE_CODE (type) == TYPE_CODE_STRING
-	  || TYPE_CODE (type) == TYPE_CODE_STRUCT
-	  || TYPE_CODE (type) == TYPE_CODE_UNION
-	  || TYPE_CODE (type) == TYPE_CODE_NAMESPACE)
-	/* If format is 0, use the 'natural' format for that type of
-	   value.  If the type is non-scalar, we have to use language
-	   rules to print it as a series of scalars.  */
-	value_print (val, stream, format, Val_pretty_default);
-      else
-	/* User specified format, so don't look to the the type to
-	   tell us what to do.  */
-	print_scalar_formatted (value_contents (val), type,
-				format, size, stream);
+	case 'i':
+	  /* We often wrap here if there are long symbolic names.  */
+	  wrap_here ("    ");
+	  next_address = (VALUE_ADDRESS (val)
+			  + gdb_print_insn (VALUE_ADDRESS (val), stream,
+					    &branch_delay_insns));
+	  return;
+	}
     }
+
+  if (format == 0 || format == 's'
+      || TYPE_CODE (type) == TYPE_CODE_ARRAY
+      || TYPE_CODE (type) == TYPE_CODE_STRING
+      || TYPE_CODE (type) == TYPE_CODE_STRUCT
+      || TYPE_CODE (type) == TYPE_CODE_UNION
+      || TYPE_CODE (type) == TYPE_CODE_NAMESPACE)
+    /* If format is 0, use the 'natural' format for that type of
+       value.  If the type is non-scalar, we have to use language
+       rules to print it as a series of scalars.  */
+    value_print (val, stream, format, Val_pretty_default);
+  else
+    /* User specified format, so don't look to the the type to
+       tell us what to do.  */
+    print_scalar_formatted (value_contents (val), type,
+			    format, size, stream);
 }
 
 /* Print a scalar of data of type TYPE, pointed to in GDB by VALADDR,
@@ -319,6 +316,15 @@ print_scalar_formatted (const void *vala
   LONGEST val_long = 0;
   unsigned int len = TYPE_LENGTH (type);
 
+  /* If we get here with a string format, try again without it.  Go
+     all the way back to the language printers, which may call us
+     again.  */
+  if (format == 's')
+    {
+      val_print (type, valaddr, 0, 0, stream, 0, 0, 0, Val_pretty_default);
+      return;
+    }
+
   if (len > sizeof(LONGEST) &&
       (TYPE_CODE (type) == TYPE_CODE_INT
        || TYPE_CODE (type) == TYPE_CODE_ENUM))
@@ -409,8 +415,17 @@ print_scalar_formatted (const void *vala
       break;
 
     case 'c':
-      value_print (value_from_longest (builtin_type_true_char, val_long),
-		   stream, 0, Val_pretty_default);
+      if (TYPE_UNSIGNED (type))
+	{
+	  struct type *utype;
+
+	  utype = builtin_type (current_gdbarch)->builtin_true_unsigned_char;
+	  value_print (value_from_longest (utype, val_long),
+		       stream, 0, Val_pretty_default);
+	}
+      else
+	value_print (value_from_longest (builtin_type_true_char, val_long),
+		     stream, 0, Val_pretty_default);
       break;
 
     case 'f':
@@ -823,7 +838,7 @@ validate_format (struct format_data fmt,
   if (fmt.count != 1)
     error (_("Item count other than 1 is meaningless in \"%s\" command."),
 	   cmdname);
-  if (fmt.format == 'i' || fmt.format == 's')
+  if (fmt.format == 'i')
     error (_("Format letter \"%c\" is meaningless in \"%s\" command."),
 	   fmt.format, cmdname);
 }
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.420
diff -u -p -r1.420 gdb.texinfo
--- doc/gdb.texinfo	3 Jul 2007 12:21:22 -0000	1.420
+++ doc/gdb.texinfo	5 Jul 2007 13:27:42 -0000
@@ -5761,9 +5761,24 @@ prints both the numerical value and its 
 character representation is replaced with the octal escape @samp{\nnn}
 for characters outside the 7-bit @sc{ascii} range.
 
+Without this format, @value{GDBN} displays @code{char} data as character
+constants.  @code{unsigned char} and @code{signed char} are displayed as
+single-byte integer data.
+
 @item f
 Regard the bits of the value as a floating point number and print
 using typical floating point syntax.
+
+@item s
+@cindex printing strings
+Regard as a string, if possible.  With this format, pointers to single-byte
+data are displayed as null-terminated strings and arrays of single-byte data
+are displayed as fixed-length strings.  Other values are displayed in their
+natural types.
+
+Without this format, @value{GDBN} displays pointers to and arrays of @code{char}
+as strings.  @code{unsigned char} and @code{signed char} are displayed as
+single-byte integer data.
 @end table
 
 For example, to print the program counter in hex (@pxref{Registers}), type
@@ -5811,10 +5826,9 @@ how much memory (counting by units @var{
 @item @var{f}, the display format
 The display format is one of the formats used by @code{print}
 (@samp{x}, @samp{d}, @samp{u}, @samp{o}, @samp{t}, @samp{a}, @samp{c},
-@samp{f}), and in addition @samp{s} (for null-terminated strings) and
-@samp{i} (for machine instructions).  The default is @samp{x}
-(hexadecimal) initially.  The default changes each time you use either
-@code{x} or @code{print}.
+@samp{f}, @samp{s}), and in addition @samp{i} (for machine instructions).
+The default is @samp{x} (hexadecimal) initially.  The default changes
+each time you use either @code{x} or @code{print}.
 
 @item @var{u}, the unit size
 The unit size is any of
@@ -5932,8 +5946,7 @@ displays you request manually using @cod
 specify the output format you prefer; in fact, @code{display} decides
 whether to use @code{print} or @code{x} depending on how elaborate your
 format specification is---it uses @code{x} if you specify a unit size,
-or one of the two formats (@samp{i} and @samp{s}) that are only
-supported by @code{x}; otherwise it uses @code{print}.
+the @samp{i} format, or the @samp{s} format; otherwise it uses @code{print}.
 
 @table @code
 @kindex display
Index: testsuite/gdb.base/bitfields.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/bitfields.exp,v
retrieving revision 1.4
diff -u -p -r1.4 bitfields.exp
--- testsuite/gdb.base/bitfields.exp	9 Jan 2007 17:59:09 -0000	1.4
+++ testsuite/gdb.base/bitfields.exp	5 Jul 2007 13:27:42 -0000
@@ -50,7 +50,7 @@ proc bitfield_uniqueness {} {
 	gdb_suppress_tests;
     }
 	
-    if [gdb_test "print flags" ".*uc = 1 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*"] {
+    if [gdb_test "print flags" ".*uc = 1, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*"] {
 	gdb_suppress_tests;
     }
     if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #1"] {
@@ -60,55 +60,55 @@ proc bitfield_uniqueness {} {
     # treat it correctly as a signed 1bit field (values 0 or -1) while
     # printing its value does not cause a spurious failure.  We do the
     # signedness preservation test later.
-    if [gdb_test "print flags" ".*uc = 0 .*, s1 = (1|-1), u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s1)"] {
+    if [gdb_test "print flags" ".*uc = 0, s1 = (1|-1), u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s1)"] {
 	gdb_suppress_tests;
     }
     if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #2"] {
 	gdb_suppress_tests;
     }
-    if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 1, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u1)"] {
+    if [gdb_test "print flags" ".*uc = 0, s1 = 0, u1 = 1, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u1)"] {
 	gdb_suppress_tests;
     }
     if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #3"] {
 	gdb_suppress_tests;
     }
-    if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 1, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s2)"] {
+    if [gdb_test "print flags" ".*uc = 0, s1 = 0, u1 = 0, s2 = 1, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s2)"] {
 	gdb_suppress_tests;
     }
     if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #4"] {
 	gdb_suppress_tests;
     }
-    if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 1, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u2)"] {
+    if [gdb_test "print flags" ".*uc = 0, s1 = 0, u1 = 0, s2 = 0, u2 = 1, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u2)"] {
 	gdb_suppress_tests;
     }
     if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #5"] {
 	gdb_suppress_tests;
     }
-    if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 1, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s3)"] {
+    if [gdb_test "print flags" ".*uc = 0, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 1, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s3)"] {
 	gdb_suppress_tests;
     }
     if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #6"] {
 	gdb_suppress_tests;
     }
-    if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 1, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u3)"] {
+    if [gdb_test "print flags" ".*uc = 0, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 1, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u3)"] {
 	gdb_suppress_tests
     }
     if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #7"] {
 	gdb_suppress_tests
     }
-    if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 1, u9 = 0, sc = 0.*" "bitfield uniqueness (s9)"] {
+    if [gdb_test "print flags" ".*uc = 0, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 1, u9 = 0, sc = 0.*" "bitfield uniqueness (s9)"] {
 	gdb_suppress_tests
     }
     if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #8"] {
 	gdb_suppress_tests
     }
-    if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 1, sc = 0.*" "bitfield uniqueness (u9)"] {
+    if [gdb_test "print flags" ".*uc = 0, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 1, sc = 0.*" "bitfield uniqueness (u9)"] {
 	gdb_suppress_tests
     }
     if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #9"] {
 	gdb_suppress_tests
     }
-    if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 1.*" "bitfield uniqueness (sc)"] {
+    if [gdb_test "print flags" ".*uc = 0, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 1.*" "bitfield uniqueness (sc)"] {
 	gdb_suppress_tests
     }
     # Hmmmm?
@@ -167,7 +167,7 @@ proc bitfield_unsignedness {} {
 	gdb_suppress_tests
     }
 
-    if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 1, s2 = 0, u2 = 3, s3 = 0, u3 = 7, s9 = 0, u9 = 511, sc = 0.*" "unsigned bitfield ranges"] {
+    if [gdb_test "print flags" ".*uc = 0, s1 = 0, u1 = 1, s2 = 0, u2 = 3, s3 = 0, u3 = 7, s9 = 0, u9 = 511, sc = 0.*" "unsigned bitfield ranges"] {
 	gdb_suppress_tests
     }
     gdb_stop_suppressing_tests;
@@ -192,7 +192,7 @@ proc bitfield_signedness {} {
 	gdb_suppress_tests
     }
 
-    if [gdb_test "print flags" "= {uc = 0 .*, s1 = 0, u1 = 0, s2 = 1, u2 = 0, s3 = 3, u3 = 0, s9 = 255, u9 = 0, sc = 0 .*}" "signed bitfields, max positive values"] {
+    if [gdb_test "print flags" "= {uc = 0, s1 = 0, u1 = 0, s2 = 1, u2 = 0, s3 = 3, u3 = 0, s9 = 255, u9 = 0, sc = 0}" "signed bitfields, max positive values"] {
 	gdb_suppress_tests
     }
 
@@ -221,7 +221,7 @@ proc bitfield_signedness {} {
 	}
     }
 
-    if [gdb_test "print flags" ".*uc = 0 .*, s1 = -1, u1 = 0, s2 = -2, u2 = 0, s3 = -4, u3 = 0, s9 = -256, u9 = 0, sc = 0.*" "signed bitfields, max negative values"] {
+    if [gdb_test "print flags" ".*uc = 0, s1 = -1, u1 = 0, s2 = -2, u2 = 0, s3 = -4, u3 = 0, s9 = -256, u9 = 0, sc = 0.*" "signed bitfields, max negative values"] {
         gdb_suppress_tests
     }
 
@@ -229,7 +229,7 @@ proc bitfield_signedness {} {
 	gdb_suppress_tests
     }
 
-    if [gdb_test "print flags" ".*uc = 0 .*, s1 = -1, u1 = 0, s2 = -1, u2 = 0, s3 = -1, u3 = 0, s9 = -1, u9 = 0, sc = 0.*" "signed bitfields with -1"] {
+    if [gdb_test "print flags" ".*uc = 0, s1 = -1, u1 = 0, s2 = -1, u2 = 0, s3 = -1, u3 = 0, s9 = -1, u9 = 0, sc = 0.*" "signed bitfields with -1"] {
 	gdb_suppress_tests
     }
     # Hmmmm???
Index: testsuite/gdb.base/call-rt-st.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/call-rt-st.exp,v
retrieving revision 1.19
diff -u -p -r1.19 call-rt-st.exp
--- testsuite/gdb.base/call-rt-st.exp	9 Jan 2007 17:59:09 -0000	1.19
+++ testsuite/gdb.base/call-rt-st.exp	5 Jul 2007 13:27:42 -0000
@@ -190,7 +190,7 @@ if {![gdb_skip_float_test "print print_t
 
 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 '\\\\001', beta = 0 '\\\\0', gamma = 1 '\\\\001', delta = 0 '\\\\0', epsilon = 1 '\\\\001', omega = 0 '\\\\0'\\}"
+            ".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+.\[0-9\]+ = \\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\\}"
 }
 
 if ![gdb_skip_stdio_test "print print_bit_flags_short(*sflags)"] {
Index: testsuite/gdb.base/charsign.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/charsign.exp,v
retrieving revision 1.2
diff -u -p -r1.2 charsign.exp
--- testsuite/gdb.base/charsign.exp	27 Mar 2007 17:59:37 -0000	1.2
+++ testsuite/gdb.base/charsign.exp	5 Jul 2007 13:27:42 -0000
@@ -47,15 +47,22 @@ proc do_test { cflags } {
     gdb_test "p n" \
 	     "= \"A\""
     gdb_test "p s" \
-	     "= \\{65 'A', 0 '\\\\0'\\}"
+	     "= \\{65, 0\\}"
     gdb_test "p u" \
-	     "= \\{65 'A', 0 '\\\\0'\\}"
+	     "= \\{65, 0\\}"
     gdb_test "p n_typed" \
 	     "= \"A\""
     gdb_test "p s_typed" \
-	     "= \\{65 'A', 0 '\\\\0'\\}"
+	     "= \\{65, 0\\}"
     gdb_test "p u_typed" \
-	     "= \\{65 'A', 0 '\\\\0'\\}"
+	     "= \\{65, 0\\}"
+
+    gdb_test "p/d n_typed" \
+	     "= \\{65, 0\\}"
+    gdb_test "p/s s_typed" \
+	     "= \"A\""
+    gdb_test "p/s u_typed" \
+	     "= \"A\""
 }
 
 # The string identification works despite the compiler flags below due to
Index: testsuite/gdb.base/constvars.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/constvars.exp,v
retrieving revision 1.15
diff -u -p -r1.15 constvars.exp
--- testsuite/gdb.base/constvars.exp	9 Jan 2007 17:59:09 -0000	1.15
+++ testsuite/gdb.base/constvars.exp	5 Jul 2007 13:27:42 -0000
@@ -145,7 +145,7 @@ gdb_expect {
 proc do_constvar_tests {} {
     gdb_test "print lave" " = 66 'B'"
     gdb_test "ptype lave" "type = char"
-    gdb_test "print lavish" " = 10 '\\\\n'"
+    gdb_test "print lavish" " = 10"
     gdb_test "ptype lavish" "type = unsigned char"
     gdb_test "print lax" " = 20"
     gdb_test "ptype lax" "type = short.*"
@@ -162,7 +162,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 '.001'"
+    gdb_test "print laggard" " = 1"
     local_compiler_xfail_check
     gdb_test "ptype laggard" "type = const unsigned char"
     gdb_test "print lagoon" " = 2"
@@ -186,7 +186,7 @@ proc do_constvar_tests {} {
     gdb_test "print *legend" " = 66 'B'"
     local_compiler_xfail_check
     gdb_test "ptype legend" "type = const char \\*"
-    gdb_test "print *legerdemain" " = 10 '\\\\n'"
+    gdb_test "print *legerdemain" " = 10"
     local_compiler_xfail_check
     gdb_test "ptype legerdemain" "type = const unsigned char \\*"
     gdb_test "print *leniency" " = 20"
@@ -210,7 +210,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 '.001'"
+    gdb_test "print *lexicographer" " = 1"
     local_compiler_xfail_check
     gdb_test "ptype lexicographer" "type = const unsigned char \\* const"
     gdb_test "print *lexicon" " = 2"
@@ -234,7 +234,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 '.001'"
+    gdb_test "print *languor" " = 1"
     local_compiler_xfail_check
     gdb_test "ptype languor" "type = const unsigned char \\*"
     gdb_test "print *lank" " = 2"
@@ -259,7 +259,7 @@ proc do_constvar_tests {} {
     gdb_test "print *lamprey" " = 66 'B'"
     local_compiler_xfail_check
     gdb_test "ptype lamprey" "type = char \\* const"
-    gdb_test "print *lariat" " = 10 '\\\\n'"
+    gdb_test "print *lariat" " = 10"
     local_compiler_xfail_check
     gdb_test "ptype lariat" "type = unsigned char \\* const"
     gdb_test "print *laudanum" " = 20"
Index: testsuite/gdb.base/display.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/display.exp,v
retrieving revision 1.10
diff -u -p -r1.10 display.exp
--- testsuite/gdb.base/display.exp	21 Jun 2007 15:26:05 -0000	1.10
+++ testsuite/gdb.base/display.exp	5 Jul 2007 13:27:42 -0000
@@ -196,7 +196,7 @@ if [istarget "hppa*-hp-hpux*"] {
     gdb_test "x/rx j" ".*(Cannot access|Error accessing) memory.*|.*0xa:\[ \t\]*\[0-9\]+.*"
 }
 gdb_test "print/0 j" ".*Item count other than 1 is meaningless.*" "print/0 j"
-gdb_test "print/s sum" ".*Format letter.*is meaningless.*" " no s"
+gdb_test "print/s sum" " = 1000" "ignored s"
 gdb_test "print/i sum" ".*Format letter.*is meaningless.*.*" "no i"
 gdb_test "print/a &sum" ".*= $hex.*<sum>.*"
 # If the constant below is larger than the length of main, then
Index: testsuite/gdb.base/funcargs.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/funcargs.exp,v
retrieving revision 1.10
diff -u -p -r1.10 funcargs.exp
--- testsuite/gdb.base/funcargs.exp	9 Jan 2007 17:59:11 -0000	1.10
+++ testsuite/gdb.base/funcargs.exp	5 Jul 2007 13:27:43 -0000
@@ -119,7 +119,7 @@ proc unsigned_integral_args {} {
     if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
     gdb_run_cmd
     gdb_expect {
-	 -re ".* call1a \\(uc=98 'b', us=6, ui=7, ul=8\\) .*$gdb_prompt $" {
+	 -re ".* call1a \\(uc=98, us=6, ui=7, ul=8\\) .*$gdb_prompt $" {
 	    pass "run to call1a"
 	}
 	 -re "$gdb_prompt $" { fail "run to call1a" ; gdb_suppress_tests; }
@@ -128,28 +128,28 @@ proc unsigned_integral_args {} {
 
     # Print each arg as a double check to see if we can print
     # them here as well as with backtrace.
-    gdb_test "print uc" ".* = 98 'b'"
+    gdb_test "print uc" ".* = 98"
     gdb_test "print us" ".* = 6"
     gdb_test "print ui" ".* = 7"
     gdb_test "print ul" ".* = 8"
     
     # Continue; should stop at call1b and print actual arguments.
-    if [gdb_test "cont" ".* call1b \\(us=6, ui=7, ul=8, uc=98 'b'\\) .*" "continue to call1b"] {
+    if [gdb_test "cont" ".* call1b \\(us=6, ui=7, ul=8, uc=98\\) .*" "continue to call1b"] {
 	gdb_suppress_tests; 
     }
 
     # Continue; should stop at call1c and print actual arguments.
-    if [gdb_test "cont" ".* call1c \\(ui=7, ul=8, uc=98 'b', us=6\\) .*" "continue to call1c"] {
+    if [gdb_test "cont" ".* call1c \\(ui=7, ul=8, uc=98, us=6\\) .*" "continue to call1c"] {
 	gdb_suppress_tests; 
     }
 
     # Continue; should stop at call1d and print actual arguments.
-    if [gdb_test "cont" ".* call1d \\(ul=8, uc=98 'b', us=6, ui=7\\) .*" "continue to call1d"] {
+    if [gdb_test "cont" ".* call1d \\(ul=8, uc=98, us=6, ui=7\\) .*" "continue to call1d"] {
 	gdb_suppress_tests;
     }
 
     # Continue; should stop at call1e and print actual arguments.
-    if [gdb_test "cont" ".* call1e \\(uc1=98 'b', ul=8, uc2=98 'b', ui=7, uc3=98 'b', us=6, uc4=98 'b', uc5=98 'b'\\) .*" "continue to call1e"] {
+    if [gdb_test "cont" ".* call1e \\(uc1=98, ul=8, uc2=98, ui=7, uc3=98, us=6, uc4=98, uc5=98\\) .*" "continue to call1e"] {
 	gdb_suppress_tests;
     }
     gdb_stop_suppressing_tests;
@@ -277,11 +277,11 @@ proc pointer_args {} {
 
     # Continue; should stop at call3b and print actual arguments.
     # Try dereferencing the arguments.
-    if [gdb_test "cont" ".* call3b \\(ucp=$hex \"b.*\", usp=$hex, uip=$hex, ulp=$hex\\) .*" "continue to call3b"] {
+    if [gdb_test "cont" ".* call3b \\(ucp=$hex, usp=$hex, uip=$hex, ulp=$hex\\) .*" "continue to call3b"] {
 	gdb_suppress_tests;
     }
 
-    gdb_test "print *ucp" ".* = 98 'b'"
+    gdb_test "print *ucp" ".* = 98"
     gdb_test "print *usp" ".* = 6"
     gdb_test "print *uip" ".* = 7"
     gdb_test "print *ulp" ".* = 8"
@@ -464,13 +464,13 @@ proc discard_and_shuffle {} {
     send_gdb "backtrace 100\n"
     gdb_expect {
 	-re "backtrace 100\[\r\n\]+
-.* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
+.* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) .*\r
 .* main \\(.*\\) .*\r
 $gdb_prompt $" {
 	    pass "backtrace from call6a"
 	}
 	-re "backtrace 100\[\r\n\]+
-.* call6a \\(c=97 'a', s=1, i=2, l=3, f=.*, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
+.* call6a \\(c=97 'a', s=1, i=2, l=3, f=.*, d=5, uc=98, us=6, ui=7, ul=8\\) .*\r
 .* main \\(.*\\) .*\r
 $gdb_prompt $" {
 	    xfail "backtrace from call6a"
@@ -492,8 +492,8 @@ $gdb_prompt $" {
 
     send_gdb "backtrace 100\n"
     if [gdb_expect_list "backtrace from call6b" ".*$gdb_prompt $" {
-	".*\[\r\n\]#0 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#1 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#0 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#1 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
 	".*\[\r\n\]#2 .* main \\(.*\\) " 
     } ] {
 	gdb_suppress_tests;
@@ -506,9 +506,9 @@ $gdb_prompt $" {
 
     send_gdb "backtrace 100\n"
     if [gdb_expect_list "backtrace from call6c" ".*$gdb_prompt $" {
-	".*\[\r\n\]#0 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#1 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#2 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#0 .* call6c \\(i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#1 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#2 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
 	".*\[\r\n\]#3 .* main \\(.*\\) "
     } ] {
 	gdb_suppress_tests;
@@ -520,10 +520,10 @@ $gdb_prompt $" {
 
     send_gdb "backtrace 100\n"
     if [gdb_expect_list "backtrace from call6d" ".*$gdb_prompt $" {
-	".*\[\r\n\]#0 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#1 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#2 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#3 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#0 .* call6d \\(l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#1 .* call6c \\(i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#2 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#3 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
 	".*\[\r\n\]#4 .* main \\(.*\\) "
     } ] {
 	gdb_suppress_tests;
@@ -536,11 +536,11 @@ $gdb_prompt $" {
 
     send_gdb "backtrace 100\n"
     if [gdb_expect_list "backtrace from call6e" ".*$gdb_prompt $" {
-	".*\[\r\n\]#0 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#1 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#2 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#3 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#4 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#0 .* call6e \\(f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#1 .* call6d \\(l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#2 .* call6c \\(i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#3 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#4 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
 	".*\[\r\n\]#5 .* main \\(.*\\) "
     } ] {
 	gdb_suppress_tests;
@@ -553,12 +553,12 @@ $gdb_prompt $" {
 
     send_gdb "backtrace 100\n"
     if [gdb_expect_list "backtrace from call6f" ".*$gdb_prompt $" {
-	".*\[\r\n\]#0 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#1 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#2 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#3 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#4 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#5 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#0 .* call6f \\(d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#1 .* call6e \\(f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#2 .* call6d \\(l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#3 .* call6c \\(i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#4 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#5 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
 	".*\[\r\n\]#6 .* main \\(.*\\) "
     } ] {
 	gdb_suppress_tests;
@@ -571,13 +571,13 @@ $gdb_prompt $" {
 
     send_gdb "backtrace 100\n"
     if [gdb_expect_list "backtrace from call6g" ".*$gdb_prompt $" {
-	".*\[\r\n\]#0 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#1 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#2 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#3 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#4 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#5 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#6 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#0 .* call6g \\(uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#1 .* call6f \\(d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#2 .* call6e \\(f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#3 .* call6d \\(l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#4 .* call6c \\(i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#5 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#6 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
 	".*\[\r\n\]#7 .* main \\(.*\\) "
     } ] {
 	gdb_suppress_tests;
@@ -591,13 +591,13 @@ $gdb_prompt $" {
     send_gdb "backtrace 100\n"
     if [gdb_expect_list "backtrace from call6h" ".*$gdb_prompt $" {
 	".*\[\r\n\]#0 .* call6h \\(us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#1 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#2 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#3 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#4 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#5 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#6 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#7 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#1 .* call6g \\(uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#2 .* call6f \\(d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#3 .* call6e \\(f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#4 .* call6d \\(l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#5 .* call6c \\(i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#6 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#7 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
 	".*\[\r\n\]#8 .* main \\(.*\\) "
     } ] {
 	gdb_suppress_tests;
@@ -619,13 +619,13 @@ $gdb_prompt $" {
     if [gdb_expect_list "backtrace from call6i" ".*$gdb_prompt $" {
 	".*\[\r\n\]#0 .* call6i \\(ui=7, ul=8\\) "
 	".*\[\r\n\]#1 .* call6h \\(us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#2 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#3 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#4 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#5 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#6 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#7 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#8 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#2 .* call6g \\(uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#3 .* call6f \\(d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#4 .* call6e \\(f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#5 .* call6d \\(l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#6 .* call6c \\(i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#7 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#8 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
 	".*\[\r\n\]#9 .* main \\(.*\\) "
     } ] {
 	gdb_suppress_tests;
@@ -641,13 +641,13 @@ $gdb_prompt $" {
 	".*\[\r\n\]#0 .* call6j \\(ul=8\\) "
 	".*\[\r\n\]#1 .* call6i \\(ui=7, ul=8\\) "
 	".*\[\r\n\]#2 .* call6h \\(us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#3 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#4 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#5 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#6 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#7 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#8 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#9 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#3 .* call6g \\(uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#4 .* call6f \\(d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#5 .* call6e \\(f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#6 .* call6d \\(l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#7 .* call6c \\(i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#8 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#9 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
 	".*\[\r\n\]#10 .* main \\(.*\\) "
     } ] {
 	gdb_suppress_tests;
@@ -663,13 +663,13 @@ $gdb_prompt $" {
 	".*\[\r\n\]#1 .* call6j \\(ul=8\\) "
 	".*\[\r\n\]#2 .* call6i \\(ui=7, ul=8\\) "
 	".*\[\r\n\]#3 .* call6h \\(us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#4 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#5 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#6 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#7 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#8 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#9 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
-	".*\[\r\n\]#10 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#4 .* call6g \\(uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#5 .* call6f \\(d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#6 .* call6e \\(f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#7 .* call6d \\(l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#8 .* call6c \\(i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#9 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
+	".*\[\r\n\]#10 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98, us=6, ui=7, ul=8\\) "
 	".*\[\r\n\]#11 .* main \\(.*\\) "
     } ] {
 	gdb_suppress_tests;
@@ -716,13 +716,13 @@ proc shuffle_round_robin {} {
     send_gdb "backtrace 100\n"
     gdb_expect {
 	-re "backtrace 100\[\r\n\]+
-.* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\r
+.* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7\\) .*\r
 .* main \\(.*\\) .*\r
 $gdb_prompt $" {
 	    pass "backtrace from call7a"
 	}
 	-re "backtrace 100\[\r\n\]+
-.* call7a \\(c=97 'a', i=2, s=1, l=3, f=.*, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\r
+.* call7a \\(c=97 'a', i=2, s=1, l=3, f=.*, uc=98, d=5, us=6, ul=8, ui=7\\) .*\r
 .* main \\(.*\\) .*\r
 $gdb_prompt $" {
 	    xfail "backtrace from call7a"
@@ -740,8 +740,8 @@ $gdb_prompt $" {
 
     send_gdb "backtrace 100\n"
     gdb_expect_list "backtrace from call7b" ".*$gdb_prompt $" {
-	".*\[\r\n\]#0 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
-	".*\[\r\n\]#1 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+	".*\[\r\n\]#0 .* call7b \\(i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+	".*\[\r\n\]#1 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7\\) "
 	".*\[\r\n\]#2 .* main \\(.*\\) "
     }
 
@@ -752,9 +752,9 @@ $gdb_prompt $" {
 
     send_gdb "backtrace 100\n"
     gdb_expect_list "backtrace from call7c" ".*$gdb_prompt $" {
-	".*\[\r\n\]#0 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
-	".*\[\r\n\]#1 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
-	".*\[\r\n\]#2 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+	".*\[\r\n\]#0 .* call7c \\(s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
+	".*\[\r\n\]#1 .* call7b \\(i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+	".*\[\r\n\]#2 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7\\) "
 	".*\[\r\n\]#3 .* main \\(.*\\) "
     }
 
@@ -765,10 +765,10 @@ $gdb_prompt $" {
 
     send_gdb "backtrace 100\n"
     gdb_expect_list "backtrace from call7d" ".*$gdb_prompt $" {
-	".*\[\r\n\]#0 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
-	".*\[\r\n\]#1 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
-	".*\[\r\n\]#2 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
-	".*\[\r\n\]#3 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+	".*\[\r\n\]#0 .* call7d \\(l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
+	".*\[\r\n\]#1 .* call7c \\(s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
+	".*\[\r\n\]#2 .* call7b \\(i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+	".*\[\r\n\]#3 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7\\) "
 	".*\[\r\n\]#4 .* main \\(.*\\) "
     }
 
@@ -776,11 +776,11 @@ $gdb_prompt $" {
 
     send_gdb "backtrace 100\n"
     gdb_expect_list "backtrace from call7e" ".*$gdb_prompt $" {
-	".*\[\r\n\]#0 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
-	".*\[\r\n\]#1 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
-	".*\[\r\n\]#2 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
-	".*\[\r\n\]#3 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
-	".*\[\r\n\]#4 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+	".*\[\r\n\]#0 .* call7e \\(f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
+	".*\[\r\n\]#1 .* call7d \\(l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
+	".*\[\r\n\]#2 .* call7c \\(s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
+	".*\[\r\n\]#3 .* call7b \\(i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+	".*\[\r\n\]#4 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7\\) "
 	".*\[\r\n\]#5 .* main \\(.*\\) "
     }
 
@@ -791,12 +791,12 @@ $gdb_prompt $" {
 
     send_gdb "backtrace 100\n"
     gdb_expect_list "backtrace from call7f" ".*$gdb_prompt $" {
-	".*\[\r\n\]#0 .* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
-	".*\[\r\n\]#1 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
-	".*\[\r\n\]#2 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
-	".*\[\r\n\]#3 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
-	".*\[\r\n\]#4 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
-	".*\[\r\n\]#5 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+	".*\[\r\n\]#0 .* call7f \\(uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
+	".*\[\r\n\]#1 .* call7e \\(f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
+	".*\[\r\n\]#2 .* call7d \\(l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
+	".*\[\r\n\]#3 .* call7c \\(s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
+	".*\[\r\n\]#4 .* call7b \\(i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+	".*\[\r\n\]#5 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7\\) "
 	".*\[\r\n\]#6 .* main \\(.*\\) "
     }
 
@@ -807,13 +807,13 @@ $gdb_prompt $" {
 
     send_gdb "backtrace 100\n"
     gdb_expect_list "backtrace from call7g" ".*$gdb_prompt $" {
-	".*\[\r\n\]#0 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) "
-	".*\[\r\n\]#1 .* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
-	".*\[\r\n\]#2 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
-	".*\[\r\n\]#3 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
-	".*\[\r\n\]#4 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
-	".*\[\r\n\]#5 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
-	".*\[\r\n\]#6 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+	".*\[\r\n\]#0 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98\\) "
+	".*\[\r\n\]#1 .* call7f \\(uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
+	".*\[\r\n\]#2 .* call7e \\(f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
+	".*\[\r\n\]#3 .* call7d \\(l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
+	".*\[\r\n\]#4 .* call7c \\(s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
+	".*\[\r\n\]#5 .* call7b \\(i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+	".*\[\r\n\]#6 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7\\) "
 	".*\[\r\n\]#7 .* main \\(.*\\) "
     }
 
@@ -821,14 +821,14 @@ $gdb_prompt $" {
 
     send_gdb "backtrace 100\n"
     gdb_expect_list "backtrace from call7h" ".*$gdb_prompt $" {
-	".*\[\r\n\]#0 .* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) "
-	".*\[\r\n\]#1 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) "
-	".*\[\r\n\]#2 .* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
-	".*\[\r\n\]#3 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
-	".*\[\r\n\]#4 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
-	".*\[\r\n\]#5 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
-	".*\[\r\n\]#6 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
-	".*\[\r\n\]#7 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+	".*\[\r\n\]#0 .* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5\\) "
+	".*\[\r\n\]#1 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98\\) "
+	".*\[\r\n\]#2 .* call7f \\(uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
+	".*\[\r\n\]#3 .* call7e \\(f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
+	".*\[\r\n\]#4 .* call7d \\(l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
+	".*\[\r\n\]#5 .* call7c \\(s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
+	".*\[\r\n\]#6 .* call7b \\(i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+	".*\[\r\n\]#7 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7\\) "
 	".*\[\r\n\]#8 .* main \\(.*\\) "
     }
 
@@ -846,15 +846,15 @@ $gdb_prompt $" {
 
     send_gdb "backtrace 100\n"
     gdb_expect_list "backtrace from call7i" ".*$gdb_prompt $" {
-	".*\[\r\n\]#0 .* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6\\) "
-	".*\[\r\n\]#1 .* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) "
-	".*\[\r\n\]#2 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) "
-	".*\[\r\n\]#3 .* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
-	".*\[\r\n\]#4 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
-	".*\[\r\n\]#5 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
-	".*\[\r\n\]#6 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
-	".*\[\r\n\]#7 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
-	".*\[\r\n\]#8 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+	".*\[\r\n\]#0 .* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5, us=6\\) "
+	".*\[\r\n\]#1 .* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5\\) "
+	".*\[\r\n\]#2 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98\\) "
+	".*\[\r\n\]#3 .* call7f \\(uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
+	".*\[\r\n\]#4 .* call7e \\(f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
+	".*\[\r\n\]#5 .* call7d \\(l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
+	".*\[\r\n\]#6 .* call7c \\(s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
+	".*\[\r\n\]#7 .* call7b \\(i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+	".*\[\r\n\]#8 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7\\) "
 	".*\[\r\n\]#9 .* main \\(.*\\) "
     }
 
@@ -865,16 +865,16 @@ $gdb_prompt $" {
 
     send_gdb "backtrace 100\n"
     gdb_expect_list "backtrace from call7j" ".*$gdb_prompt $" {
-	".*\[\r\n\]#0 .* call7j \\(ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8\\) "
-	".*\[\r\n\]#1 .* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6\\) "
-	".*\[\r\n\]#2 .* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) "
-	".*\[\r\n\]#3 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) "
-	".*\[\r\n\]#4 .* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
-	".*\[\r\n\]#5 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
-	".*\[\r\n\]#6 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
-	".*\[\r\n\]#7 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
-	".*\[\r\n\]#8 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
-	".*\[\r\n\]#9 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+	".*\[\r\n\]#0 .* call7j \\(ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8\\) "
+	".*\[\r\n\]#1 .* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5, us=6\\) "
+	".*\[\r\n\]#2 .* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5\\) "
+	".*\[\r\n\]#3 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98\\) "
+	".*\[\r\n\]#4 .* call7f \\(uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
+	".*\[\r\n\]#5 .* call7e \\(f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
+	".*\[\r\n\]#6 .* call7d \\(l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
+	".*\[\r\n\]#7 .* call7c \\(s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
+	".*\[\r\n\]#8 .* call7b \\(i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+	".*\[\r\n\]#9 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7\\) "
 	".*\[\r\n\]#10 .* main \\(.*\\) "
     }
 
@@ -886,17 +886,17 @@ $gdb_prompt $" {
     if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
     send_gdb "backtrace 100\n"
     gdb_expect_list "backtrace from call7k" ".*$gdb_prompt $" {
-	".*\[\r\n\]#0 .* call7k \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
-	".*\[\r\n\]#1 .* call7j \\(ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8\\) "
-	".*\[\r\n\]#2 .* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6\\) "
-	".*\[\r\n\]#3 .* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) "
-	".*\[\r\n\]#4 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) "
-	".*\[\r\n\]#5 .* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
-	".*\[\r\n\]#6 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
-	".*\[\r\n\]#7 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
-	".*\[\r\n\]#8 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
-	".*\[\r\n\]#9 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
-	".*\[\r\n\]#10 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+	".*\[\r\n\]#0 .* call7k \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7\\) "
+	".*\[\r\n\]#1 .* call7j \\(ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8\\) "
+	".*\[\r\n\]#2 .* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5, us=6\\) "
+	".*\[\r\n\]#3 .* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5\\) "
+	".*\[\r\n\]#4 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98\\) "
+	".*\[\r\n\]#5 .* call7f \\(uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
+	".*\[\r\n\]#6 .* call7e \\(f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
+	".*\[\r\n\]#7 .* call7d \\(l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
+	".*\[\r\n\]#8 .* call7c \\(s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
+	".*\[\r\n\]#9 .* call7b \\(i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+	".*\[\r\n\]#10 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98, d=5, us=6, ul=8, ui=7\\) "
 	".*\[\r\n\]#11 .* main \\(.*\\) "
     }
     gdb_stop_suppressing_tests;
@@ -1013,7 +1013,7 @@ proc call_after_alloca { } {
     gdb_test "print l" " = 3" "print l in call_after_alloca"
 
     if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
-    gdb_test "backtrace 8" "#0.*call_after_alloca_subr \\(c=97 'a', s=1, i=2, l=3, uc=98 'b', us=11, ui=12, ul=13\\).*#1.*call_after_alloca \\(c=97 'a', s=1, i=2, l=3\\).*#2.*main.*" "backtrace from call_after_alloca_subr"
+    gdb_test "backtrace 8" "#0.*call_after_alloca_subr \\(c=97 'a', s=1, i=2, l=3, uc=98, us=11, ui=12, ul=13\\).*#1.*call_after_alloca \\(c=97 'a', s=1, i=2, l=3\\).*#2.*main.*" "backtrace from call_after_alloca_subr"
     gdb_stop_suppressing_tests;
 }
 
Index: testsuite/gdb.base/pointers.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/pointers.exp,v
retrieving revision 1.9
diff -u -p -r1.9 pointers.exp
--- testsuite/gdb.base/pointers.exp	9 Jan 2007 17:59:11 -0000	1.9
+++ testsuite/gdb.base/pointers.exp	5 Jul 2007 13:27:43 -0000
@@ -393,7 +393,7 @@ gdb_expect {
 
 send_gdb "print *pUC\n"
 gdb_expect {
-    -re ".\[0-9\]* = 21 \'.025\'.*$gdb_prompt $" {
+    -re ".\[0-9\]* = 21.*$gdb_prompt $" {
         pass "print value of *pUC"
       }
     -re ".*$gdb_prompt $" { fail "print value of *pUC" }
Index: testsuite/gdb.base/printcmds.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/printcmds.exp,v
retrieving revision 1.15
diff -u -p -r1.15 printcmds.exp
--- testsuite/gdb.base/printcmds.exp	26 Jan 2007 20:53:15 -0000	1.15
+++ testsuite/gdb.base/printcmds.exp	5 Jul 2007 13:27:43 -0000
@@ -137,262 +137,262 @@ 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 '\\\\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'"
-    gdb_test "p ctable1\[10\]"  " = 10 '\\\\n'"
-    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 '\\\\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 '\"'"
-    gdb_test "p ctable1\[35\]"  " = 35 '#'"
-    gdb_test "p ctable1\[36\]"  " = 36 '\\\$'"
-    gdb_test "p ctable1\[37\]"  " = 37 '%'"
-    gdb_test "p ctable1\[38\]"  " = 38 '&'"
-    gdb_test "p ctable1\[39\]"  " = 39 '\\\\''"
-    gdb_test "p ctable1\[40\]"  " = 40 '\\('"
-    gdb_test "p ctable1\[41\]"  " = 41 '\\)'"
-    gdb_test "p ctable1\[42\]"  " = 42 '\\*'"
-    gdb_test "p ctable1\[43\]"  " = 43 '\\+'"
-    gdb_test "p ctable1\[44\]"  " = 44 ','"
-    gdb_test "p ctable1\[45\]"  " = 45 '-'"
-    gdb_test "p ctable1\[46\]"  " = 46 '.'"
-    gdb_test "p ctable1\[47\]"  " = 47 '/'"
-    gdb_test "p ctable1\[48\]"  " = 48 '0'"
-    gdb_test "p ctable1\[49\]"  " = 49 '1'"
-    gdb_test "p ctable1\[50\]"  " = 50 '2'"
-    gdb_test "p ctable1\[51\]"  " = 51 '3'"
-    gdb_test "p ctable1\[52\]"  " = 52 '4'"
-    gdb_test "p ctable1\[53\]"  " = 53 '5'"
-    gdb_test "p ctable1\[54\]"  " = 54 '6'"
-    gdb_test "p ctable1\[55\]"  " = 55 '7'"
-    gdb_test "p ctable1\[56\]"  " = 56 '8'"
-    gdb_test "p ctable1\[57\]"  " = 57 '9'"
-    gdb_test "p ctable1\[58\]"  " = 58 ':'"
-    gdb_test "p ctable1\[59\]"  " = 59 ';'"
-    gdb_test "p ctable1\[60\]"  " = 60 '<'"
-    gdb_test "p ctable1\[61\]"  " = 61 '='"
-    gdb_test "p ctable1\[62\]"  " = 62 '>'"
-    gdb_test "p ctable1\[63\]"  " = 63 '\\?'"
-    gdb_test "p ctable1\[64\]"  " = 64 '@'"
-    gdb_test "p ctable1\[65\]"  " = 65 'A'"
-    gdb_test "p ctable1\[66\]"  " = 66 'B'"
-    gdb_test "p ctable1\[67\]"  " = 67 'C'"
-    gdb_test "p ctable1\[68\]"  " = 68 'D'"
-    gdb_test "p ctable1\[69\]"  " = 69 'E'"
-    gdb_test "p ctable1\[70\]"  " = 70 'F'"
-    gdb_test "p ctable1\[71\]"  " = 71 'G'"
-    gdb_test "p ctable1\[72\]"  " = 72 'H'"
-    gdb_test "p ctable1\[73\]"  " = 73 'I'"
-    gdb_test "p ctable1\[74\]"  " = 74 'J'"
-    gdb_test "p ctable1\[75\]"  " = 75 'K'"
-    gdb_test "p ctable1\[76\]"  " = 76 'L'"
-    gdb_test "p ctable1\[77\]"  " = 77 'M'"
-    gdb_test "p ctable1\[78\]"  " = 78 'N'"
-    gdb_test "p ctable1\[79\]"  " = 79 'O'"
-    gdb_test "p ctable1\[80\]"  " = 80 'P'"
-    gdb_test "p ctable1\[81\]"  " = 81 'Q'"
-    gdb_test "p ctable1\[82\]"  " = 82 'R'"
-    gdb_test "p ctable1\[83\]"  " = 83 'S'"
-    gdb_test "p ctable1\[84\]"  " = 84 'T'"
-    gdb_test "p ctable1\[85\]"  " = 85 'U'"
-    gdb_test "p ctable1\[86\]"  " = 86 'V'"
-    gdb_test "p ctable1\[87\]"  " = 87 'W'"
-    gdb_test "p ctable1\[88\]"  " = 88 'X'"
-    gdb_test "p ctable1\[89\]"  " = 89 'Y'"
-    gdb_test "p ctable1\[90\]"  " = 90 'Z'"
-    gdb_test "p ctable1\[91\]"  " = 91 '\\\['"
-    gdb_test "p ctable1\[92\]"  " = 92 '\\\\\\\\'"
-    gdb_test "p ctable1\[93\]"  " = 93 '\\\]'"
-    gdb_test "p ctable1\[94\]"  " = 94 '\\^'"
-    gdb_test "p ctable1\[95\]"  " = 95 '_'"
-    gdb_test "p ctable1\[96\]"  " = 96 '`'"
-    gdb_test "p ctable1\[97\]"  " = 97 'a'"
-    gdb_test "p ctable1\[98\]"  " = 98 'b'"
-    gdb_test "p ctable1\[99\]"  " = 99 'c'"
-    gdb_test "p ctable1\[100\]" " = 100 'd'"
-    gdb_test "p ctable1\[101\]" " = 101 'e'"
-    gdb_test "p ctable1\[102\]" " = 102 'f'"
-    gdb_test "p ctable1\[103\]" " = 103 'g'"
-    gdb_test "p ctable1\[104\]" " = 104 'h'"
-    gdb_test "p ctable1\[105\]" " = 105 'i'"
-    gdb_test "p ctable1\[106\]" " = 106 'j'"
-    gdb_test "p ctable1\[107\]" " = 107 'k'"
-    gdb_test "p ctable1\[108\]" " = 108 'l'"
-    gdb_test "p ctable1\[109\]" " = 109 'm'"
-    gdb_test "p ctable1\[110\]" " = 110 'n'"
-    gdb_test "p ctable1\[111\]" " = 111 'o'"
-    gdb_test "p ctable1\[112\]" " = 112 'p'"
-    gdb_test "p ctable1\[113\]" " = 113 'q'"
-    gdb_test "p ctable1\[114\]" " = 114 'r'"
-    gdb_test "p ctable1\[115\]" " = 115 's'"
-    gdb_test "p ctable1\[116\]" " = 116 't'"
-    gdb_test "p ctable1\[117\]" " = 117 'u'"
-    gdb_test "p ctable1\[118\]" " = 118 'v'"
-    gdb_test "p ctable1\[119\]" " = 119 'w'"
-    gdb_test "p ctable1\[120\]" " = 120 'x'"
-    gdb_test "p ctable1\[121\]" " = 121 'y'"
-    gdb_test "p ctable1\[122\]" " = 122 'z'"
-    gdb_test "p ctable1\[123\]" " = 123 '\[{\]+'"
-    gdb_test "p ctable1\[124\]" " = 124 '\[|\]+'"
-    gdb_test "p ctable1\[125\]" " = 125 '\[}\]+'"
-    gdb_test "p ctable1\[126\]" " = 126 '\[~\]'"
-    gdb_test "p ctable1\[127\]" " = 127 '\\\\177'"
-    gdb_test "p ctable1\[128\]" " = 128 '\\\\200'"
-    gdb_test "p ctable1\[129\]" " = 129 '\\\\201'"
-    gdb_test "p ctable1\[130\]" " = 130 '\\\\202'"
-    gdb_test "p ctable1\[131\]" " = 131 '\\\\203'"
-    gdb_test "p ctable1\[132\]" " = 132 '\\\\204'"
-    gdb_test "p ctable1\[133\]" " = 133 '\\\\205'"
-    gdb_test "p ctable1\[134\]" " = 134 '\\\\206'"
-    gdb_test "p ctable1\[135\]" " = 135 '\\\\207'"
-    gdb_test "p ctable1\[136\]" " = 136 '\\\\210'"
-    gdb_test "p ctable1\[137\]" " = 137 '\\\\211'"
-    gdb_test "p ctable1\[138\]" " = 138 '\\\\212'"
-    gdb_test "p ctable1\[139\]" " = 139 '\\\\213'"
-    gdb_test "p ctable1\[140\]" " = 140 '\\\\214'"
-    gdb_test "p ctable1\[141\]" " = 141 '\\\\215'"
-    gdb_test "p ctable1\[142\]" " = 142 '\\\\216'"
-    gdb_test "p ctable1\[143\]" " = 143 '\\\\217'"
-    gdb_test "p ctable1\[144\]" " = 144 '\\\\220'"
-    gdb_test "p ctable1\[145\]" " = 145 '\\\\221'"
-    gdb_test "p ctable1\[146\]" " = 146 '\\\\222'"
-    gdb_test "p ctable1\[147\]" " = 147 '\\\\223'"
-    gdb_test "p ctable1\[148\]" " = 148 '\\\\224'"
-    gdb_test "p ctable1\[149\]" " = 149 '\\\\225'"
-    gdb_test "p ctable1\[150\]" " = 150 '\\\\226'"
-    gdb_test "p ctable1\[151\]" " = 151 '\\\\227'"
-    gdb_test "p ctable1\[152\]" " = 152 '\\\\230'"
-    gdb_test "p ctable1\[153\]" " = 153 '\\\\231'"
-    gdb_test "p ctable1\[154\]" " = 154 '\\\\232'"
-    gdb_test "p ctable1\[155\]" " = 155 '\\\\233'"
-    gdb_test "p ctable1\[156\]" " = 156 '\\\\234'"
-    gdb_test "p ctable1\[157\]" " = 157 '\\\\235'"
-    gdb_test "p ctable1\[158\]" " = 158 '\\\\236'"
-    gdb_test "p ctable1\[159\]" " = 159 '\\\\237'"
-    gdb_test "p ctable1\[160\]" " = 160 '\\\\240'"
-    gdb_test "p ctable1\[161\]" " = 161 '\\\\241'"
-    gdb_test "p ctable1\[162\]" " = 162 '\\\\242'"
-    gdb_test "p ctable1\[163\]" " = 163 '\\\\243'"
-    gdb_test "p ctable1\[164\]" " = 164 '\\\\244'"
-    gdb_test "p ctable1\[165\]" " = 165 '\\\\245'"
-    gdb_test "p ctable1\[166\]" " = 166 '\\\\246'"
-    gdb_test "p ctable1\[167\]" " = 167 '\\\\247'"
-    gdb_test "p ctable1\[168\]" " = 168 '\\\\250'"
-    gdb_test "p ctable1\[169\]" " = 169 '\\\\251'"
-    gdb_test "p ctable1\[170\]" " = 170 '\\\\252'"
-    gdb_test "p ctable1\[171\]" " = 171 '\\\\253'"
-    gdb_test "p ctable1\[172\]" " = 172 '\\\\254'"
-    gdb_test "p ctable1\[173\]" " = 173 '\\\\255'"
-    gdb_test "p ctable1\[174\]" " = 174 '\\\\256'"
-    gdb_test "p ctable1\[175\]" " = 175 '\\\\257'"
-    gdb_test "p ctable1\[176\]" " = 176 '\\\\260'"
-    gdb_test "p ctable1\[177\]" " = 177 '\\\\261'"
-    gdb_test "p ctable1\[178\]" " = 178 '\\\\262'"
-    gdb_test "p ctable1\[179\]" " = 179 '\\\\263'"
-    gdb_test "p ctable1\[180\]" " = 180 '\\\\264'"
-    gdb_test "p ctable1\[181\]" " = 181 '\\\\265'"
-    gdb_test "p ctable1\[182\]" " = 182 '\\\\266'"
-    gdb_test "p ctable1\[183\]" " = 183 '\\\\267'"
-    gdb_test "p ctable1\[184\]" " = 184 '\\\\270'"
-    gdb_test "p ctable1\[185\]" " = 185 '\\\\271'"
-    gdb_test "p ctable1\[186\]" " = 186 '\\\\272'"
-    gdb_test "p ctable1\[187\]" " = 187 '\\\\273'"
-    gdb_test "p ctable1\[188\]" " = 188 '\\\\274'"
-    gdb_test "p ctable1\[189\]" " = 189 '\\\\275'"
-    gdb_test "p ctable1\[190\]" " = 190 '\\\\276'"
-    gdb_test "p ctable1\[191\]" " = 191 '\\\\277'"
-    gdb_test "p ctable1\[192\]" " = 192 '\\\\300'"
-    gdb_test "p ctable1\[193\]" " = 193 '\\\\301'"
-    gdb_test "p ctable1\[194\]" " = 194 '\\\\302'"
-    gdb_test "p ctable1\[195\]" " = 195 '\\\\303'"
-    gdb_test "p ctable1\[196\]" " = 196 '\\\\304'"
-    gdb_test "p ctable1\[197\]" " = 197 '\\\\305'"
-    gdb_test "p ctable1\[198\]" " = 198 '\\\\306'"
-    gdb_test "p ctable1\[199\]" " = 199 '\\\\307'"
-    gdb_test "p ctable1\[200\]" " = 200 '\\\\310'"
-    gdb_test "p ctable1\[201\]" " = 201 '\\\\311'"
-    gdb_test "p ctable1\[202\]" " = 202 '\\\\312'"
-    gdb_test "p ctable1\[203\]" " = 203 '\\\\313'"
-    gdb_test "p ctable1\[204\]" " = 204 '\\\\314'"
-    gdb_test "p ctable1\[205\]" " = 205 '\\\\315'"
-    gdb_test "p ctable1\[206\]" " = 206 '\\\\316'"
-    gdb_test "p ctable1\[207\]" " = 207 '\\\\317'"
-    gdb_test "p ctable1\[208\]" " = 208 '\\\\320'"
-    gdb_test "p ctable1\[209\]" " = 209 '\\\\321'"
-    gdb_test "p ctable1\[210\]" " = 210 '\\\\322'"
-    gdb_test "p ctable1\[211\]" " = 211 '\\\\323'"
-    gdb_test "p ctable1\[212\]" " = 212 '\\\\324'"
-    gdb_test "p ctable1\[213\]" " = 213 '\\\\325'"
-    gdb_test "p ctable1\[214\]" " = 214 '\\\\326'"
-    gdb_test "p ctable1\[215\]" " = 215 '\\\\327'"
-    gdb_test "p ctable1\[216\]" " = 216 '\\\\330'"
-    gdb_test "p ctable1\[217\]" " = 217 '\\\\331'"
-    gdb_test "p ctable1\[218\]" " = 218 '\\\\332'"
-    gdb_test "p ctable1\[219\]" " = 219 '\\\\333'"
-    gdb_test "p ctable1\[220\]" " = 220 '\\\\334'"
-    gdb_test "p ctable1\[221\]" " = 221 '\\\\335'"
-    gdb_test "p ctable1\[222\]" " = 222 '\\\\336'"
-    gdb_test "p ctable1\[223\]" " = 223 '\\\\337'"
-    gdb_test "p ctable1\[224\]" " = 224 '\\\\340'"
-    gdb_test "p ctable1\[225\]" " = 225 '\\\\341'"
-    gdb_test "p ctable1\[226\]" " = 226 '\\\\342'"
-    gdb_test "p ctable1\[227\]" " = 227 '\\\\343'"
-    gdb_test "p ctable1\[228\]" " = 228 '\\\\344'"
-    gdb_test "p ctable1\[229\]" " = 229 '\\\\345'"
-    gdb_test "p ctable1\[230\]" " = 230 '\\\\346'"
-    gdb_test "p ctable1\[231\]" " = 231 '\\\\347'"
-    gdb_test "p ctable1\[232\]" " = 232 '\\\\350'"
-    gdb_test "p ctable1\[233\]" " = 233 '\\\\351'"
-    gdb_test "p ctable1\[234\]" " = 234 '\\\\352'"
-    gdb_test "p ctable1\[235\]" " = 235 '\\\\353'"
-    gdb_test "p ctable1\[236\]" " = 236 '\\\\354'"
-    gdb_test "p ctable1\[237\]" " = 237 '\\\\355'"
-    gdb_test "p ctable1\[238\]" " = 238 '\\\\356'"
-    gdb_test "p ctable1\[239\]" " = 239 '\\\\357'"
-    gdb_test "p ctable1\[240\]" " = 240 '\\\\360'"
-    gdb_test "p ctable1\[241\]" " = 241 '\\\\361'"
-    gdb_test "p ctable1\[242\]" " = 242 '\\\\362'"
-    gdb_test "p ctable1\[243\]" " = 243 '\\\\363'"
-    gdb_test "p ctable1\[244\]" " = 244 '\\\\364'"
-    gdb_test "p ctable1\[245\]" " = 245 '\\\\365'"
-    gdb_test "p ctable1\[246\]" " = 246 '\\\\366'"
-    gdb_test "p ctable1\[247\]" " = 247 '\\\\367'"
-    gdb_test "p ctable1\[248\]" " = 248 '\\\\370'"
-    gdb_test "p ctable1\[249\]" " = 249 '\\\\371'"
-    gdb_test "p ctable1\[250\]" " = 250 '\\\\372'"
-    gdb_test "p ctable1\[251\]" " = 251 '\\\\373'"
-    gdb_test "p ctable1\[252\]" " = 252 '\\\\374'"
-    gdb_test "p ctable1\[253\]" " = 253 '\\\\375'"
-    gdb_test "p ctable1\[254\]" " = 254 '\\\\376'"
-    gdb_test "p ctable1\[255\]" " = 255 '\\\\377'"
+    gdb_test "p/c ctable1\[0\]"   " = 0 '\\\\0'"
+    gdb_test "p/c ctable1\[1\]"   " = 1 '\\\\001'"
+    gdb_test "p/c ctable1\[2\]"   " = 2 '\\\\002'"
+    gdb_test "p/c ctable1\[3\]"   " = 3 '\\\\003'"
+    gdb_test "p/c ctable1\[4\]"   " = 4 '\\\\004'"
+    gdb_test "p/c ctable1\[5\]"   " = 5 '\\\\005'"
+    gdb_test "p/c ctable1\[6\]"   " = 6 '\\\\006'"
+    gdb_test "p/c ctable1\[7\]"   " = 7 '\\\\a'"
+    gdb_test "p/c ctable1\[8\]"   " = 8 '\\\\b'"
+    gdb_test "p/c ctable1\[9\]"   " = 9 '\\\\t'"
+    gdb_test "p/c ctable1\[10\]"  " = 10 '\\\\n'"
+    gdb_test "p/c ctable1\[11\]"  " = 11 '\\\\v'"
+    gdb_test "p/c ctable1\[12\]"  " = 12 '\\\\f'"
+    gdb_test "p/c ctable1\[13\]"  " = 13 '\\\\r'"
+    gdb_test "p/c ctable1\[14\]"  " = 14 '\\\\016'"
+    gdb_test "p/c ctable1\[15\]"  " = 15 '\\\\017'"
+    gdb_test "p/c ctable1\[16\]"  " = 16 '\\\\020'"
+    gdb_test "p/c ctable1\[17\]"  " = 17 '\\\\021'"
+    gdb_test "p/c ctable1\[18\]"  " = 18 '\\\\022'"
+    gdb_test "p/c ctable1\[19\]"  " = 19 '\\\\023'"
+    gdb_test "p/c ctable1\[20\]"  " = 20 '\\\\024'"
+    gdb_test "p/c ctable1\[21\]"  " = 21 '\\\\025'"
+    gdb_test "p/c ctable1\[22\]"  " = 22 '\\\\026'"
+    gdb_test "p/c ctable1\[23\]"  " = 23 '\\\\027'"
+    gdb_test "p/c ctable1\[24\]"  " = 24 '\\\\030'"
+    gdb_test "p/c ctable1\[25\]"  " = 25 '\\\\031'"
+    gdb_test "p/c ctable1\[26\]"  " = 26 '\\\\032'"
+    gdb_test "p/c ctable1\[27\]"  " = 27 '\\\\033'"
+    gdb_test "p/c ctable1\[28\]"  " = 28 '\\\\034'"
+    gdb_test "p/c ctable1\[29\]"  " = 29 '\\\\035'"
+    gdb_test "p/c ctable1\[30\]"  " = 30 '\\\\036'"
+    gdb_test "p/c ctable1\[31\]"  " = 31 '\\\\037'"
+    gdb_test "p/c ctable1\[32\]"  " = 32 ' '"
+    gdb_test "p/c ctable1\[33\]"  " = 33 '!'"
+    gdb_test "p/c ctable1\[34\]"  " = 34 '\"'"
+    gdb_test "p/c ctable1\[35\]"  " = 35 '#'"
+    gdb_test "p/c ctable1\[36\]"  " = 36 '\\\$'"
+    gdb_test "p/c ctable1\[37\]"  " = 37 '%'"
+    gdb_test "p/c ctable1\[38\]"  " = 38 '&'"
+    gdb_test "p/c ctable1\[39\]"  " = 39 '\\\\''"
+    gdb_test "p/c ctable1\[40\]"  " = 40 '\\('"
+    gdb_test "p/c ctable1\[41\]"  " = 41 '\\)'"
+    gdb_test "p/c ctable1\[42\]"  " = 42 '\\*'"
+    gdb_test "p/c ctable1\[43\]"  " = 43 '\\+'"
+    gdb_test "p/c ctable1\[44\]"  " = 44 ','"
+    gdb_test "p/c ctable1\[45\]"  " = 45 '-'"
+    gdb_test "p/c ctable1\[46\]"  " = 46 '.'"
+    gdb_test "p/c ctable1\[47\]"  " = 47 '/'"
+    gdb_test "p/c ctable1\[48\]"  " = 48 '0'"
+    gdb_test "p/c ctable1\[49\]"  " = 49 '1'"
+    gdb_test "p/c ctable1\[50\]"  " = 50 '2'"
+    gdb_test "p/c ctable1\[51\]"  " = 51 '3'"
+    gdb_test "p/c ctable1\[52\]"  " = 52 '4'"
+    gdb_test "p/c ctable1\[53\]"  " = 53 '5'"
+    gdb_test "p/c ctable1\[54\]"  " = 54 '6'"
+    gdb_test "p/c ctable1\[55\]"  " = 55 '7'"
+    gdb_test "p/c ctable1\[56\]"  " = 56 '8'"
+    gdb_test "p/c ctable1\[57\]"  " = 57 '9'"
+    gdb_test "p/c ctable1\[58\]"  " = 58 ':'"
+    gdb_test "p/c ctable1\[59\]"  " = 59 ';'"
+    gdb_test "p/c ctable1\[60\]"  " = 60 '<'"
+    gdb_test "p/c ctable1\[61\]"  " = 61 '='"
+    gdb_test "p/c ctable1\[62\]"  " = 62 '>'"
+    gdb_test "p/c ctable1\[63\]"  " = 63 '\\?'"
+    gdb_test "p/c ctable1\[64\]"  " = 64 '@'"
+    gdb_test "p/c ctable1\[65\]"  " = 65 'A'"
+    gdb_test "p/c ctable1\[66\]"  " = 66 'B'"
+    gdb_test "p/c ctable1\[67\]"  " = 67 'C'"
+    gdb_test "p/c ctable1\[68\]"  " = 68 'D'"
+    gdb_test "p/c ctable1\[69\]"  " = 69 'E'"
+    gdb_test "p/c ctable1\[70\]"  " = 70 'F'"
+    gdb_test "p/c ctable1\[71\]"  " = 71 'G'"
+    gdb_test "p/c ctable1\[72\]"  " = 72 'H'"
+    gdb_test "p/c ctable1\[73\]"  " = 73 'I'"
+    gdb_test "p/c ctable1\[74\]"  " = 74 'J'"
+    gdb_test "p/c ctable1\[75\]"  " = 75 'K'"
+    gdb_test "p/c ctable1\[76\]"  " = 76 'L'"
+    gdb_test "p/c ctable1\[77\]"  " = 77 'M'"
+    gdb_test "p/c ctable1\[78\]"  " = 78 'N'"
+    gdb_test "p/c ctable1\[79\]"  " = 79 'O'"
+    gdb_test "p/c ctable1\[80\]"  " = 80 'P'"
+    gdb_test "p/c ctable1\[81\]"  " = 81 'Q'"
+    gdb_test "p/c ctable1\[82\]"  " = 82 'R'"
+    gdb_test "p/c ctable1\[83\]"  " = 83 'S'"
+    gdb_test "p/c ctable1\[84\]"  " = 84 'T'"
+    gdb_test "p/c ctable1\[85\]"  " = 85 'U'"
+    gdb_test "p/c ctable1\[86\]"  " = 86 'V'"
+    gdb_test "p/c ctable1\[87\]"  " = 87 'W'"
+    gdb_test "p/c ctable1\[88\]"  " = 88 'X'"
+    gdb_test "p/c ctable1\[89\]"  " = 89 'Y'"
+    gdb_test "p/c ctable1\[90\]"  " = 90 'Z'"
+    gdb_test "p/c ctable1\[91\]"  " = 91 '\\\['"
+    gdb_test "p/c ctable1\[92\]"  " = 92 '\\\\\\\\'"
+    gdb_test "p/c ctable1\[93\]"  " = 93 '\\\]'"
+    gdb_test "p/c ctable1\[94\]"  " = 94 '\\^'"
+    gdb_test "p/c ctable1\[95\]"  " = 95 '_'"
+    gdb_test "p/c ctable1\[96\]"  " = 96 '`'"
+    gdb_test "p/c ctable1\[97\]"  " = 97 'a'"
+    gdb_test "p/c ctable1\[98\]"  " = 98 'b'"
+    gdb_test "p/c ctable1\[99\]"  " = 99 'c'"
+    gdb_test "p/c ctable1\[100\]" " = 100 'd'"
+    gdb_test "p/c ctable1\[101\]" " = 101 'e'"
+    gdb_test "p/c ctable1\[102\]" " = 102 'f'"
+    gdb_test "p/c ctable1\[103\]" " = 103 'g'"
+    gdb_test "p/c ctable1\[104\]" " = 104 'h'"
+    gdb_test "p/c ctable1\[105\]" " = 105 'i'"
+    gdb_test "p/c ctable1\[106\]" " = 106 'j'"
+    gdb_test "p/c ctable1\[107\]" " = 107 'k'"
+    gdb_test "p/c ctable1\[108\]" " = 108 'l'"
+    gdb_test "p/c ctable1\[109\]" " = 109 'm'"
+    gdb_test "p/c ctable1\[110\]" " = 110 'n'"
+    gdb_test "p/c ctable1\[111\]" " = 111 'o'"
+    gdb_test "p/c ctable1\[112\]" " = 112 'p'"
+    gdb_test "p/c ctable1\[113\]" " = 113 'q'"
+    gdb_test "p/c ctable1\[114\]" " = 114 'r'"
+    gdb_test "p/c ctable1\[115\]" " = 115 's'"
+    gdb_test "p/c ctable1\[116\]" " = 116 't'"
+    gdb_test "p/c ctable1\[117\]" " = 117 'u'"
+    gdb_test "p/c ctable1\[118\]" " = 118 'v'"
+    gdb_test "p/c ctable1\[119\]" " = 119 'w'"
+    gdb_test "p/c ctable1\[120\]" " = 120 'x'"
+    gdb_test "p/c ctable1\[121\]" " = 121 'y'"
+    gdb_test "p/c ctable1\[122\]" " = 122 'z'"
+    gdb_test "p/c ctable1\[123\]" " = 123 '\[{\]+'"
+    gdb_test "p/c ctable1\[124\]" " = 124 '\[|\]+'"
+    gdb_test "p/c ctable1\[125\]" " = 125 '\[}\]+'"
+    gdb_test "p/c ctable1\[126\]" " = 126 '\[~\]'"
+    gdb_test "p/c ctable1\[127\]" " = 127 '\\\\177'"
+    gdb_test "p/c ctable1\[128\]" " = 128 '\\\\200'"
+    gdb_test "p/c ctable1\[129\]" " = 129 '\\\\201'"
+    gdb_test "p/c ctable1\[130\]" " = 130 '\\\\202'"
+    gdb_test "p/c ctable1\[131\]" " = 131 '\\\\203'"
+    gdb_test "p/c ctable1\[132\]" " = 132 '\\\\204'"
+    gdb_test "p/c ctable1\[133\]" " = 133 '\\\\205'"
+    gdb_test "p/c ctable1\[134\]" " = 134 '\\\\206'"
+    gdb_test "p/c ctable1\[135\]" " = 135 '\\\\207'"
+    gdb_test "p/c ctable1\[136\]" " = 136 '\\\\210'"
+    gdb_test "p/c ctable1\[137\]" " = 137 '\\\\211'"
+    gdb_test "p/c ctable1\[138\]" " = 138 '\\\\212'"
+    gdb_test "p/c ctable1\[139\]" " = 139 '\\\\213'"
+    gdb_test "p/c ctable1\[140\]" " = 140 '\\\\214'"
+    gdb_test "p/c ctable1\[141\]" " = 141 '\\\\215'"
+    gdb_test "p/c ctable1\[142\]" " = 142 '\\\\216'"
+    gdb_test "p/c ctable1\[143\]" " = 143 '\\\\217'"
+    gdb_test "p/c ctable1\[144\]" " = 144 '\\\\220'"
+    gdb_test "p/c ctable1\[145\]" " = 145 '\\\\221'"
+    gdb_test "p/c ctable1\[146\]" " = 146 '\\\\222'"
+    gdb_test "p/c ctable1\[147\]" " = 147 '\\\\223'"
+    gdb_test "p/c ctable1\[148\]" " = 148 '\\\\224'"
+    gdb_test "p/c ctable1\[149\]" " = 149 '\\\\225'"
+    gdb_test "p/c ctable1\[150\]" " = 150 '\\\\226'"
+    gdb_test "p/c ctable1\[151\]" " = 151 '\\\\227'"
+    gdb_test "p/c ctable1\[152\]" " = 152 '\\\\230'"
+    gdb_test "p/c ctable1\[153\]" " = 153 '\\\\231'"
+    gdb_test "p/c ctable1\[154\]" " = 154 '\\\\232'"
+    gdb_test "p/c ctable1\[155\]" " = 155 '\\\\233'"
+    gdb_test "p/c ctable1\[156\]" " = 156 '\\\\234'"
+    gdb_test "p/c ctable1\[157\]" " = 157 '\\\\235'"
+    gdb_test "p/c ctable1\[158\]" " = 158 '\\\\236'"
+    gdb_test "p/c ctable1\[159\]" " = 159 '\\\\237'"
+    gdb_test "p/c ctable1\[160\]" " = 160 '\\\\240'"
+    gdb_test "p/c ctable1\[161\]" " = 161 '\\\\241'"
+    gdb_test "p/c ctable1\[162\]" " = 162 '\\\\242'"
+    gdb_test "p/c ctable1\[163\]" " = 163 '\\\\243'"
+    gdb_test "p/c ctable1\[164\]" " = 164 '\\\\244'"
+    gdb_test "p/c ctable1\[165\]" " = 165 '\\\\245'"
+    gdb_test "p/c ctable1\[166\]" " = 166 '\\\\246'"
+    gdb_test "p/c ctable1\[167\]" " = 167 '\\\\247'"
+    gdb_test "p/c ctable1\[168\]" " = 168 '\\\\250'"
+    gdb_test "p/c ctable1\[169\]" " = 169 '\\\\251'"
+    gdb_test "p/c ctable1\[170\]" " = 170 '\\\\252'"
+    gdb_test "p/c ctable1\[171\]" " = 171 '\\\\253'"
+    gdb_test "p/c ctable1\[172\]" " = 172 '\\\\254'"
+    gdb_test "p/c ctable1\[173\]" " = 173 '\\\\255'"
+    gdb_test "p/c ctable1\[174\]" " = 174 '\\\\256'"
+    gdb_test "p/c ctable1\[175\]" " = 175 '\\\\257'"
+    gdb_test "p/c ctable1\[176\]" " = 176 '\\\\260'"
+    gdb_test "p/c ctable1\[177\]" " = 177 '\\\\261'"
+    gdb_test "p/c ctable1\[178\]" " = 178 '\\\\262'"
+    gdb_test "p/c ctable1\[179\]" " = 179 '\\\\263'"
+    gdb_test "p/c ctable1\[180\]" " = 180 '\\\\264'"
+    gdb_test "p/c ctable1\[181\]" " = 181 '\\\\265'"
+    gdb_test "p/c ctable1\[182\]" " = 182 '\\\\266'"
+    gdb_test "p/c ctable1\[183\]" " = 183 '\\\\267'"
+    gdb_test "p/c ctable1\[184\]" " = 184 '\\\\270'"
+    gdb_test "p/c ctable1\[185\]" " = 185 '\\\\271'"
+    gdb_test "p/c ctable1\[186\]" " = 186 '\\\\272'"
+    gdb_test "p/c ctable1\[187\]" " = 187 '\\\\273'"
+    gdb_test "p/c ctable1\[188\]" " = 188 '\\\\274'"
+    gdb_test "p/c ctable1\[189\]" " = 189 '\\\\275'"
+    gdb_test "p/c ctable1\[190\]" " = 190 '\\\\276'"
+    gdb_test "p/c ctable1\[191\]" " = 191 '\\\\277'"
+    gdb_test "p/c ctable1\[192\]" " = 192 '\\\\300'"
+    gdb_test "p/c ctable1\[193\]" " = 193 '\\\\301'"
+    gdb_test "p/c ctable1\[194\]" " = 194 '\\\\302'"
+    gdb_test "p/c ctable1\[195\]" " = 195 '\\\\303'"
+    gdb_test "p/c ctable1\[196\]" " = 196 '\\\\304'"
+    gdb_test "p/c ctable1\[197\]" " = 197 '\\\\305'"
+    gdb_test "p/c ctable1\[198\]" " = 198 '\\\\306'"
+    gdb_test "p/c ctable1\[199\]" " = 199 '\\\\307'"
+    gdb_test "p/c ctable1\[200\]" " = 200 '\\\\310'"
+    gdb_test "p/c ctable1\[201\]" " = 201 '\\\\311'"
+    gdb_test "p/c ctable1\[202\]" " = 202 '\\\\312'"
+    gdb_test "p/c ctable1\[203\]" " = 203 '\\\\313'"
+    gdb_test "p/c ctable1\[204\]" " = 204 '\\\\314'"
+    gdb_test "p/c ctable1\[205\]" " = 205 '\\\\315'"
+    gdb_test "p/c ctable1\[206\]" " = 206 '\\\\316'"
+    gdb_test "p/c ctable1\[207\]" " = 207 '\\\\317'"
+    gdb_test "p/c ctable1\[208\]" " = 208 '\\\\320'"
+    gdb_test "p/c ctable1\[209\]" " = 209 '\\\\321'"
+    gdb_test "p/c ctable1\[210\]" " = 210 '\\\\322'"
+    gdb_test "p/c ctable1\[211\]" " = 211 '\\\\323'"
+    gdb_test "p/c ctable1\[212\]" " = 212 '\\\\324'"
+    gdb_test "p/c ctable1\[213\]" " = 213 '\\\\325'"
+    gdb_test "p/c ctable1\[214\]" " = 214 '\\\\326'"
+    gdb_test "p/c ctable1\[215\]" " = 215 '\\\\327'"
+    gdb_test "p/c ctable1\[216\]" " = 216 '\\\\330'"
+    gdb_test "p/c ctable1\[217\]" " = 217 '\\\\331'"
+    gdb_test "p/c ctable1\[218\]" " = 218 '\\\\332'"
+    gdb_test "p/c ctable1\[219\]" " = 219 '\\\\333'"
+    gdb_test "p/c ctable1\[220\]" " = 220 '\\\\334'"
+    gdb_test "p/c ctable1\[221\]" " = 221 '\\\\335'"
+    gdb_test "p/c ctable1\[222\]" " = 222 '\\\\336'"
+    gdb_test "p/c ctable1\[223\]" " = 223 '\\\\337'"
+    gdb_test "p/c ctable1\[224\]" " = 224 '\\\\340'"
+    gdb_test "p/c ctable1\[225\]" " = 225 '\\\\341'"
+    gdb_test "p/c ctable1\[226\]" " = 226 '\\\\342'"
+    gdb_test "p/c ctable1\[227\]" " = 227 '\\\\343'"
+    gdb_test "p/c ctable1\[228\]" " = 228 '\\\\344'"
+    gdb_test "p/c ctable1\[229\]" " = 229 '\\\\345'"
+    gdb_test "p/c ctable1\[230\]" " = 230 '\\\\346'"
+    gdb_test "p/c ctable1\[231\]" " = 231 '\\\\347'"
+    gdb_test "p/c ctable1\[232\]" " = 232 '\\\\350'"
+    gdb_test "p/c ctable1\[233\]" " = 233 '\\\\351'"
+    gdb_test "p/c ctable1\[234\]" " = 234 '\\\\352'"
+    gdb_test "p/c ctable1\[235\]" " = 235 '\\\\353'"
+    gdb_test "p/c ctable1\[236\]" " = 236 '\\\\354'"
+    gdb_test "p/c ctable1\[237\]" " = 237 '\\\\355'"
+    gdb_test "p/c ctable1\[238\]" " = 238 '\\\\356'"
+    gdb_test "p/c ctable1\[239\]" " = 239 '\\\\357'"
+    gdb_test "p/c ctable1\[240\]" " = 240 '\\\\360'"
+    gdb_test "p/c ctable1\[241\]" " = 241 '\\\\361'"
+    gdb_test "p/c ctable1\[242\]" " = 242 '\\\\362'"
+    gdb_test "p/c ctable1\[243\]" " = 243 '\\\\363'"
+    gdb_test "p/c ctable1\[244\]" " = 244 '\\\\364'"
+    gdb_test "p/c ctable1\[245\]" " = 245 '\\\\365'"
+    gdb_test "p/c ctable1\[246\]" " = 246 '\\\\366'"
+    gdb_test "p/c ctable1\[247\]" " = 247 '\\\\367'"
+    gdb_test "p/c ctable1\[248\]" " = 248 '\\\\370'"
+    gdb_test "p/c ctable1\[249\]" " = 249 '\\\\371'"
+    gdb_test "p/c ctable1\[250\]" " = 250 '\\\\372'"
+    gdb_test "p/c ctable1\[251\]" " = 251 '\\\\373'"
+    gdb_test "p/c ctable1\[252\]" " = 252 '\\\\374'"
+    gdb_test "p/c ctable1\[253\]" " = 253 '\\\\375'"
+    gdb_test "p/c ctable1\[254\]" " = 254 '\\\\376'"
+    gdb_test "p/c ctable1\[255\]" " = 255 '\\\\377'"
 }
 
 # Test interaction of the number of print elements to print and the
@@ -405,7 +405,7 @@ proc test_print_repeats_10 {} {
 	gdb_test "set print elements $x" ""
 	for { set e 1; } { $e <= 16 } {incr e; } {
 	    set v [expr $e - 1];
-	    set command "p &ctable2\[${v}*16\]"
+	    set command "p/s &ctable2\[${v}*16\]"
 	    if { $x < $e } {
 		set aval $x;
 	    } else {
@@ -473,71 +473,71 @@ proc test_print_strings {} {
 
     gdb_test "set print elements 8" ""
 
-    gdb_test "p &ctable1\[0\]" \
+    gdb_test "p/s &ctable1\[0\]" \
 	" = \\(unsigned char \\*\\) \"\""
-    gdb_test "p &ctable1\[1\]" \
+    gdb_test "p/s &ctable1\[1\]" \
 	" = \\(unsigned char \\*\\) \"\\\\001\\\\002\\\\003\\\\004\\\\005\\\\006\\\\a\\\\b\"..."
-    gdb_test "p &ctable1\[1*8\]" \
+    gdb_test "p/s &ctable1\[1*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\b\\\\t\\\\n\\\\v\\\\f\\\\r\\\\016\\\\017\"..."
-    gdb_test "p &ctable1\[2*8\]" \
+    gdb_test "p/s &ctable1\[2*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\020\\\\021\\\\022\\\\023\\\\024\\\\025\\\\026\\\\027\"..."
-    gdb_test "p &ctable1\[3*8\]" \
+    gdb_test "p/s &ctable1\[3*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\030\\\\031\\\\032\\\\033\\\\034\\\\035\\\\036\\\\037\"..."
-    gdb_test "p &ctable1\[4*8\]" \
+    gdb_test "p/s &ctable1\[4*8\]" \
 	" = \\(unsigned char \\*\\) \" !\\\\\"#\\\$%&'\"..."
-    gdb_test "p &ctable1\[5*8\]" \
+    gdb_test "p/s &ctable1\[5*8\]" \
 	" = \\(unsigned char \\*\\) \"\\(\\)\\*\\+,-./\"..."
-    gdb_test "p &ctable1\[6*8\]" \
+    gdb_test "p/s &ctable1\[6*8\]" \
 	" = \\(unsigned char \\*\\) \"01234567\"..."
-    gdb_test "p &ctable1\[7*8\]" \
+    gdb_test "p/s &ctable1\[7*8\]" \
 	" = \\(unsigned char \\*\\) \"89:;<=>\\?\"..."
-    gdb_test "p &ctable1\[8*8\]" \
+    gdb_test "p/s &ctable1\[8*8\]" \
 	" = \\(unsigned char \\*\\) \"@ABCDEFG\"..."
-    gdb_test "p &ctable1\[9*8\]" \
+    gdb_test "p/s &ctable1\[9*8\]" \
 	" = \\(unsigned char \\*\\) \"HIJKLMNO\"..."
-    gdb_test "p &ctable1\[10*8\]" \
+    gdb_test "p/s &ctable1\[10*8\]" \
 	" = \\(unsigned char \\*\\) \"PQRSTUVW\"..."
-    gdb_test "p &ctable1\[11*8\]" \
+    gdb_test "p/s &ctable1\[11*8\]" \
 	" = \\(unsigned char \\*\\) \"XYZ\\\[\\\\\\\\\\\]\\^_\"..."
-    gdb_test "p &ctable1\[12*8\]" \
+    gdb_test "p/s &ctable1\[12*8\]" \
 	" = \\(unsigned char \\*\\) \"`abcdefg\"..."
-    gdb_test "p &ctable1\[13*8\]" \
+    gdb_test "p/s &ctable1\[13*8\]" \
 	" = \\(unsigned char \\*\\) \"hijklmno\"..."
-    gdb_test "p &ctable1\[14*8\]" \
+    gdb_test "p/s &ctable1\[14*8\]" \
 	" = \\(unsigned char \\*\\) \"pqrstuvw\"..."
-    gdb_test "p &ctable1\[15*8\]" \
+    gdb_test "p/s &ctable1\[15*8\]" \
 	" = \\(unsigned char \\*\\) \"xyz\[{|}\]+\\~\\\\177\"..."
-    gdb_test "p &ctable1\[16*8\]" \
+    gdb_test "p/s &ctable1\[16*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\200\\\\201\\\\202\\\\203\\\\204\\\\205\\\\206\\\\207\"..."
-    gdb_test "p &ctable1\[17*8\]" \
+    gdb_test "p/s &ctable1\[17*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\210\\\\211\\\\212\\\\213\\\\214\\\\215\\\\216\\\\217\"..."
-    gdb_test "p &ctable1\[18*8\]" \
+    gdb_test "p/s &ctable1\[18*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\220\\\\221\\\\222\\\\223\\\\224\\\\225\\\\226\\\\227\"..."
-    gdb_test "p &ctable1\[19*8\]" \
+    gdb_test "p/s &ctable1\[19*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\230\\\\231\\\\232\\\\233\\\\234\\\\235\\\\236\\\\237\"..."
-    gdb_test "p &ctable1\[20*8\]" \
+    gdb_test "p/s &ctable1\[20*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\240\\\\241\\\\242\\\\243\\\\244\\\\245\\\\246\\\\247\"..."
-    gdb_test "p &ctable1\[21*8\]" \
+    gdb_test "p/s &ctable1\[21*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\250\\\\251\\\\252\\\\253\\\\254\\\\255\\\\256\\\\257\"..."
-    gdb_test "p &ctable1\[22*8\]" \
+    gdb_test "p/s &ctable1\[22*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\260\\\\261\\\\262\\\\263\\\\264\\\\265\\\\266\\\\267\"..."
-    gdb_test "p &ctable1\[23*8\]" \
+    gdb_test "p/s &ctable1\[23*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\270\\\\271\\\\272\\\\273\\\\274\\\\275\\\\276\\\\277\"..."
-    gdb_test "p &ctable1\[24*8\]" \
+    gdb_test "p/s &ctable1\[24*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\300\\\\301\\\\302\\\\303\\\\304\\\\305\\\\306\\\\307\"..."
-    gdb_test "p &ctable1\[25*8\]" \
+    gdb_test "p/s &ctable1\[25*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\310\\\\311\\\\312\\\\313\\\\314\\\\315\\\\316\\\\317\"..."
-    gdb_test "p &ctable1\[26*8\]" \
+    gdb_test "p/s &ctable1\[26*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\320\\\\321\\\\322\\\\323\\\\324\\\\325\\\\326\\\\327\"..."
-    gdb_test "p &ctable1\[27*8\]" \
+    gdb_test "p/s &ctable1\[27*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\330\\\\331\\\\332\\\\333\\\\334\\\\335\\\\336\\\\337\"..."
-    gdb_test "p &ctable1\[28*8\]" \
+    gdb_test "p/s &ctable1\[28*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\340\\\\341\\\\342\\\\343\\\\344\\\\345\\\\346\\\\347\"..."
-    gdb_test "p &ctable1\[29*8\]" \
+    gdb_test "p/s &ctable1\[29*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\350\\\\351\\\\352\\\\353\\\\354\\\\355\\\\356\\\\357\"..."
-    gdb_test "p &ctable1\[30*8\]" \
+    gdb_test "p/s &ctable1\[30*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\360\\\\361\\\\362\\\\363\\\\364\\\\365\\\\366\\\\367\"..."
-    gdb_test "p &ctable1\[31*8\]" \
+    gdb_test "p/s &ctable1\[31*8\]" \
 	" = \\(unsigned char \\*\\) \"\\\\370\\\\371\\\\372\\\\373\\\\374\\\\375\\\\376\\\\377\"..."
 }
 
@@ -589,19 +589,19 @@ proc test_print_char_arrays {} {
     gdb_test "set print elements 24" ""
     gdb_test "set print address on" ""
 
-    gdb_test "p arrays" \
+    gdb_test "p/c arrays" \
 	" = \\{array1 = \\{97 'a', 98 'b', 99 'c', 0 '\\\\0'\\}, array2 = \\{100 'd'\\}, array3 = \\{101 'e'\\}, array4 = \\{102 'f', 103 'g'\\}, array5 = \\{104 'h', 105 'i', 106 'j', 0 '\\\\0'\\}\\}"
 
     gdb_test "p parrays"		" = \\(struct some_arrays \\*\\) $hex"
-    gdb_test "p parrays->array1"	" = \\{97 'a', 98 'b', 99 'c', 0 '\\\\0'\\}"
+    gdb_test "p/c parrays->array1"	" = \\{97 'a', 98 'b', 99 'c', 0 '\\\\0'\\}"
     gdb_test "p &parrays->array1"	" = \\(unsigned char \\(\\*\\)\\\[4\\\]\\) $hex"
-    gdb_test "p parrays->array2"	" = \\{100 'd'\\}"
+    gdb_test "p/c parrays->array2"	" = \\{100 'd'\\}"
     gdb_test "p &parrays->array2"	" = \\(unsigned char \\(\\*\\)\\\[1\\\]\\) $hex"
-    gdb_test "p parrays->array3"	" = \\{101 'e'\\}"
+    gdb_test "p/c parrays->array3"	" = \\{101 'e'\\}"
     gdb_test "p &parrays->array3"	" = \\(unsigned char \\(\\*\\)\\\[1\\\]\\) $hex"
-    gdb_test "p parrays->array4"	" = \\{102 'f', 103 'g'\\}"
+    gdb_test "p/c parrays->array4"	" = \\{102 'f', 103 'g'\\}"
     gdb_test "p &parrays->array4"	" = \\(unsigned char \\(\\*\\)\\\[2\\\]\\) $hex"
-    gdb_test "p parrays->array5"	" = \\{104 'h', 105 'i', 106 'j', 0 '\\\\0'\\}"
+    gdb_test "p/c parrays->array5"	" = \\{104 'h', 105 'i', 106 'j', 0 '\\\\0'\\}"
     gdb_test "p &parrays->array5"	" = \\(unsigned char \\(\\*\\)\\\[4\\\]\\) $hex"
 
     gdb_test "set print address off" ""
@@ -695,7 +695,7 @@ gdb_test "set print address off" ""
 gdb_test "set width 0" ""
 
 if [set_lang_c] then {
-    gdb_test "p ctable1\[120\]" "120 'x'" "p ctable1\[120\] #1"
+    gdb_test "p/c ctable1\[120\]" "120 'x'" "p/c ctable1\[120\] #1"
 
     if [runto_main] then {
 	test_integer_literals_accepted
Index: testsuite/gdb.base/setvar.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/setvar.exp,v
retrieving revision 1.11
diff -u -p -r1.11 setvar.exp
--- testsuite/gdb.base/setvar.exp	26 Jan 2007 20:53:15 -0000	1.11
+++ testsuite/gdb.base/setvar.exp	5 Jul 2007 13:27:43 -0000
@@ -132,33 +132,33 @@ test_set "set variable v_char=127" "prin
 #
 # 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 \'.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')" 
-test_set "set variable v_signed_char=97" "print v_signed_char" ".\[0-9\]* = 97 \'a\'"        "set variable signed char=97 ('a')" 
-test_set "set variable v_signed_char=126" "print v_signed_char" ".\[0-9\]* = 126 \'~\'"        "set variable signed char=126 ('~')" 
-test_set "set variable v_signed_char=127" "print v_signed_char" ".\[0-9\]* = 127 \'.177\'"        "set variable signed char=127 (8-bit)" 
+test_set "set variable v_char=0" "print v_signed_char" ".\[0-9\]* = 0"                 "set variable signed char=0" 
+test_set "set variable v_signed_char=1" "print v_signed_char" ".\[0-9\]* = 1"        "set variable signed char=1" 
+test_set "set variable v_signed_char=7" "print v_signed_char" ".\[0-9\]* = 7"        "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"        "set variable signed char=65 ('A')" 
+test_set "set variable v_signed_char=97" "print v_signed_char" ".\[0-9\]* = 97"        "set variable signed char=97 ('a')" 
+test_set "set variable v_signed_char=126" "print v_signed_char" ".\[0-9\]* = 126"        "set variable signed char=126 ('~')" 
+test_set "set variable v_signed_char=127" "print v_signed_char" ".\[0-9\]* = 127"        "set variable signed char=127 (8-bit)" 
 gdb_test "set variable v_signed_char=-1" ""
 if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix4*" }
-gdb_test "print v_signed_char" ".\[0-9\]* = -1 \'.377\'" \
+gdb_test "print v_signed_char" ".\[0-9\]* = -1" \
     "set variable signed char=-1 (-1)"
 gdb_test "set variable v_signed_char=0xFF" ""
 if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix4*" }
-gdb_test "print v_signed_char" ".\[0-9\]* = -1 \'.377\'" \
+gdb_test "print v_signed_char" ".\[0-9\]* = -1" \
     "set variable signed char=0xFF (0xFF)"
 #
 # 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 \'.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')" 
-test_set "set variable v_unsigned_char=97" "print v_unsigned_char" ".\[0-9\]* = 97 \'a\'"        "set variable unsigned char=97 ('a')" 
-test_set "set variable v_unsigned_char=126" "print v_unsigned_char" ".\[0-9\]* = 126 \'~\'"        "set variable unsigned char=126 ('~')" 
-test_set "set variable v_unsigned_char=~0" "print v_unsigned_char" ".\[0-9\]* = 255 \'.377\'"        "set variable unsigned char=255 (8-bit)" 
+test_set "set variable v_unsigned_char=0" "print v_unsigned_char" ".\[0-9\]* = 0"        "set variable unsigned char=0" 
+test_set "set variable v_unsigned_char=1" "print v_unsigned_char" ".\[0-9\]* = 1"        "set variable unsigned char=1" 
+test_set "set variable v_unsigned_char=7" "print v_unsigned_char" ".\[0-9\]* = 7"        "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"        "set variable unsigned char=65 ('A')" 
+test_set "set variable v_unsigned_char=97" "print v_unsigned_char" ".\[0-9\]* = 97"        "set variable unsigned char=97 ('a')" 
+test_set "set variable v_unsigned_char=126" "print v_unsigned_char" ".\[0-9\]* = 126"        "set variable unsigned char=126 ('~')" 
+test_set "set variable v_unsigned_char=~0" "print v_unsigned_char" ".\[0-9\]* = 255"        "set variable unsigned char=255 (8-bit)" 
 #
 # test "set variable" for type "short"
 #
@@ -233,11 +233,11 @@ test_set "set variable v_char_array\[0\]
 #
 # test "set variable" for "signed char array[2]"
 #
-test_set "set variable v_signed_char_array\[0\]='h'" "set variable v_signed_char_array\[1\]='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\\{104 'h', 105 'i'\\}"        "set variable signed char array=\"hi\" (string)" 
+test_set "set variable v_signed_char_array\[0\]='h'" "set variable v_signed_char_array\[1\]='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\\{104, 105\\}"        "set variable signed char array=\"hi\" (string)" 
 #
 # test "set variable" for "unsigned char array[2]"
 #
-test_set "set variable v_unsigned_char_array\[0\]='h'" "set variable v_unsigned_char_array\[1\]='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\\{104 'h', 105 'i'\\}"        "set variable unsigned char array=\"hi\" (string)" 
+test_set "set variable v_unsigned_char_array\[0\]='h'" "set variable v_unsigned_char_array\[1\]='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\\{104, 105\\}"        "set variable unsigned char array=\"hi\" (string)" 
 #
 # test "set variable" for "short array[2]"
 #
@@ -289,11 +289,11 @@ test_set "set v_char_pointer=v_char_arra
 #
 # test "set variable" for type "signed char *"
 #
-test_set "set v_signed_char_pointer=v_signed_char_array" "set variable *(v_signed_char_pointer)='h'" "set variable *(v_signed_char_pointer+1)='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\\{104 'h', 105 'i'\\}"  "print *(v_signed_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'"     "set variable signed char pointer=\"hi\" (string)" 
+test_set "set v_signed_char_pointer=v_signed_char_array" "set variable *(v_signed_char_pointer)='h'" "set variable *(v_signed_char_pointer+1)='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\\{104, 105\\}"  "print *(v_signed_char_pointer+1)" ".*.\[0-9\]* = 105"     "set variable signed char pointer=\"hi\" (string)" 
 #
 # test "set variable" for type "unsigned char *"
 #
-test_set "set v_unsigned_char_pointer=v_unsigned_char_array" "set variable *(v_unsigned_char_pointer)='h'" "set variable *(v_unsigned_char_pointer+1)='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\\{104 'h', 105 'i'\\}"  "print *(v_unsigned_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'"     "set variable unsigned char pointer=\"hi\" (string)" 
+test_set "set v_unsigned_char_pointer=v_unsigned_char_array" "set variable *(v_unsigned_char_pointer)='h'" "set variable *(v_unsigned_char_pointer+1)='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\\{104, 105\\}"  "print *(v_unsigned_char_pointer+1)" ".*.\[0-9\]* = 105"     "set variable unsigned char pointer=\"hi\" (string)" 
 #
 # test "set variable" for type "short *"
 #
Index: testsuite/gdb.base/store.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/store.exp,v
retrieving revision 1.7
diff -u -p -r1.7 store.exp
--- testsuite/gdb.base/store.exp	9 Jan 2007 17:59:11 -0000	1.7
+++ testsuite/gdb.base/store.exp	5 Jul 2007 13:27:43 -0000
@@ -75,7 +75,7 @@ proc check_set { t l r new add } {
 	"${prefix}; print incremented l, expecting ${add}"
 }
 
-check_set "charest" "-1 .*" "-2 .*" "4 ..004." "2 ..002."
+check_set "charest" "-1" "-2" "4" "2"
 check_set "short" "-1" "-2" "4" "2"
 check_set "int" "-1" "-2" "4" "2"
 check_set "long" "-1" "-2" "4" "2"
@@ -103,7 +103,7 @@ proc up_set { t l r new } {
 	"${prefix}; print new l, expecting ${new}"
 }
 
-up_set "charest" "-1 .*" "-2 .*" "4 ..004."
+up_set "charest" "-1" "-2" "4"
 up_set "short" "-1" "-2" "4"
 up_set "int" "-1" "-2" "4"
 up_set "long" "-1" "-2" "4"
Index: testsuite/gdb.cp/ctti.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/ctti.exp,v
retrieving revision 1.9
diff -u -p -r1.9 ctti.exp
--- testsuite/gdb.cp/ctti.exp	9 Jan 2007 17:59:11 -0000	1.9
+++ testsuite/gdb.cp/ctti.exp	5 Jul 2007 13:27:43 -0000
@@ -81,7 +81,7 @@ if ![runto_main] then {
 gdb_breakpoint [gdb_get_line_number "marker add1"]
 gdb_continue_to_breakpoint "marker add1"
 
-gdb_test "print c" "\\$\[0-9\]+ = 194 .*"
+gdb_test "print c" "\\$\[0-9\]+ = 194"
 gdb_test "print f" "\\$\[0-9\]+ = 9"
 gdb_test "print i" "\\$\[0-9\]+ = 4"
 
Index: testsuite/gdb.cp/gdb1355.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/gdb1355.exp,v
retrieving revision 1.3
diff -u -p -r1.3 gdb1355.exp
--- testsuite/gdb.cp/gdb1355.exp	9 Jan 2007 17:59:12 -0000	1.3
+++ testsuite/gdb.cp/gdb1355.exp	5 Jul 2007 13:27:43 -0000
@@ -105,7 +105,7 @@ gdb_test_multiple "ptype s1" "ptype s1" 
 }
 
 gdb_test_multiple "print s1" "print s1" {
-    -re "$decimal = \{m_int = 117, m_char = 97 'a', m_long_int = 118, m_unsigned_int = 119, m_long_unsigned_int = 120, m_short_int = 123, m_short_unsigned_int = 124, m_unsigned_char = 98 'b', m_float = 125, m_double = 126, m_long_double = 127, m_bool = true\}$nl$gdb_prompt $" {
+    -re "$decimal = \{m_int = 117, m_char = 97 'a', m_long_int = 118, m_unsigned_int = 119, m_long_unsigned_int = 120, m_short_int = 123, m_short_unsigned_int = 124, m_unsigned_char = 98, m_float = 125, m_double = 126, m_long_double = 127, m_bool = true\}$nl$gdb_prompt $" {
 	pass "print s1"
     }
     -re "$decimal = \{m_int = 117, m_char = 97 'a', m_long_int = 118, m_unsigned_int = 119, m_long_unsigned_int = 120, m_short_int = 123, m_short_unsigned_int = 124, m_unsigned_char = 98 'b', m_float = 125, m_double = 126, m_long_double = 127, m_bool = 117\}$nl$gdb_prompt $" {
Index: testsuite/gdb.cp/ovldbreak.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/ovldbreak.exp,v
retrieving revision 1.5
diff -u -p -r1.5 ovldbreak.exp
--- testsuite/gdb.cp/ovldbreak.exp	9 Jan 2007 17:59:12 -0000	1.5
+++ testsuite/gdb.cp/ovldbreak.exp	5 Jul 2007 13:27:43 -0000
@@ -340,8 +340,8 @@ 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 23 "signed char" "arg=3"
+continue_to_bp_overloaded 1 22 "unsigned char" "arg=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"
Index: testsuite/gdb.cp/ref-types.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/ref-types.exp,v
retrieving revision 1.5
diff -u -p -r1.5 ref-types.exp
--- testsuite/gdb.cp/ref-types.exp	9 Jan 2007 17:59:12 -0000	1.5
+++ testsuite/gdb.cp/ref-types.exp	5 Jul 2007 13:27:43 -0000
@@ -284,7 +284,7 @@ gdb_expect {
 
 send_gdb "print UC\n"
 gdb_expect {
-    -re ".\[0-9\]* = 21 '\.025'\.*$gdb_prompt $" {
+    -re ".\[0-9\]* = 21.*$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 \'.025\'.*$gdb_prompt $" {
+    -re ".\[0-9\]* = \\(unsigned char &\\) @$hex: 21.*$gdb_prompt $" {
         pass "print value of rUC"
       }
     -re ".*$gdb_prompt $" { fail "print value of rUC" }


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

* Re: [RFC] Changes to signed char and unsigned char handling
  2007-07-05 13:54 [RFC] Changes to signed char and unsigned char handling Daniel Jacobowitz
@ 2007-07-06 10:33 ` Eli Zaretskii
  2007-07-06 21:34   ` Daniel Jacobowitz
  2007-07-06 23:26   ` Nick Roberts
  2007-08-25  1:18 ` Daniel Jacobowitz
  1 sibling, 2 replies; 13+ messages in thread
From: Eli Zaretskii @ 2007-07-06 10:33 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> Date: Thu, 5 Jul 2007 09:54:02 -0400
> From: Daniel Jacobowitz <drow@false.org>
> 
>  3.  Treat "char" as a character, but "unsigned char" and "signed char"
>  as numbers

Didn't RMS object to this change?

> Then I updated NEWS, the manual, and the testsuite to match.  What do
> you think - is this an appropriate resolution for GDB 6.7?  All
> comments welcome.

The change for NEWS is okay with me.

The changes for the manual are also okay, but I have a few
comments/requests:

> +@item s
> +@cindex printing strings

Please add here a @cindex entry for something like ``printing byte
arrays''.

> +as strings.  @code{unsigned char} and @code{signed char} are displayed as

Please include multi-word @code-marked-up text in @w.

> @@ -5932,8 +5946,7 @@ displays you request manually using @cod
>  specify the output format you prefer; in fact, @code{display} decides
>  whether to use @code{print} or @code{x} depending on how elaborate your
>  format specification is---it uses @code{x} if you specify a unit size,
> -or one of the two formats (@samp{i} and @samp{s}) that are only
> -supported by @code{x}; otherwise it uses @code{print}.
> +the @samp{i} format, or the @samp{s} format; otherwise it uses @code{print}.

This change produces a sentence that is hard to parse:

  in fact, @code{display} decides
  whether to use @code{print} or @code{x} depending on how elaborate your
  format specification is---it uses @code{x} if you specify a unit size,
  the @samp{i} format, or the @samp{s} format; otherwise it uses @code{print}.

The conditions under which `x' is used are described, but the
conditions under which we use `i' or `s' are left unspecified.

The old text was a bit better, I think, but only a bit:

  in fact, @code{display} decides
  whether to use @code{print} or @code{x} depending on how elaborate your
  format specification is---it uses @code{x} if you specify a unit size,
  or one of the two formats (@samp{i} and @samp{s}) that are only
  supported by @code{x}; otherwise it uses @code{print}.

In addition, the beginning of the sentence promises some relation
between the format used and how elaborate is the format specification,
but that relation is left somewhat unclear (this was unclear in the
old text as well).  I'm guessing that the only relation is whether the
unit size is or is not specified, but if that's indeed the only
relation, we should make the text less general and talk explicitly
about unit size specification.

Thanks.


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

* Re: [RFC] Changes to signed char and unsigned char handling
  2007-07-06 10:33 ` Eli Zaretskii
@ 2007-07-06 21:34   ` Daniel Jacobowitz
  2007-07-07 10:04     ` Eli Zaretskii
  2007-07-06 23:26   ` Nick Roberts
  1 sibling, 1 reply; 13+ messages in thread
From: Daniel Jacobowitz @ 2007-07-06 21:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

On Fri, Jul 06, 2007 at 01:33:24PM +0300, Eli Zaretskii wrote:
> > Date: Thu, 5 Jul 2007 09:54:02 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> > 
> >  3.  Treat "char" as a character, but "unsigned char" and "signed char"
> >  as numbers
> 
> Didn't RMS object to this change?

His objection was to the original change, which is currently in HEAD,
to not print "unsigned char *" variables as strings.  It was not an
especially definitive objection; I think that this version is better
than the behavior of earlier versions of GDB, which would satisfy his
stated concern.

I'm willing to change my mind on the approach; that's why it's an RFC
:-)

> The changes for the manual are also okay, but I have a few
> comments/requests:

Thank you, as usual.  I will incorporate your suggestions.

> > @@ -5932,8 +5946,7 @@ displays you request manually using @cod
> >  specify the output format you prefer; in fact, @code{display} decides
> >  whether to use @code{print} or @code{x} depending on how elaborate your
> >  format specification is---it uses @code{x} if you specify a unit size,
> > -or one of the two formats (@samp{i} and @samp{s}) that are only
> > -supported by @code{x}; otherwise it uses @code{print}.
> > +the @samp{i} format, or the @samp{s} format; otherwise it uses @code{print}.
> 
> This change produces a sentence that is hard to parse:
> 
>   in fact, @code{display} decides
>   whether to use @code{print} or @code{x} depending on how elaborate your
>   format specification is---it uses @code{x} if you specify a unit size,
>   the @samp{i} format, or the @samp{s} format; otherwise it uses @code{print}.
> 
> The conditions under which `x' is used are described, but the
> conditions under which we use `i' or `s' are left unspecified.

We don't use `i' or `s'; the use of `i' or `s' in the user's format
specification causes `display' to behave like `examine' instead of
like `print'.  How is this?

   in fact, @code{display} decides
   whether to use @code{print} or @code{x} depending on your format
   specification---@code{display} uses @code{x} if you specify a unit size,
   the @samp{i} format, or the @samp{s} format; otherwise it uses @code{print}.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: [RFC] Changes to signed char and unsigned char handling
  2007-07-06 10:33 ` Eli Zaretskii
  2007-07-06 21:34   ` Daniel Jacobowitz
@ 2007-07-06 23:26   ` Nick Roberts
  2007-07-06 23:46     ` Daniel Jacobowitz
  1 sibling, 1 reply; 13+ messages in thread
From: Nick Roberts @ 2007-07-06 23:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Daniel Jacobowitz, gdb-patches

 > >  3.  Treat "char" as a character, but "unsigned char" and "signed char"
 > >  as numbers
 > 
 > Didn't RMS object to this change?

He just said:

  Which GDB behavior is better is a matter of how often each one is
  convenient and how often it causes trouble.  I don't know enough to
  have an opinion about that, but if neither one is clearly better
  overall, it would be best to leave GDB the way it was.

mathieu lacage also said:

  I don't know how useful that is to you but a lot of people (the first
  which comes to my mind is libxml2) decided to use "unsigned char *" to
  identify utf-8 encoded strings in C.

I don't know if this is related to the appearance of xml-builtin.c:

static const char xml_feature_gdb_target_dtd[] = {
  '<', '!', '-', '-', ' ', 'C', 'o', 'p', 'y', 'r', 
   'i', 'g', 'h', 't', ' ', '(', 'C', ')', ' ', '2', 
...

Personally, I'm not worried by this change as my usage has a workaround.

-- 
Nick                                           http://www.inet.net.nz/~nickrob


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

* Re: [RFC] Changes to signed char and unsigned char handling
  2007-07-06 23:26   ` Nick Roberts
@ 2007-07-06 23:46     ` Daniel Jacobowitz
  0 siblings, 0 replies; 13+ messages in thread
From: Daniel Jacobowitz @ 2007-07-06 23:46 UTC (permalink / raw)
  To: Nick Roberts; +Cc: Eli Zaretskii, gdb-patches

On Sat, Jul 07, 2007 at 11:26:36AM +1200, Nick Roberts wrote:
> I don't know if this is related to the appearance of xml-builtin.c:

Nope.  That was just easier than dealing with compilers' string length
limitations.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: [RFC] Changes to signed char and unsigned char handling
  2007-07-06 21:34   ` Daniel Jacobowitz
@ 2007-07-07 10:04     ` Eli Zaretskii
  2007-07-07 17:06       ` Daniel Jacobowitz
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2007-07-07 10:04 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> Date: Fri, 6 Jul 2007 17:34:08 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sourceware.org
> 
> > Didn't RMS object to this change?
> 
> His objection was to the original change, which is currently in HEAD,
> to not print "unsigned char *" variables as strings.  It was not an
> especially definitive objection; I think that this version is better
> than the behavior of earlier versions of GDB, which would satisfy his
> stated concern.

Well, maybe we should ask for his opinion on your suggested patch.

> > The conditions under which `x' is used are described, but the
> > conditions under which we use `i' or `s' are left unspecified.
> 
> We don't use `i' or `s'; the use of `i' or `s' in the user's format
> specification causes `display' to behave like `examine' instead of
> like `print'.  How is this?
> 
>    in fact, @code{display} decides
>    whether to use @code{print} or @code{x} depending on your format
>    specification---@code{display} uses @code{x} if you specify a unit size,
>    the @samp{i} format, or the @samp{s} format; otherwise it uses @code{print}.

Aha, I see that I was doubly confused.  So maybe this is more clear
yet:

   in fact, @code{display} decides
   whether to use @code{print} or @code{x} depending on your format
   specification---it uses @code{x} if you specify either the @samp{i}
   or @samp{s} format, or a unit size; otherwise it uses @code{print}.


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

* Re: [RFC] Changes to signed char and unsigned char handling
  2007-07-07 10:04     ` Eli Zaretskii
@ 2007-07-07 17:06       ` Daniel Jacobowitz
  0 siblings, 0 replies; 13+ messages in thread
From: Daniel Jacobowitz @ 2007-07-07 17:06 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

On Sat, Jul 07, 2007 at 01:03:51PM +0300, Eli Zaretskii wrote:
> > Date: Fri, 6 Jul 2007 17:34:08 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> > Cc: gdb-patches@sourceware.org
> > 
> > > Didn't RMS object to this change?
> > 
> > His objection was to the original change, which is currently in HEAD,
> > to not print "unsigned char *" variables as strings.  It was not an
> > especially definitive objection; I think that this version is better
> > than the behavior of earlier versions of GDB, which would satisfy his
> > stated concern.
> 
> Well, maybe we should ask for his opinion on your suggested patch.

If it's all right with you, I'll leave this up to you.  I've no
complaints about asking his opinion, but I don't really think it's
necessary either.

> > We don't use `i' or `s'; the use of `i' or `s' in the user's format
> > specification causes `display' to behave like `examine' instead of
> > like `print'.  How is this?
> > 
> >    in fact, @code{display} decides
> >    whether to use @code{print} or @code{x} depending on your format
> >    specification---@code{display} uses @code{x} if you specify a unit size,
> >    the @samp{i} format, or the @samp{s} format; otherwise it uses @code{print}.
> 
> Aha, I see that I was doubly confused.  So maybe this is more clear
> yet:
> 
>    in fact, @code{display} decides
>    whether to use @code{print} or @code{x} depending on your format
>    specification---it uses @code{x} if you specify either the @samp{i}
>    or @samp{s} format, or a unit size; otherwise it uses @code{print}.

This version's fine with me.  Thanks again.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: [RFC] Changes to signed char and unsigned char handling
  2007-07-05 13:54 [RFC] Changes to signed char and unsigned char handling Daniel Jacobowitz
  2007-07-06 10:33 ` Eli Zaretskii
@ 2007-08-25  1:18 ` Daniel Jacobowitz
  2007-08-25 10:19   ` Eli Zaretskii
  2007-09-03 17:53   ` Daniel Jacobowitz
  1 sibling, 2 replies; 13+ messages in thread
From: Daniel Jacobowitz @ 2007-08-25  1:18 UTC (permalink / raw)
  To: gdb-patches

On Thu, Jul 05, 2007 at 09:54:02AM -0400, Daniel Jacobowitz wrote:
> This patch is a follow-up to Jan's patch to change the behavior of
> "print" for uint8_t.  It follows option #3 from my earlier mail on
> this subject:
> 
>  3.  Treat "char" as a character, but "unsigned char" and "signed char"
>  as numbers (Jan's patch started down this road and Jim's went a bit
>  further).  Treat pointers/arrays of char as strings and
>  pointers/arrays of unsigned or signed char as numbers.  Add a "/s"
>  flag to the print command that treats single byte types as
>  characters or strings.
> 
>  (From: http://sourceware.org/ml/gdb/2007-04/msg00057.html )

Here's option 1 instead:

1.  Make vector types special.  Treat arrays of single byte integers
as characters, like before, unless they occur in a vector type.  This
is reasonable, but tricky to implement.

It restores the historic behavior for unsigned char and signed char.
Only the behavior of vector registers has changed.  You basically
never want to print these as strings, but since I had already
implemented print/s I kept it.

Comments?  Mark, is this better?

-- 
Daniel Jacobowitz
CodeSourcery

2007-07-05  Daniel Jacobowitz  <dan@codesourcery.com>
	    Jim Blandy  <jimb@codesourcery.com>

	* NEWS: Update description of string changes.  Mention print/s.
	* c-valprint.c (textual_element_type): New.
	(c_val_print): Use it.  Do not skip address printing for pointers
	with a string format.
	(c_value_print): Doc update.
	* dwarf2read.c (read_array_type): Use make_vector_type.
	* gdbtypes.c (make_vector_type): New.
	(init_vector_type): Use it.
	(gdbtypes_post_init): Initialize builtin_true_unsigned_char.
	(_initialize_gdbtypes): Mark int8_t and uint8_t as TYPE_FLAG_NOTTEXT.
	* gdbtypes.h (struct builtin_type): Add builtin_true_unsigned_char.
	(TYPE_FLAG_NOTTEXT, TYPE_NOTTEXT): New.
	(make_vector_type): New.
	* printcmd.c (print_formatted): Only handle 's' and 'i' for examine.
	Call the language print routine for string format.
	(print_scalar_formatted): Call val_print for string format.  Handle
	unsigned original types for char format.
	(validate_format): Do not reject string format.
	* stabsread.c (read_type): Use make_vector_type.
	* xml-tdesc.c (tdesc_start_vector): Use init_vector_type.

	* gdb.texinfo (Output Formats): Update 'c' description.  Describe 's'.
	(Examining Memory): Update mentions of the 's' format.
	(Automatic Display): Likewise.

	* gdb.arch/i386-sse.exp: Do not expect character constants.
	* gdb.base/charsign.c, gdb.base/charsign.exp: Delete.
	* gdb.base/display.exp: Allow print/s.
	* gdb.base/printcmds.exp, gdb.base/setvar.exp: Revert signed
	and unsigned char array changes.

Index: NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.235
diff -u -p -r1.235 NEWS
--- NEWS	17 Jul 2007 12:51:40 -0000	1.235
+++ NEWS	25 Aug 2007 01:08:23 -0000
@@ -23,8 +23,12 @@ frequency signals (e.g. SIGALRM) via the
 target's overall architecture.  GDB can read a description from
 a local file or over the remote serial protocol.
 
-* Arrays of explicitly SIGNED or UNSIGNED CHARs are now printed as arrays
-of numbers.
+* Vectors of single-byte data use a new integer type which is not
+automatically displayed as character or string data.
+
+* The /s format now works with the print command.  It displays
+arrays of single-byte integers and pointers to single-byte integers
+as strings.
 
 * Target descriptions can now describe target-specific registers,
 for architectures which have implemented the support (currently
Index: c-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/c-valprint.c,v
retrieving revision 1.44
diff -u -p -r1.44 c-valprint.c
--- c-valprint.c	23 Aug 2007 18:08:27 -0000	1.44
+++ c-valprint.c	25 Aug 2007 01:08:23 -0000
@@ -54,6 +54,52 @@ print_function_pointer_address (CORE_ADD
 }
 
 
+/* Apply a heuristic to decide whether an array of TYPE or a pointer
+   to TYPE should be printed as a textual string.  Return non-zero if
+   it should, or zero if it should be treated as an array of integers
+   or pointer to integers.  FORMAT is the current format letter,
+   or 0 if none.
+
+   We guess that "char" is a character.  Explicitly signed and
+   unsigned character types are also characters.  Integer data from
+   vector types is not.  The user can override this by using the /s
+   format letter.  */
+
+static int
+textual_element_type (struct type *type, char format)
+{
+  struct type *true_type = check_typedef (type);
+
+  if (format != 0 && format != 's')
+    return 0;
+
+  /* TYPE_CODE_CHAR is always textual.  */
+  if (TYPE_CODE (true_type) == TYPE_CODE_CHAR)
+    return 1;
+
+  if (format == 's')
+    {
+      /* Print this as a string if we can manage it.  For now, no
+	 wide character support.  */
+      if (TYPE_CODE (true_type) == TYPE_CODE_INT
+	  && TYPE_LENGTH (true_type) == 1)
+	return 1;
+    }
+  else
+    {
+      /* If a one-byte TYPE_CODE_INT is missing the not-a-character
+	 flag, then we treat it as text; otherwise, we assume it's
+	 being used as data.  */
+      if (TYPE_CODE (true_type) == TYPE_CODE_INT
+	  && TYPE_LENGTH (true_type) == 1
+	  && !TYPE_NOTTEXT (true_type))
+	return 1;
+    }
+
+  return 0;
+}
+
+
 /* Print data of type TYPE located at VALADDR (within GDB), which came from
    the inferior at address ADDRESS, onto stdio stream STREAM according to
    FORMAT (a letter or 0 for natural format).  The data at VALADDR is in
@@ -92,12 +138,9 @@ c_val_print (struct type *type, const gd
 	    {
 	      print_spaces_filtered (2 + 2 * recurse, stream);
 	    }
-	  /* For an array of chars, print with string syntax.  */
-	  if (eltlen == 1 &&
-	      ((TYPE_CODE (elttype) == TYPE_CODE_INT && TYPE_NOSIGN (elttype))
-	       || ((current_language->la_language == language_m2)
-		   && (TYPE_CODE (elttype) == TYPE_CODE_CHAR)))
-	      && (format == 0 || format == 's'))
+
+	  /* Print arrays of textual chars with a string syntax.  */
+          if (textual_element_type (elttype, format))
 	    {
 	      /* If requested, look for the first null char and only print
 	         elements up to it.  */
@@ -184,19 +227,16 @@ c_val_print (struct type *type, const gd
 	      return (0);
 	    }
 
-	  if (addressprint && format != 's')
+	  if (addressprint)
 	    {
 	      deprecated_print_address_numeric (addr, 1, stream);
 	    }
 
-	  /* For a pointer to char or unsigned char, also print the string
+	  /* For a pointer to a textual type, also print the string
 	     pointed to, unless pointer is null.  */
 	  /* FIXME: need to handle wchar_t here... */
 
-	  if (TYPE_LENGTH (elttype) == 1
-	      && TYPE_CODE (elttype) == TYPE_CODE_INT
-	      && (format == 0 || format == 's')
-	      && addr != 0)
+	  if (textual_element_type (elttype, format) && addr != 0)
 	    {
 	      i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream);
 	    }
@@ -395,8 +435,8 @@ c_val_print (struct type *type, const gd
 	  /* C and C++ has no single byte int type, char is used instead.
 	     Since we don't know whether the value is really intended to
 	     be used as an integer or a character, print the character
-	     equivalent as well. */
-	  if (TYPE_LENGTH (type) == 1)
+	     equivalent as well.  */
+	  if (textual_element_type (type, format))
 	    {
 	      fputs_filtered (" ", stream);
 	      LA_PRINT_CHAR ((unsigned char) unpack_long (type, valaddr + embedded_offset),
@@ -498,7 +538,9 @@ c_value_print (struct value *val, struct
       || TYPE_CODE (type) == TYPE_CODE_REF)
     {
       /* Hack:  remove (char *) for char strings.  Their
-         type is indicated by the quoted string anyway. */
+         type is indicated by the quoted string anyway.
+         (Don't use textual_element_type here; quoted strings
+         are always exactly (char *).  */
       if (TYPE_CODE (type) == TYPE_CODE_PTR
 	  && TYPE_NAME (type) == NULL
 	  && TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.230
diff -u -p -r1.230 dwarf2read.c
--- dwarf2read.c	23 Aug 2007 18:08:28 -0000	1.230
+++ dwarf2read.c	25 Aug 2007 01:08:24 -0000
@@ -4325,7 +4325,7 @@ read_array_type (struct die_info *die, s
      to functions.  */
   attr = dwarf2_attr (die, DW_AT_GNU_vector, cu);
   if (attr)
-    TYPE_FLAGS (type) |= TYPE_FLAG_VECTOR;
+    make_vector_type (type);
 
   attr = dwarf2_attr (die, DW_AT_name, cu);
   if (attr && DW_STRING (attr))
Index: gdbtypes.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.c,v
retrieving revision 1.133
diff -u -p -r1.133 gdbtypes.c
--- gdbtypes.c	23 Aug 2007 18:08:33 -0000	1.133
+++ gdbtypes.c	25 Aug 2007 01:08:24 -0000
@@ -917,6 +917,32 @@ init_flags_type (char *name, int length)
   return type;
 }
 
+/* Convert ARRAY_TYPE to a vector type.  This may modify ARRAY_TYPE
+   and any array types nested inside it.  */
+
+void
+make_vector_type (struct type *array_type)
+{
+  struct type *inner_array, *elt_type;
+  int flags;
+
+  /* Find the innermost array type, in case the array is
+     multi-dimensional.  */
+  inner_array = array_type;
+  while (TYPE_CODE (TYPE_TARGET_TYPE (inner_array)) == TYPE_CODE_ARRAY)
+    inner_array = TYPE_TARGET_TYPE (inner_array);
+
+  elt_type = TYPE_TARGET_TYPE (inner_array);
+  if (TYPE_CODE (elt_type) == TYPE_CODE_INT)
+    {
+      flags = TYPE_INSTANCE_FLAGS (elt_type) | TYPE_FLAG_NOTTEXT;
+      elt_type = make_qualified_type (elt_type, flags, NULL);
+      TYPE_TARGET_TYPE (inner_array) = elt_type;
+    }
+
+  TYPE_FLAGS (array_type) |= TYPE_FLAG_VECTOR;
+}
+
 struct type *
 init_vector_type (struct type *elt_type, int n)
 {
@@ -926,7 +952,7 @@ init_vector_type (struct type *elt_type,
 				  create_range_type (0, 
 						     builtin_type_int,
 						     0, n-1));
-  TYPE_FLAGS (array_type) |= TYPE_FLAG_VECTOR;
+  make_vector_type (array_type);
   return array_type;
 }
 
@@ -3410,6 +3436,10 @@ gdbtypes_post_init (struct gdbarch *gdba
     init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
 	       0,
 	       "true character", (struct objfile *) NULL);
+  builtin_type->builtin_true_unsigned_char =
+    init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+	       TYPE_FLAG_UNSIGNED,
+	       "true character", (struct objfile *) NULL);
   builtin_type->builtin_signed_char =
     init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
 	       0,
@@ -3557,11 +3587,11 @@ _initialize_gdbtypes (void)
 	       "int0_t", (struct objfile *) NULL);
   builtin_type_int8 =
     init_type (TYPE_CODE_INT, 8 / 8,
-	       0,
+	       TYPE_FLAG_NOTTEXT,
 	       "int8_t", (struct objfile *) NULL);
   builtin_type_uint8 =
     init_type (TYPE_CODE_INT, 8 / 8,
-	       TYPE_FLAG_UNSIGNED,
+	       TYPE_FLAG_UNSIGNED | TYPE_FLAG_NOTTEXT,
 	       "uint8_t", (struct objfile *) NULL);
   builtin_type_int16 =
     init_type (TYPE_CODE_INT, 16 / 8,
Index: gdbtypes.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.h,v
retrieving revision 1.77
diff -u -p -r1.77 gdbtypes.h
--- gdbtypes.h	23 Aug 2007 18:08:33 -0000	1.77
+++ gdbtypes.h	25 Aug 2007 01:08:24 -0000
@@ -325,6 +325,12 @@ enum type_code
 #define TYPE_FLAG_STUB_SUPPORTED (1 << 16)
 #define TYPE_STUB_SUPPORTED(t)   (TYPE_FLAGS (t) & TYPE_FLAG_STUB_SUPPORTED)
 
+/* Not textual.  By default, GDB treats all single byte integers as
+   characters (or elements of strings) unless this flag is set.  */
+
+#define TYPE_FLAG_NOTTEXT	(1 << 17)
+#define TYPE_NOTTEXT(t)		(TYPE_FLAGS (t) & TYPE_FLAG_NOTTEXT)
+
 /*  Array bound type.  */
 enum array_bound_type
 {
@@ -1009,10 +1015,11 @@ struct builtin_type
 
   /* Integral types.  */
 
-  /* We use this for the '/c' print format, because c_char is just a
+  /* We use these for the '/c' print format, because c_char is just a
      one-byte integral type, which languages less laid back than C
      will print as ... well, a one-byte integral type.  */
   struct type *builtin_true_char;
+  struct type *builtin_true_unsigned_char;
 
   /* Implicit size/sign (based on the the architecture's ABI).  */
   struct type *builtin_void;
@@ -1261,6 +1268,7 @@ extern void append_composite_type_field 
 extern struct type *init_flags_type (char *name, int length);
 extern void append_flags_type_flag (struct type *type, int bitpos, char *name);
 
+extern void make_vector_type (struct type *array_type);
 extern struct type *init_vector_type (struct type *elt_type, int n);
 
 extern struct type *lookup_reference_type (struct type *);
Index: printcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/printcmd.c,v
retrieving revision 1.109
diff -u -p -r1.109 printcmd.c
--- printcmd.c	23 Aug 2007 18:08:36 -0000	1.109
+++ printcmd.c	25 Aug 2007 01:08:24 -0000
@@ -250,7 +250,8 @@ decode_format (char **string_ptr, int of
    Do not end with a newline.
    0 means print VAL according to its own type.
    SIZE is the letter for the size of datum being printed.
-   This is used to pad hex numbers so they line up.  */
+   This is used to pad hex numbers so they line up.  SIZE is 0
+   for print / output and set for examine.  */
 
 static void
 print_formatted (struct value *val, int format, int size,
@@ -262,45 +263,41 @@ print_formatted (struct value *val, int 
   if (VALUE_LVAL (val) == lval_memory)
     next_address = VALUE_ADDRESS (val) + len;
 
-  switch (format)
+  if (size)
     {
-    case 's':
-      /* FIXME: Need to handle wchar_t's here... */
-      next_address = VALUE_ADDRESS (val)
-	+ val_print_string (VALUE_ADDRESS (val), -1, 1, stream);
-      break;
-
-    case 'i':
-      /* The old comment says
-         "Force output out, print_insn not using _filtered".
-         I'm not completely sure what that means, I suspect most print_insn
-         now do use _filtered, so I guess it's obsolete.
-         --Yes, it does filter now, and so this is obsolete.  -JB  */
-
-      /* We often wrap here if there are long symbolic names.  */
-      wrap_here ("    ");
-      next_address = (VALUE_ADDRESS (val)
-		      + gdb_print_insn (VALUE_ADDRESS (val), stream,
-					&branch_delay_insns));
-      break;
+      switch (format)
+	{
+	case 's':
+	  /* FIXME: Need to handle wchar_t's here... */
+	  next_address = VALUE_ADDRESS (val)
+	    + val_print_string (VALUE_ADDRESS (val), -1, 1, stream);
+	  return;
 
-    default:
-      if (format == 0
-	  || TYPE_CODE (type) == TYPE_CODE_ARRAY
-	  || TYPE_CODE (type) == TYPE_CODE_STRING
-	  || TYPE_CODE (type) == TYPE_CODE_STRUCT
-	  || TYPE_CODE (type) == TYPE_CODE_UNION
-	  || TYPE_CODE (type) == TYPE_CODE_NAMESPACE)
-	/* If format is 0, use the 'natural' format for that type of
-	   value.  If the type is non-scalar, we have to use language
-	   rules to print it as a series of scalars.  */
-	value_print (val, stream, format, Val_pretty_default);
-      else
-	/* User specified format, so don't look to the the type to
-	   tell us what to do.  */
-	print_scalar_formatted (value_contents (val), type,
-				format, size, stream);
+	case 'i':
+	  /* We often wrap here if there are long symbolic names.  */
+	  wrap_here ("    ");
+	  next_address = (VALUE_ADDRESS (val)
+			  + gdb_print_insn (VALUE_ADDRESS (val), stream,
+					    &branch_delay_insns));
+	  return;
+	}
     }
+
+  if (format == 0 || format == 's'
+      || TYPE_CODE (type) == TYPE_CODE_ARRAY
+      || TYPE_CODE (type) == TYPE_CODE_STRING
+      || TYPE_CODE (type) == TYPE_CODE_STRUCT
+      || TYPE_CODE (type) == TYPE_CODE_UNION
+      || TYPE_CODE (type) == TYPE_CODE_NAMESPACE)
+    /* If format is 0, use the 'natural' format for that type of
+       value.  If the type is non-scalar, we have to use language
+       rules to print it as a series of scalars.  */
+    value_print (val, stream, format, Val_pretty_default);
+  else
+    /* User specified format, so don't look to the the type to
+       tell us what to do.  */
+    print_scalar_formatted (value_contents (val), type,
+			    format, size, stream);
 }
 
 /* Print a scalar of data of type TYPE, pointed to in GDB by VALADDR,
@@ -317,6 +314,15 @@ print_scalar_formatted (const void *vala
   LONGEST val_long = 0;
   unsigned int len = TYPE_LENGTH (type);
 
+  /* If we get here with a string format, try again without it.  Go
+     all the way back to the language printers, which may call us
+     again.  */
+  if (format == 's')
+    {
+      val_print (type, valaddr, 0, 0, stream, 0, 0, 0, Val_pretty_default);
+      return;
+    }
+
   if (len > sizeof(LONGEST) &&
       (TYPE_CODE (type) == TYPE_CODE_INT
        || TYPE_CODE (type) == TYPE_CODE_ENUM))
@@ -407,8 +413,17 @@ print_scalar_formatted (const void *vala
       break;
 
     case 'c':
-      value_print (value_from_longest (builtin_type_true_char, val_long),
-		   stream, 0, Val_pretty_default);
+      if (TYPE_UNSIGNED (type))
+	{
+	  struct type *utype;
+
+	  utype = builtin_type (current_gdbarch)->builtin_true_unsigned_char;
+	  value_print (value_from_longest (utype, val_long),
+		       stream, 0, Val_pretty_default);
+	}
+      else
+	value_print (value_from_longest (builtin_type_true_char, val_long),
+		     stream, 0, Val_pretty_default);
       break;
 
     case 'f':
@@ -809,7 +824,7 @@ validate_format (struct format_data fmt,
   if (fmt.count != 1)
     error (_("Item count other than 1 is meaningless in \"%s\" command."),
 	   cmdname);
-  if (fmt.format == 'i' || fmt.format == 's')
+  if (fmt.format == 'i')
     error (_("Format letter \"%c\" is meaningless in \"%s\" command."),
 	   fmt.format, cmdname);
 }
Index: stabsread.c
===================================================================
RCS file: /cvs/src/src/gdb/stabsread.c,v
retrieving revision 1.97
diff -u -p -r1.97 stabsread.c
--- stabsread.c	23 Aug 2007 18:08:38 -0000	1.97
+++ stabsread.c	25 Aug 2007 01:08:25 -0000
@@ -1914,7 +1914,7 @@ again:
       if (is_string)
 	TYPE_CODE (type) = TYPE_CODE_STRING;
       if (is_vector)
-	TYPE_FLAGS (type) |= TYPE_FLAG_VECTOR;
+	make_vector_type (type);
       break;
 
     case 'S':			/* Set or bitstring  type */
Index: xml-tdesc.c
===================================================================
RCS file: /cvs/src/src/gdb/xml-tdesc.c,v
retrieving revision 1.8
diff -u -p -r1.8 xml-tdesc.c
--- xml-tdesc.c	23 Aug 2007 18:08:47 -0000	1.8
+++ xml-tdesc.c	25 Aug 2007 01:08:25 -0000
@@ -277,13 +277,9 @@ tdesc_start_vector (struct gdb_xml_parse
     gdb_xml_error (parser, _("Vector \"%s\" references undefined type \"%s\""),
 		   id, field_type_id);
 
-  /* A vector is just an array plus a special flag.  */
-  range_type = create_range_type (NULL, builtin_type_int, 0, count - 1);
-  type = create_array_type (NULL, field_type, range_type);
+  type = init_vector_type (field_type, count);
   TYPE_NAME (type) = xstrdup (id);
 
-  TYPE_FLAGS (type) |= TYPE_FLAG_VECTOR;
-
   tdesc_record_type (data->current_feature, type);
 }
 
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.423
diff -u -p -r1.423 gdb.texinfo
--- doc/gdb.texinfo	21 Aug 2007 15:09:59 -0000	1.423
+++ doc/gdb.texinfo	25 Aug 2007 01:08:27 -0000
@@ -5769,9 +5769,27 @@ prints both the numerical value and its 
 character representation is replaced with the octal escape @samp{\nnn}
 for characters outside the 7-bit @sc{ascii} range.
 
+Without this format, @value{GDBN} displays @code{char},
+@w{@code{unsigned char}}, and @w{@code{signed char}} data as character
+constants.  Single-byte members of vectors are displayed as integer
+data.
+
 @item f
 Regard the bits of the value as a floating point number and print
 using typical floating point syntax.
+
+@item s
+@cindex printing strings
+@cindex printing byte arrays
+Regard as a string, if possible.  With this format, pointers to single-byte
+data are displayed as null-terminated strings and arrays of single-byte data
+are displayed as fixed-length strings.  Other values are displayed in their
+natural types.
+
+Without this format, @value{GDBN} displays pointers to and arrays of
+@code{char}, @w{@code{unsigned char}}, and @w{@code{signed char}} as
+strings.  Single-byte members of a vector are displayed as an integer
+array.
 @end table
 
 For example, to print the program counter in hex (@pxref{Registers}), type
@@ -5819,10 +5837,9 @@ how much memory (counting by units @var{
 @item @var{f}, the display format
 The display format is one of the formats used by @code{print}
 (@samp{x}, @samp{d}, @samp{u}, @samp{o}, @samp{t}, @samp{a}, @samp{c},
-@samp{f}), and in addition @samp{s} (for null-terminated strings) and
-@samp{i} (for machine instructions).  The default is @samp{x}
-(hexadecimal) initially.  The default changes each time you use either
-@code{x} or @code{print}.
+@samp{f}, @samp{s}), and in addition @samp{i} (for machine instructions).
+The default is @samp{x} (hexadecimal) initially.  The default changes
+each time you use either @code{x} or @code{print}.
 
 @item @var{u}, the unit size
 The unit size is any of
@@ -5938,10 +5955,9 @@ The automatic display looks like this:
 This display shows item numbers, expressions and their current values.  As with
 displays you request manually using @code{x} or @code{print}, you can
 specify the output format you prefer; in fact, @code{display} decides
-whether to use @code{print} or @code{x} depending on how elaborate your
-format specification is---it uses @code{x} if you specify a unit size,
-or one of the two formats (@samp{i} and @samp{s}) that are only
-supported by @code{x}; otherwise it uses @code{print}.
+whether to use @code{print} or @code{x} depending your format
+specification---it uses @code{x} if you specify either the @samp{i}
+or @samp{s} format, or a unit size; otherwise it uses @code{print}.
 
 @table @code
 @kindex display
Index: testsuite/gdb.arch/i386-sse.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.arch/i386-sse.exp,v
retrieving revision 1.7
diff -u -p -r1.7 i386-sse.exp
--- testsuite/gdb.arch/i386-sse.exp	23 Aug 2007 18:14:16 -0000	1.7
+++ testsuite/gdb.arch/i386-sse.exp	25 Aug 2007 01:08:27 -0000
@@ -84,7 +84,7 @@ foreach r {0 1 2 3 4 5 6 7} {
         ".. = \\{$r, $r.25, $r.5, $r.75\\}.*" \
         "check float contents of %xmm$r"
     gdb_test "print \$xmm$r.v16_int8" \
-        ".. = \\{(-?\[0-9\]+ '.*', ){15}-?\[0-9\]+ '.*'\\}.*" \
+        ".. = \\{(-?\[0-9\]+, ){15}-?\[0-9\]+\\}.*" \
         "check int8 contents of %xmm$r"
 }
 
Index: testsuite/gdb.base/charsign.c
===================================================================
RCS file: testsuite/gdb.base/charsign.c
diff -N testsuite/gdb.base/charsign.c
--- testsuite/gdb.base/charsign.c	23 Aug 2007 18:08:49 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,36 +0,0 @@
-/* This testcase is part of GDB, the GNU debugger.
-
-   Copyright 2007 Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-   Please email any bugs, comments, and/or additions to this file to:
-   bug-gdb@prep.ai.mit.edu  */
-
-int main()
-{
-  return 0;
-}
-
-char n[]="A";
-signed char s[]="A";
-unsigned char u[]="A";
-
-typedef char char_n;
-typedef signed char char_s;
-typedef unsigned char char_u;
-
-char_n n_typed[]="A";
-char_s s_typed[]="A";
-char_u u_typed[]="A";
Index: testsuite/gdb.base/charsign.exp
===================================================================
RCS file: testsuite/gdb.base/charsign.exp
diff -N testsuite/gdb.base/charsign.exp
--- testsuite/gdb.base/charsign.exp	23 Aug 2007 18:14:16 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,67 +0,0 @@
-# Copyright 2007 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-if $tracelevel then {
-    strace $tracelevel
-}
-
-set prms_id 0
-set bug_id 0
-
-set testfile charsign
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-
-proc do_test { cflags } {
-    global srcdir
-    global binfile
-    global subdir
-    global srcfile
-    global gdb_prompt
-
-    if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug additional_flags=$cflags]] != "" } {
-	untested "Couldn't compile test program"
-	return -1
-    }
-
-    # Get things started.
-
-    gdb_exit
-    gdb_start
-    gdb_reinitialize_dir $srcdir/$subdir
-    gdb_load ${binfile}
-
-    gdb_test "p n" \
-	     "= \"A\""
-    gdb_test "p s" \
-	     "= \\{65 'A', 0 '\\\\0'\\}"
-    gdb_test "p u" \
-	     "= \\{65 'A', 0 '\\\\0'\\}"
-    gdb_test "p n_typed" \
-	     "= \"A\""
-    gdb_test "p s_typed" \
-	     "= \\{65 'A', 0 '\\\\0'\\}"
-    gdb_test "p u_typed" \
-	     "= \\{65 'A', 0 '\\\\0'\\}"
-}
-
-# The string identification works despite the compiler flags below due to
-# gdbtypes.c:
-#   if (name && strcmp (name, "char") == 0)
-#     TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN;
-
-do_test {}
-do_test {-fsigned-char}
-do_test {-funsigned-char}
Index: testsuite/gdb.base/display.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/display.exp,v
retrieving revision 1.11
diff -u -p -r1.11 display.exp
--- testsuite/gdb.base/display.exp	23 Aug 2007 18:14:16 -0000	1.11
+++ testsuite/gdb.base/display.exp	25 Aug 2007 01:08:27 -0000
@@ -195,7 +195,7 @@ if [istarget "hppa*-hp-hpux*"] {
     gdb_test "x/rx j" ".*(Cannot access|Error accessing) memory.*|.*0xa:\[ \t\]*\[0-9\]+.*"
 }
 gdb_test "print/0 j" ".*Item count other than 1 is meaningless.*" "print/0 j"
-gdb_test "print/s sum" ".*Format letter.*is meaningless.*" " no s"
+gdb_test "print/s sum" " = 1000" "ignored s"
 gdb_test "print/i sum" ".*Format letter.*is meaningless.*.*" "no i"
 gdb_test "print/a &sum" ".*= $hex.*<sum>.*"
 # If the constant below is larger than the length of main, then
Index: testsuite/gdb.base/printcmds.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/printcmds.exp,v
retrieving revision 1.16
diff -u -p -r1.16 printcmds.exp
--- testsuite/gdb.base/printcmds.exp	23 Aug 2007 18:14:17 -0000	1.16
+++ testsuite/gdb.base/printcmds.exp	25 Aug 2007 01:08:27 -0000
@@ -589,18 +589,18 @@ proc test_print_char_arrays {} {
     gdb_test "set print address on" ""
 
     gdb_test "p arrays" \
-	" = \\{array1 = \\{97 'a', 98 'b', 99 'c', 0 '\\\\0'\\}, array2 = \\{100 'd'\\}, array3 = \\{101 'e'\\}, array4 = \\{102 'f', 103 'g'\\}, array5 = \\{104 'h', 105 'i', 106 'j', 0 '\\\\0'\\}\\}"
+	" = {array1 = \"abc\", array2 = \"d\", array3 = \"e\", array4 = \"fg\", array5 = \"hij\"}"
 
     gdb_test "p parrays"		" = \\(struct some_arrays \\*\\) $hex"
-    gdb_test "p parrays->array1"	" = \\{97 'a', 98 'b', 99 'c', 0 '\\\\0'\\}"
+    gdb_test "p parrays->array1"	" = \"abc\""
     gdb_test "p &parrays->array1"	" = \\(unsigned char \\(\\*\\)\\\[4\\\]\\) $hex"
-    gdb_test "p parrays->array2"	" = \\{100 'd'\\}"
+    gdb_test "p parrays->array2"	" = \"d\""
     gdb_test "p &parrays->array2"	" = \\(unsigned char \\(\\*\\)\\\[1\\\]\\) $hex"
-    gdb_test "p parrays->array3"	" = \\{101 'e'\\}"
+    gdb_test "p parrays->array3"	" = \"e\""
     gdb_test "p &parrays->array3"	" = \\(unsigned char \\(\\*\\)\\\[1\\\]\\) $hex"
-    gdb_test "p parrays->array4"	" = \\{102 'f', 103 'g'\\}"
+    gdb_test "p parrays->array4"	" = \"fg\""
     gdb_test "p &parrays->array4"	" = \\(unsigned char \\(\\*\\)\\\[2\\\]\\) $hex"
-    gdb_test "p parrays->array5"	" = \\{104 'h', 105 'i', 106 'j', 0 '\\\\0'\\}"
+    gdb_test "p parrays->array5"	" = \"hij\""
     gdb_test "p &parrays->array5"	" = \\(unsigned char \\(\\*\\)\\\[4\\\]\\) $hex"
 
     gdb_test "set print address off" ""
Index: testsuite/gdb.base/setvar.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/setvar.exp,v
retrieving revision 1.12
diff -u -p -r1.12 setvar.exp
--- testsuite/gdb.base/setvar.exp	23 Aug 2007 18:14:17 -0000	1.12
+++ testsuite/gdb.base/setvar.exp	25 Aug 2007 01:08:27 -0000
@@ -232,11 +232,11 @@ test_set "set variable v_char_array\[0\]
 #
 # test "set variable" for "signed char array[2]"
 #
-test_set "set variable v_signed_char_array\[0\]='h'" "set variable v_signed_char_array\[1\]='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\\{104 'h', 105 'i'\\}"        "set variable signed char array=\"hi\" (string)" 
+test_set "set variable v_signed_char_array\[0\]='h'" "set variable v_signed_char_array\[1\]='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\"hi\""        "set variable signed char array=\"hi\" (string)" 
 #
 # test "set variable" for "unsigned char array[2]"
 #
-test_set "set variable v_unsigned_char_array\[0\]='h'" "set variable v_unsigned_char_array\[1\]='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\\{104 'h', 105 'i'\\}"        "set variable unsigned char array=\"hi\" (string)" 
+test_set "set variable v_unsigned_char_array\[0\]='h'" "set variable v_unsigned_char_array\[1\]='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\"hi\""        "set variable unsigned char array=\"hi\" (string)" 
 #
 # test "set variable" for "short array[2]"
 #
@@ -288,11 +288,11 @@ test_set "set v_char_pointer=v_char_arra
 #
 # test "set variable" for type "signed char *"
 #
-test_set "set v_signed_char_pointer=v_signed_char_array" "set variable *(v_signed_char_pointer)='h'" "set variable *(v_signed_char_pointer+1)='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\\{104 'h', 105 'i'\\}"  "print *(v_signed_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'"     "set variable signed char pointer=\"hi\" (string)" 
+test_set "set v_signed_char_pointer=v_signed_char_array" "set variable *(v_signed_char_pointer)='h'" "set variable *(v_signed_char_pointer+1)='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\"hi\""  "print *(v_signed_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'"     "set variable signed char pointer=\"hi\" (string)" 
 #
 # test "set variable" for type "unsigned char *"
 #
-test_set "set v_unsigned_char_pointer=v_unsigned_char_array" "set variable *(v_unsigned_char_pointer)='h'" "set variable *(v_unsigned_char_pointer+1)='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\\{104 'h', 105 'i'\\}"  "print *(v_unsigned_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'"     "set variable unsigned char pointer=\"hi\" (string)" 
+test_set "set v_unsigned_char_pointer=v_unsigned_char_array" "set variable *(v_unsigned_char_pointer)='h'" "set variable *(v_unsigned_char_pointer+1)='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\"hi\""  "print *(v_unsigned_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'"     "set variable unsigned char pointer=\"hi\" (string)" 
 #
 # test "set variable" for type "short *"
 #


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

* Re: [RFC] Changes to signed char and unsigned char handling
  2007-08-25  1:18 ` Daniel Jacobowitz
@ 2007-08-25 10:19   ` Eli Zaretskii
  2007-09-03 17:53   ` Daniel Jacobowitz
  1 sibling, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2007-08-25 10:19 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> Date: Fri, 24 Aug 2007 21:17:57 -0400
> From: Daniel Jacobowitz <drow@false.org>
> 
> Here's option 1 instead:
> 
> 1.  Make vector types special.  Treat arrays of single byte integers
> as characters, like before, unless they occur in a vector type.  This
> is reasonable, but tricky to implement.
> 
> It restores the historic behavior for unsigned char and signed char.
> Only the behavior of vector registers has changed.  You basically
> never want to print these as strings, but since I had already
> implemented print/s I kept it.
> 
> Comments?  Mark, is this better?

The patches for documentation are okay with me.

Thanks.


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

* Re: [RFC] Changes to signed char and unsigned char handling
  2007-08-25  1:18 ` Daniel Jacobowitz
  2007-08-25 10:19   ` Eli Zaretskii
@ 2007-09-03 17:53   ` Daniel Jacobowitz
  2007-09-04 13:58     ` Joel Brobecker
  2007-09-04 22:40     ` Mark Kettenis
  1 sibling, 2 replies; 13+ messages in thread
From: Daniel Jacobowitz @ 2007-09-03 17:53 UTC (permalink / raw)
  To: gdb-patches

On Fri, Aug 24, 2007 at 09:17:57PM -0400, Daniel Jacobowitz wrote:
> Here's option 1 instead:
> 
> 1.  Make vector types special.  Treat arrays of single byte integers
> as characters, like before, unless they occur in a vector type.  This
> is reasonable, but tricky to implement.
> 
> It restores the historic behavior for unsigned char and signed char.
> Only the behavior of vector registers has changed.  You basically
> never want to print these as strings, but since I had already
> implemented print/s I kept it.

Mark, did you want to look at this revised approach?  I think it
will satisfy everyone; I'd like to include it in 6.7, if so.

  http://sourceware.org/ml/gdb-patches/2007-08/msg00467.html

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: [RFC] Changes to signed char and unsigned char handling
  2007-09-03 17:53   ` Daniel Jacobowitz
@ 2007-09-04 13:58     ` Joel Brobecker
  2007-09-04 22:40     ` Mark Kettenis
  1 sibling, 0 replies; 13+ messages in thread
From: Joel Brobecker @ 2007-09-04 13:58 UTC (permalink / raw)
  To: gdb-patches

> > 1.  Make vector types special.  Treat arrays of single byte integers
> > as characters, like before, unless they occur in a vector type.  This
> > is reasonable, but tricky to implement.
> > 
> > It restores the historic behavior for unsigned char and signed char.
> > Only the behavior of vector registers has changed.  You basically
> > never want to print these as strings, but since I had already
> > implemented print/s I kept it.
> 
> Mark, did you want to look at this revised approach?  I think it
> will satisfy everyone; I'd like to include it in 6.7, if so.
> 
>   http://sourceware.org/ml/gdb-patches/2007-08/msg00467.html

I had a look at the patch, and it looks fine to me too (Eli already
said so some days ago).

Regarding gdb-6.7, I propose delay a bit more creation of the release
branch, because Mark had some strong objections to the first patch that
went in.  I would also like to have this one in 6.7, and would prefer
to see it applied before the branch is cut. I want to make sure that
any testing of the branch contains that patch.

-- 
Joel


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

* Re: [RFC] Changes to signed char and unsigned char handling
  2007-09-03 17:53   ` Daniel Jacobowitz
  2007-09-04 13:58     ` Joel Brobecker
@ 2007-09-04 22:40     ` Mark Kettenis
  2007-09-05  0:51       ` Daniel Jacobowitz
  1 sibling, 1 reply; 13+ messages in thread
From: Mark Kettenis @ 2007-09-04 22:40 UTC (permalink / raw)
  To: drow; +Cc: gdb-patches

> Date: Mon, 3 Sep 2007 13:53:12 -0400
> From: Daniel Jacobowitz <drow@false.org>
> 
> On Fri, Aug 24, 2007 at 09:17:57PM -0400, Daniel Jacobowitz wrote:
> > Here's option 1 instead:
> > 
> > 1.  Make vector types special.  Treat arrays of single byte integers
> > as characters, like before, unless they occur in a vector type.  This
> > is reasonable, but tricky to implement.
> > 
> > It restores the historic behavior for unsigned char and signed char.
> > Only the behavior of vector registers has changed.  You basically
> > never want to print these as strings, but since I had already
> > implemented print/s I kept it.
> 
> Mark, did you want to look at this revised approach?  I think it
> will satisfy everyone; I'd like to include it in 6.7, if so.
> 
>   http://sourceware.org/ml/gdb-patches/2007-08/msg00467.html

Bleah!  It was my intention to test this new diff, and recheck my
sparc machine to see why your first diff caused me so many problems,
but I haven't found the time to do either.

But this diff makes much more sense to me, so feel free to get it in.

Mark


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

* Re: [RFC] Changes to signed char and unsigned char handling
  2007-09-04 22:40     ` Mark Kettenis
@ 2007-09-05  0:51       ` Daniel Jacobowitz
  0 siblings, 0 replies; 13+ messages in thread
From: Daniel Jacobowitz @ 2007-09-05  0:51 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

On Wed, Sep 05, 2007 at 12:40:09AM +0200, Mark Kettenis wrote:
> Bleah!  It was my intention to test this new diff, and recheck my
> sparc machine to see why your first diff caused me so many problems,
> but I haven't found the time to do either.
> 
> But this diff makes much more sense to me, so feel free to get it in.

Thanks a lot.  I know what you mean about time (what one of my friends
calls the round tuits problem).  I'm still interested in why the first
patch caused you such trouble.  But don't go out of your way if you
can't check easily; I'm happy with this version.

I've tested it again on x86_64-linux and committed.

-- 
Daniel Jacobowitz
CodeSourcery


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

end of thread, other threads:[~2007-09-05  0:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-05 13:54 [RFC] Changes to signed char and unsigned char handling Daniel Jacobowitz
2007-07-06 10:33 ` Eli Zaretskii
2007-07-06 21:34   ` Daniel Jacobowitz
2007-07-07 10:04     ` Eli Zaretskii
2007-07-07 17:06       ` Daniel Jacobowitz
2007-07-06 23:26   ` Nick Roberts
2007-07-06 23:46     ` Daniel Jacobowitz
2007-08-25  1:18 ` Daniel Jacobowitz
2007-08-25 10:19   ` Eli Zaretskii
2007-09-03 17:53   ` Daniel Jacobowitz
2007-09-04 13:58     ` Joel Brobecker
2007-09-04 22:40     ` Mark Kettenis
2007-09-05  0:51       ` Daniel Jacobowitz

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