This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] const la_val_print, fix fallout


Hello, thanks to a number of recursive calls of the form:

LANG_val_print -> print structure -> val_print -> la_val_print -> LANG_val_print

this patches comes as an all or nothing afair :-(

committed,
Andrew
2005-01-28  Andrew Cagney  <cagney@gnu.org>

	* language.h (struct language_defn): Make la_val_print's buffer
	parameter a const bfd_byte.
	* cp-valprint.c (cp_print_value_fields, cp_print_value): Update.
	* ada-lang.c (ada_aligned_value_addr)
	(ada_value_primitive_packed_val, ada_which_variant_applies): Update.
	* valprint.c (val_print_array_elements): Update.
	* valprint.h (val_print_array_elements): Update.
	* ada-lang.h (ada_val_print, ada_aligned_value_addr)
	(ada_value_primitive_packed_val, ada_which_variant_applies): Update.
	* ada-valprint.c (ada_val_print, struct ada_val_print_args) 
	(ada_val_print_1, ada_print_floating, printable_val_type) 
	(print_record, val_print_packed_array_elements) 
	(print_field_values, print_variant_part): Update.
	* c-lang.h (c_val_print, cp_print_value_fields): Update.
	* c-valprint.c (c_val_print): Update.
	* f-lang.h (f_val_print): Update.
	* f-valprint.c (f_val_print, f77_print_array_1)
	(f77_print_array): Update.
	* jv-lang.h (java_val_print): Update.
	* jv-valprint.c (java_print_value_fields, java_val_print): Update.
	* language.c (unk_lang_val_print): Update.
	* m2-lang.h (m2_val_print): Update.
	* m2-valprint.c (m2_val_print): Update.
	* p-lang.h (pascal_val_print): Update.
	(pascal_object_print_value_fields): Update.
	* p-valprint.c (pascal_val_print) 
	(pascal_object_print_value_fields, pascal_object_print_value) 
	(pascal_object_print_value): Update.
	* scm-lang.h (scm_val_print): Update.
	* scm-valprint.c (scm_val_print): Update.
	* value.h (val_print): Update.

Index: ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.67
diff -p -u -r1.67 ada-lang.c
--- ada-lang.c	28 Jan 2005 19:56:00 -0000	1.67
+++ ada-lang.c	29 Jan 2005 01:28:19 -0000
@@ -1783,8 +1783,8 @@ has_negatives (struct type *type)
    Assumes 0 <= BIT_OFFSET < HOST_CHAR_BIT.  */
 
 struct value *
-ada_value_primitive_packed_val (struct value *obj, char *valaddr, long offset,
-                                int bit_offset, int bit_size,
+ada_value_primitive_packed_val (struct value *obj, const bfd_byte *valaddr,
+				long offset, int bit_offset, int bit_size,
                                 struct type *type)
 {
   struct value *v;
@@ -5705,7 +5705,7 @@ BadName:
 
 int
 ada_which_variant_applies (struct type *var_type, struct type *outer_type,
-                           char *outer_valaddr)
+                           const bfd_byte *outer_valaddr)
 {
   int others_clause;
   int i;
@@ -6854,8 +6854,8 @@ ada_aligned_type (struct type *type)
 /* The address of the aligned value in an object at address VALADDR
    having type TYPE.  Assumes ada_is_aligner_type (TYPE).  */
 
-char *
-ada_aligned_value_addr (struct type *type, char *valaddr)
+const bfd_byte *
+ada_aligned_value_addr (struct type *type, const bfd_byte *valaddr)
 {
   if (ada_is_aligner_type (type))
     return ada_aligned_value_addr (TYPE_FIELD_TYPE (type, 0),
Index: ada-lang.h
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.h,v
retrieving revision 1.17
diff -p -u -r1.17 ada-lang.h
--- ada-lang.h	29 Jan 2005 00:11:09 -0000	1.17
+++ ada-lang.h	29 Jan 2005 01:28:19 -0000
@@ -1,6 +1,7 @@
 /* Ada language support definitions for GDB, the GNU debugger.
-   Copyright 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-   Free Software Foundation, Inc.
+
+   Copyright 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+   2005 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -187,7 +188,7 @@ extern void ada_error (char *); /* Defin
 extern void ada_print_type (struct type *, char *, struct ui_file *, int,
                             int);
 
-extern int ada_val_print (struct type *, char *, int, CORE_ADDR,
+extern int ada_val_print (struct type *, const bfd_byte *, int, CORE_ADDR,
                           struct ui_file *, int, int, int,
                           enum val_prettyprint);
 
@@ -277,7 +278,8 @@ extern int ada_is_ignored_field (struct 
 
 extern int ada_is_packed_array_type (struct type *);
 
-extern struct value *ada_value_primitive_packed_val (struct value *, char *,
+extern struct value *ada_value_primitive_packed_val (struct value *,
+						     const bfd_byte *,
                                                      long, int, int,
                                                      struct type *);
 
@@ -317,7 +319,8 @@ extern int ada_is_aligner_type (struct t
 
 extern struct type *ada_aligned_type (struct type *);
 
-extern char *ada_aligned_value_addr (struct type *, char *);
+extern const bfd_byte *ada_aligned_value_addr (struct type *,
+					       const bfd_byte *);
 
 extern const char *ada_attribute_name (enum exp_opcode);
 
@@ -339,7 +342,8 @@ extern struct value *ada_vax_float_print
 
 extern struct type *ada_system_address_type (void);
 
-extern int ada_which_variant_applies (struct type *, struct type *, char *);
+extern int ada_which_variant_applies (struct type *, struct type *,
+				      const bfd_byte *);
 
 extern struct type *ada_to_fixed_type (struct type *, const bfd_byte *,
 				       CORE_ADDR, struct value *);
Index: ada-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-valprint.c,v
retrieving revision 1.19
diff -p -u -r1.19 ada-valprint.c
--- ada-valprint.c	29 Jan 2005 00:11:11 -0000	1.19
+++ ada-valprint.c	29 Jan 2005 01:28:19 -0000
@@ -39,7 +39,7 @@ Foundation, Inc., 675 Mass Ave, Cambridg
 struct ada_val_print_args
 {
   struct type *type;
-  char *valaddr0;
+  const bfd_byte *valaddr0;
   int embedded_offset;
   CORE_ADDR address;
   struct ui_file *stream;
@@ -49,30 +49,21 @@ struct ada_val_print_args
   enum val_prettyprint pretty;
 };
 
-static void print_record (struct type *, char *, struct ui_file *, int,
-			  int, enum val_prettyprint);
+static void print_record (struct type *, const bfd_byte *, struct ui_file *,
+			  int, int, enum val_prettyprint);
 
-static int print_field_values (struct type *, char *, struct ui_file *,
-			       int, int, enum val_prettyprint,
-			       int, struct type *, char *);
-
-static int print_variant_part (struct type *, int, char *,
+static int print_field_values (struct type *, const bfd_byte *,
 			       struct ui_file *, int, int,
 			       enum val_prettyprint, int, struct type *,
-			       char *);
-
-static void val_print_packed_array_elements (struct type *, char *valaddr,
-					     int, struct ui_file *, int, int,
-					     enum val_prettyprint);
+			       const bfd_byte *);
 
 static void adjust_type_signedness (struct type *);
 
 static int ada_val_print_stub (void *args0);
 
-static int ada_val_print_1 (struct type *, char *, int, CORE_ADDR,
+static int ada_val_print_1 (struct type *, const bfd_byte *, int, CORE_ADDR,
 			    struct ui_file *, int, int, int,
 			    enum val_prettyprint);
-static void ada_print_floating (char *, struct type *, struct ui_file *);
 
 
 /* Make TYPE unsigned if its range of values includes no negatives.  */
@@ -138,7 +129,7 @@ print_optional_low_bound (struct ui_file
     by ada_coerce_to_simple_array).  */
 
 static void
-val_print_packed_array_elements (struct type *type, char *valaddr,
+val_print_packed_array_elements (struct type *type, const bfd_byte *valaddr,
 				 int bitoffset, struct ui_file *stream,
 				 int format, int recurse,
 				 enum val_prettyprint pretty)
@@ -246,7 +237,7 @@ val_print_packed_array_elements (struct 
 }
 
 static struct type *
-printable_val_type (struct type *type, char *valaddr)
+printable_val_type (struct type *type, const bfd_byte *valaddr)
 {
   return ada_to_fixed_type (ada_aligned_type (type), valaddr, 0, NULL);
 }
@@ -299,7 +290,8 @@ ui_memcpy (void *dest, const char *buffe
    a decimal point, and at least one digit before and after the
    point.  We use GNAT format for NaNs and infinities.  */
 static void
-ada_print_floating (char *valaddr, struct type *type, struct ui_file *stream)
+ada_print_floating (const bfd_byte *valaddr, struct type *type,
+		    struct ui_file *stream)
 {
   char buffer[64];
   char *s, *result;
@@ -555,9 +547,10 @@ ada_printstr (struct ui_file *stream, co
    arrays.)  */
 
 int
-ada_val_print (struct type *type, char *valaddr0, int embedded_offset,
-	       CORE_ADDR address, struct ui_file *stream, int format,
-	       int deref_ref, int recurse, enum val_prettyprint pretty)
+ada_val_print (struct type *type, const bfd_byte *valaddr0,
+	       int embedded_offset, CORE_ADDR address,
+	       struct ui_file *stream, int format, int deref_ref,
+	       int recurse, enum val_prettyprint pretty)
 {
   struct ada_val_print_args args;
   args.type = type;
@@ -589,8 +582,9 @@ ada_val_print_stub (void *args0)
  * does not catch evaluation errors (leaving that to ada_val_print).  */
 
 static int
-ada_val_print_1 (struct type *type, char *valaddr0, int embedded_offset,
-		 CORE_ADDR address, struct ui_file *stream, int format,
+ada_val_print_1 (struct type *type, const bfd_byte *valaddr0,
+		 int embedded_offset, CORE_ADDR address,
+		 struct ui_file *stream, int format,
 		 int deref_ref, int recurse, enum val_prettyprint pretty)
 {
   unsigned int len;
@@ -598,7 +592,7 @@ ada_val_print_1 (struct type *type, char
   struct type *elttype;
   unsigned int eltlen;
   LONGEST val;
-  char *valaddr = valaddr0 + embedded_offset;
+  const bfd_byte *valaddr = valaddr0 + embedded_offset;
 
   type = ada_check_typedef (type);
 
@@ -879,10 +873,10 @@ ada_val_print_1 (struct type *type, char
 }
 
 static int
-print_variant_part (struct type *type, int field_num, char *valaddr,
+print_variant_part (struct type *type, int field_num, const bfd_byte *valaddr,
 		    struct ui_file *stream, int format, int recurse,
 		    enum val_prettyprint pretty, int comma_needed,
-		    struct type *outer_type, char *outer_valaddr)
+		    struct type *outer_type, const bfd_byte *outer_valaddr)
 {
   struct type *var_type = TYPE_FIELD_TYPE (type, field_num);
   int which = ada_which_variant_applies (var_type, outer_type, outer_valaddr);
@@ -958,8 +952,9 @@ ada_value_print (struct value *val0, str
 }
 
 static void
-print_record (struct type *type, char *valaddr, struct ui_file *stream,
-	      int format, int recurse, enum val_prettyprint pretty)
+print_record (struct type *type, const bfd_byte *valaddr,
+	      struct ui_file *stream, int format, int recurse,
+	      enum val_prettyprint pretty)
 {
   type = ada_check_typedef (type);
 
@@ -990,10 +985,10 @@ print_record (struct type *type, char *v
    Returns 1 if COMMA_NEEDED or any fields were printed.  */
 
 static int
-print_field_values (struct type *type, char *valaddr, struct ui_file *stream,
-		    int format, int recurse, enum val_prettyprint pretty,
-		    int comma_needed, struct type *outer_type,
-		    char *outer_valaddr)
+print_field_values (struct type *type, const bfd_byte *valaddr,
+		    struct ui_file *stream, int format, int recurse,
+		    enum val_prettyprint pretty, int comma_needed,
+		    struct type *outer_type, const bfd_byte *outer_valaddr)
 {
   int i, len;
 
Index: c-lang.h
===================================================================
RCS file: /cvs/src/src/gdb/c-lang.h,v
retrieving revision 1.10
diff -p -u -r1.10 c-lang.h
--- c-lang.h	29 Jan 2005 00:11:11 -0000	1.10
+++ c-lang.h	29 Jan 2005 01:28:19 -0000
@@ -39,7 +39,7 @@ extern void c_error (char *);	/* Defined
 extern void c_print_type (struct type *, char *, struct ui_file *, int,
 			  int);
 
-extern int c_val_print (struct type *, char *, int, CORE_ADDR,
+extern int c_val_print (struct type *, const bfd_byte *, int, CORE_ADDR,
 			struct ui_file *, int, int, int,
 			enum val_prettyprint);
 
@@ -82,8 +82,9 @@ extern void cp_print_class_member (const
 extern void cp_print_class_method (const bfd_byte *, struct type *,
 				   struct ui_file *);
 
-extern void cp_print_value_fields (struct type *, struct type *, char *,
-				   int, CORE_ADDR, struct ui_file *, int,
+extern void cp_print_value_fields (struct type *, struct type *,
+				   const bfd_byte *, int, CORE_ADDR,
+				   struct ui_file *, int,
 				   int, enum val_prettyprint,
 				   struct type **, int);
 
Index: c-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/c-valprint.c,v
retrieving revision 1.25
diff -p -u -r1.25 c-valprint.c
--- c-valprint.c	12 Nov 2004 21:45:06 -0000	1.25
+++ c-valprint.c	29 Jan 2005 01:28:19 -0000
@@ -69,7 +69,7 @@ print_function_pointer_address (CORE_ADD
    The PRETTY parameter controls prettyprinting.  */
 
 int
-c_val_print (struct type *type, char *valaddr, int embedded_offset,
+c_val_print (struct type *type, const bfd_byte *valaddr, int embedded_offset,
 	     CORE_ADDR address, struct ui_file *stream, int format,
 	     int deref_ref, int recurse, enum val_prettyprint pretty)
 {
Index: cp-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/cp-valprint.c,v
retrieving revision 1.28
diff -p -u -r1.28 cp-valprint.c
--- cp-valprint.c	28 Jan 2005 20:19:54 -0000	1.28
+++ cp-valprint.c	29 Jan 2005 01:28:19 -0000
@@ -1,7 +1,7 @@
 /* Support for printing C++ values for GDB, the GNU debugger.
-   Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-   2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+
+   Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
+   1997, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -50,8 +50,8 @@ static void cp_print_static_field (struc
 				   struct ui_file *, int, int,
 				   enum val_prettyprint);
 
-static void cp_print_value (struct type *, struct type *, char *, int,
-			    CORE_ADDR, struct ui_file *, int, int,
+static void cp_print_value (struct type *, struct type *, const bfd_byte *,
+			    int, CORE_ADDR, struct ui_file *, int, int,
 			    enum val_prettyprint, struct type **);
 
 static void cp_print_hpacc_virtual_table_entries (struct type *, int *,
@@ -227,10 +227,11 @@ cp_is_vtbl_member (struct type *type)
    should not print, or zero if called from top level.  */
 
 void
-cp_print_value_fields (struct type *type, struct type *real_type, char *valaddr,
-		       int offset, CORE_ADDR address, struct ui_file *stream,
-		       int format, int recurse, enum val_prettyprint pretty,
-		       struct type **dont_print_vb, int dont_print_statmem)
+cp_print_value_fields (struct type *type, struct type *real_type,
+		       const bfd_byte *valaddr, int offset, CORE_ADDR address,
+		       struct ui_file *stream, int format, int recurse,
+		       enum val_prettyprint pretty,
+		       struct type **dont_print_vb,int dont_print_statmem)
 {
   int i, len, n_baseclasses;
   struct obstack tmp_obstack;
@@ -489,10 +490,10 @@ cp_print_value_fields (struct type *type
    baseclasses.  */
 
 static void
-cp_print_value (struct type *type, struct type *real_type, char *valaddr,
-		int offset, CORE_ADDR address, struct ui_file *stream,
-		int format, int recurse, enum val_prettyprint pretty,
-		struct type **dont_print_vb)
+cp_print_value (struct type *type, struct type *real_type,
+		const bfd_byte *valaddr, int offset, CORE_ADDR address,
+		struct ui_file *stream, int format, int recurse,
+		enum val_prettyprint pretty, struct type **dont_print_vb)
 {
   struct obstack tmp_obstack;
   struct type **last_dont_print
@@ -517,7 +518,7 @@ cp_print_value (struct type *type, struc
       int skip;
       struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
       char *basename = TYPE_NAME (baseclass);
-      char *base_valaddr;
+      const bfd_byte *base_valaddr;
 
       if (BASETYPE_VIA_VIRTUAL (type, i))
 	{
@@ -564,8 +565,9 @@ cp_print_value (struct type *type, struc
 		      || (boffset + offset) >= TYPE_LENGTH (type)))
 		{
 		  /* FIXME (alloca): unsafe if baseclass is really really large. */
-		  base_valaddr = (char *) alloca (TYPE_LENGTH (baseclass));
-		  if (target_read_memory (address + boffset, base_valaddr,
+		  bfd_byte *buf = alloca (TYPE_LENGTH (baseclass));
+		  base_valaddr = buf;
+		  if (target_read_memory (address + boffset, buf,
 					  TYPE_LENGTH (baseclass)) != 0)
 		    skip = 1;
 		  address = address + boffset;
Index: f-lang.h
===================================================================
RCS file: /cvs/src/src/gdb/f-lang.h,v
retrieving revision 1.3
diff -p -u -r1.3 f-lang.h
--- f-lang.h	6 Mar 2001 08:21:07 -0000	1.3
+++ f-lang.h	29 Jan 2005 01:28:19 -0000
@@ -1,6 +1,8 @@
 /* Fortran language support definitions for GDB, the GNU debugger.
-   Copyright 1992, 1993, 1994, 1995, 1998, 2000
-   Free Software Foundation, Inc.
+
+   Copyright 1992, 1993, 1994, 1995, 1998, 2000, 2005 Free Software
+   Foundation, Inc.
+
    Contributed by Motorola.  Adapted from the C definitions by Farooq Butt
    (fmbutt@engage.sps.mot.com).
 
@@ -28,7 +30,7 @@ extern void f_error (char *);	/* Defined
 extern void f_print_type (struct type *, char *, struct ui_file *, int,
 			  int);
 
-extern int f_val_print (struct type *, char *, int, CORE_ADDR,
+extern int f_val_print (struct type *, const bfd_byte *, int, CORE_ADDR,
 			struct ui_file *, int, int, int,
 			enum val_prettyprint);
 
Index: f-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/f-valprint.c,v
retrieving revision 1.22
diff -p -u -r1.22 f-valprint.c
--- f-valprint.c	12 Nov 2004 21:45:06 -0000	1.22
+++ f-valprint.c	29 Jan 2005 01:28:19 -0000
@@ -1,6 +1,8 @@
 /* Support for printing Fortran values for GDB, the GNU debugger.
-   Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2003
-   Free Software Foundation, Inc.
+
+   Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2003, 2005 Free
+   Software Foundation, Inc.
+
    Contributed by Motorola.  Adapted from the C definitions by Farooq Butt
    (fmbutt@engage.sps.mot.com), additionally worked over by Stan Shebs.
 
@@ -42,13 +44,6 @@ static int there_is_a_visible_common_nam
 extern void _initialize_f_valprint (void);
 static void info_common_command (char *, int);
 static void list_all_visible_commons (char *);
-static void f77_print_array (struct type *, char *, CORE_ADDR,
-			     struct ui_file *, int, int, int,
-			     enum val_prettyprint);
-static void f77_print_array_1 (int, int, struct type *, char *,
-			       CORE_ADDR, struct ui_file *, int, int, int,
-			       enum val_prettyprint,
-			       int *elts);
 static void f77_create_arrayprint_offset_tbl (struct type *,
 					      struct ui_file *);
 static void f77_get_dynamic_length_of_aggregate (struct type *);
@@ -278,8 +273,9 @@ f77_create_arrayprint_offset_tbl (struct
    the superior.  Address == the address in the inferior.  */
 
 static void
-f77_print_array_1 (int nss, int ndimensions, struct type *type, char *valaddr,
-		   CORE_ADDR address, struct ui_file *stream, int format,
+f77_print_array_1 (int nss, int ndimensions, struct type *type,
+		   const bfd_byte *valaddr, CORE_ADDR address,
+		   struct ui_file *stream, int format,
 		   int deref_ref, int recurse, enum val_prettyprint pretty,
 		   int *elts)
 {
@@ -323,8 +319,9 @@ f77_print_array_1 (int nss, int ndimensi
    stuff and then immediately call f77_print_array_1() */
 
 static void
-f77_print_array (struct type *type, char *valaddr, CORE_ADDR address,
-		 struct ui_file *stream, int format, int deref_ref, int recurse,
+f77_print_array (struct type *type, const bfd_byte *valaddr,
+		 CORE_ADDR address, struct ui_file *stream,
+		 int format, int deref_ref, int recurse,
 		 enum val_prettyprint pretty)
 {
   int ndimensions;
@@ -361,7 +358,7 @@ f77_print_array (struct type *type, char
    The PRETTY parameter controls prettyprinting.  */
 
 int
-f_val_print (struct type *type, char *valaddr, int embedded_offset,
+f_val_print (struct type *type, const bfd_byte *valaddr, int embedded_offset,
 	     CORE_ADDR address, struct ui_file *stream, int format,
 	     int deref_ref, int recurse, enum val_prettyprint pretty)
 {
Index: jv-lang.h
===================================================================
RCS file: /cvs/src/src/gdb/jv-lang.h,v
retrieving revision 1.4
diff -p -u -r1.4 jv-lang.h
--- jv-lang.h	21 Oct 2001 01:57:42 -0000	1.4
+++ jv-lang.h	29 Jan 2005 01:28:19 -0000
@@ -1,5 +1,7 @@
 /* Java language support definitions for GDB, the GNU debugger.
-   Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+   Copyright 1997, 1998, 1999, 2000, 2005 Free Software Foundation,
+   Inc.
 
    This file is part of GDB.
 
@@ -40,7 +42,7 @@ extern struct type *java_float_type;
 extern struct type *java_double_type;
 extern struct type *java_void_type;
 
-extern int java_val_print (struct type *, char *, int, CORE_ADDR,
+extern int java_val_print (struct type *, const bfd_byte *, int, CORE_ADDR,
 			   struct ui_file *, int, int, int,
 			   enum val_prettyprint);
 
Index: jv-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/jv-valprint.c,v
retrieving revision 1.19
diff -p -u -r1.19 jv-valprint.c
--- jv-valprint.c	12 Nov 2004 21:45:06 -0000	1.19
+++ jv-valprint.c	29 Jan 2005 01:28:19 -0000
@@ -1,6 +1,6 @@
 /* Support for printing Java values for GDB, the GNU debugger.
 
-   Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
+   Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free
    Software Foundation, Inc.
 
    This file is part of GDB.
@@ -36,13 +36,6 @@
 
 /* Local functions */
 
-static void java_print_value_fields (struct type * type, char *valaddr,
-				     CORE_ADDR address,
-				     struct ui_file *stream, int format,
-				     int recurse,
-				     enum val_prettyprint pretty);
-
-
 int
 java_value_print (struct value *val, struct ui_file *stream, int format,
 		  enum val_prettyprint pretty)
@@ -253,9 +246,9 @@ java_value_print (struct value *val, str
    should not print, or zero if called from top level.  */
 
 static void
-java_print_value_fields (struct type *type, char *valaddr, CORE_ADDR address,
-			 struct ui_file *stream, int format, int recurse,
-			 enum val_prettyprint pretty)
+java_print_value_fields (struct type *type, const bfd_byte *valaddr,
+			 CORE_ADDR address, struct ui_file *stream,
+			 int format, int recurse, enum val_prettyprint pretty)
 {
   int i, len, n_baseclasses;
 
@@ -274,7 +267,7 @@ java_print_value_fields (struct type *ty
 	  int boffset;
 	  struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
 	  char *basename = TYPE_NAME (baseclass);
-	  char *base_valaddr;
+	  const bfd_byte *base_valaddr;
 
 	  if (BASETYPE_VIA_VIRTUAL (type, i))
 	    continue;
@@ -452,9 +445,10 @@ java_print_value_fields (struct type *ty
    The PRETTY parameter controls prettyprinting.  */
 
 int
-java_val_print (struct type *type, char *valaddr, int embedded_offset,
-		CORE_ADDR address, struct ui_file *stream, int format,
-		int deref_ref, int recurse, enum val_prettyprint pretty)
+java_val_print (struct type *type, const bfd_byte *valaddr,
+		int embedded_offset, CORE_ADDR address,
+		struct ui_file *stream, int format, int deref_ref,
+		int recurse, enum val_prettyprint pretty)
 {
   unsigned int i = 0;	/* Number of characters printed */
   struct type *target_type;
Index: language.c
===================================================================
RCS file: /cvs/src/src/gdb/language.c,v
retrieving revision 1.53
diff -p -u -r1.53 language.c
--- language.c	29 Jan 2005 00:11:11 -0000	1.53
+++ language.c	29 Jan 2005 01:28:19 -0000
@@ -91,10 +91,6 @@ static struct type *unk_lang_create_fund
 static void unk_lang_print_type (struct type *, char *, struct ui_file *,
 				 int, int);
 
-static int unk_lang_val_print (struct type *, char *, int, CORE_ADDR,
-			       struct ui_file *, int, int, int,
-			       enum val_prettyprint);
-
 static int unk_lang_value_print (struct value *, struct ui_file *, int, enum val_prettyprint);
 
 static CORE_ADDR unk_lang_trampoline (CORE_ADDR pc);
@@ -1114,8 +1110,9 @@ unk_lang_print_type (struct type *type, 
 }
 
 static int
-unk_lang_val_print (struct type *type, char *valaddr, int embedded_offset,
-		    CORE_ADDR address, struct ui_file *stream, int format,
+unk_lang_val_print (struct type *type, const bfd_byte *valaddr,
+		    int embedded_offset, CORE_ADDR address,
+		    struct ui_file *stream, int format,
 		    int deref_ref, int recurse, enum val_prettyprint pretty)
 {
   error ("internal error - unimplemented function unk_lang_val_print called.");
Index: language.h
===================================================================
RCS file: /cvs/src/src/gdb/language.h,v
retrieving revision 1.33
diff -p -u -r1.33 language.h
--- language.h	29 Jan 2005 00:11:12 -0000	1.33
+++ language.h	29 Jan 2005 01:28:19 -0000
@@ -208,7 +208,7 @@ struct language_defn
 
     /* Print a value using syntax appropriate for this language. */
 
-    int (*la_val_print) (struct type *, char *, int, CORE_ADDR,
+    int (*la_val_print) (struct type *, const bfd_byte *, int, CORE_ADDR,
 			 struct ui_file *, int, int, int,
 			 enum val_prettyprint);
 
Index: m2-lang.h
===================================================================
RCS file: /cvs/src/src/gdb/m2-lang.h,v
retrieving revision 1.3
diff -p -u -r1.3 m2-lang.h
--- m2-lang.h	6 Mar 2001 08:21:09 -0000	1.3
+++ m2-lang.h	29 Jan 2005 01:28:19 -0000
@@ -1,5 +1,6 @@
 /* Modula 2 language support definitions for GDB, the GNU debugger.
-   Copyright 1992, 1998, 2000 Free Software Foundation, Inc.
+
+   Copyright 1992, 1998, 2000, 2005 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -26,6 +27,6 @@ extern void m2_error (char *);	/* Define
 extern void m2_print_type (struct type *, char *, struct ui_file *, int,
 			   int);
 
-extern int m2_val_print (struct type *, char *, int, CORE_ADDR,
+extern int m2_val_print (struct type *, const bfd_byte *, int, CORE_ADDR,
 			 struct ui_file *, int, int, int,
 			 enum val_prettyprint);
Index: m2-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/m2-valprint.c,v
retrieving revision 1.6
diff -p -u -r1.6 m2-valprint.c
--- m2-valprint.c	28 Jan 2005 06:40:27 -0000	1.6
+++ m2-valprint.c	29 Jan 2005 01:28:19 -0000
@@ -27,7 +27,7 @@
 #include "c-lang.h"
 
 int
-m2_val_print (struct type *type, char *valaddr, int embedded_offset,
+m2_val_print (struct type *type, const bfd_byte *valaddr, int embedded_offset,
 	      CORE_ADDR address, struct ui_file *stream, int format,
 	      int deref_ref, int recurse, enum val_prettyprint pretty)
 {
Index: p-lang.h
===================================================================
RCS file: /cvs/src/src/gdb/p-lang.h,v
retrieving revision 1.6
diff -p -u -r1.6 p-lang.h
--- p-lang.h	29 Jan 2005 00:52:02 -0000	1.6
+++ p-lang.h	29 Jan 2005 01:28:19 -0000
@@ -29,7 +29,8 @@ extern void pascal_error (char *);	/* De
 /* Defined in p-typeprint.c */
 extern void pascal_print_type (struct type *, char *, struct ui_file *, int, int);
 
-extern int pascal_val_print (struct type *, char *, int, CORE_ADDR, struct ui_file *, int, int,
+extern int pascal_val_print (struct type *, const bfd_byte *, int,
+			     CORE_ADDR, struct ui_file *, int, int,
 			     int, enum val_prettyprint);
 
 extern int pascal_value_print (struct value *, struct ui_file *, int, enum val_prettyprint);
@@ -71,8 +72,9 @@ extern void pascal_object_print_class_me
 extern void pascal_object_print_class_method (const bfd_byte *, struct type *,
 					      struct ui_file *);
 
-extern void pascal_object_print_value_fields (struct type *, char *, CORE_ADDR,
-			   struct ui_file *, int, int, enum val_prettyprint,
+extern void pascal_object_print_value_fields (struct type *, const bfd_byte *,
+					      CORE_ADDR, struct ui_file *,
+					      int, int, enum val_prettyprint,
 					      struct type **, int);
 
 extern int pascal_object_is_vtbl_ptr_type (struct type *);
Index: p-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/p-valprint.c,v
retrieving revision 1.29
diff -p -u -r1.29 p-valprint.c
--- p-valprint.c	29 Jan 2005 00:52:02 -0000	1.29
+++ p-valprint.c	29 Jan 2005 01:28:19 -0000
@@ -56,9 +56,10 @@
 
 
 int
-pascal_val_print (struct type *type, char *valaddr, int embedded_offset,
-		  CORE_ADDR address, struct ui_file *stream, int format,
-		  int deref_ref, int recurse, enum val_prettyprint pretty)
+pascal_val_print (struct type *type, const bfd_byte *valaddr,
+		  int embedded_offset, CORE_ADDR address,
+		  struct ui_file *stream, int format, int deref_ref,
+		  int recurse, enum val_prettyprint pretty)
 {
   unsigned int i = 0;	/* Number of characters printed */
   unsigned len;
@@ -586,9 +587,10 @@ static void pascal_object_print_static_f
 					      struct ui_file *, int, int,
 					      enum val_prettyprint);
 
-static void
-  pascal_object_print_value (struct type *, char *, CORE_ADDR, struct ui_file *,
-			     int, int, enum val_prettyprint, struct type **);
+static void pascal_object_print_value (struct type *, const bfd_byte *,
+				       CORE_ADDR, struct ui_file *,
+				       int, int, enum val_prettyprint,
+				       struct type **);
 
 void
 pascal_object_print_class_method (const bfd_byte *valaddr, struct type *type,
@@ -720,8 +722,9 @@ pascal_object_is_vtbl_member (struct typ
   return 0;
 }
 
-/* Mutually recursive subroutines of pascal_object_print_value and c_val_print to
-   print out a structure's fields: pascal_object_print_value_fields and pascal_object_print_value.
+/* Mutually recursive subroutines of pascal_object_print_value and
+   c_val_print to print out a structure's fields:
+   pascal_object_print_value_fields and pascal_object_print_value.
 
    TYPE, VALADDR, ADDRESS, STREAM, RECURSE, and PRETTY have the
    same meanings as in pascal_object_print_value and c_val_print.
@@ -730,7 +733,7 @@ pascal_object_is_vtbl_member (struct typ
    should not print, or zero if called from top level.  */
 
 void
-pascal_object_print_value_fields (struct type *type, char *valaddr,
+pascal_object_print_value_fields (struct type *type, const bfd_byte *valaddr,
 				  CORE_ADDR address, struct ui_file *stream,
 				  int format, int recurse,
 				  enum val_prettyprint pretty,
@@ -903,8 +906,9 @@ pascal_object_print_value_fields (struct
    baseclasses.  */
 
 void
-pascal_object_print_value (struct type *type, char *valaddr, CORE_ADDR address,
-			   struct ui_file *stream, int format, int recurse,
+pascal_object_print_value (struct type *type, const bfd_byte *valaddr,
+			   CORE_ADDR address, struct ui_file *stream,
+			   int format, int recurse,
 			   enum val_prettyprint pretty,
 			   struct type **dont_print_vb)
 {
@@ -928,7 +932,7 @@ pascal_object_print_value (struct type *
       int boffset;
       struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
       char *basename = TYPE_NAME (baseclass);
-      char *base_valaddr;
+      const bfd_byte *base_valaddr;
 
       if (BASETYPE_VIA_VIRTUAL (type, i))
 	{
@@ -966,8 +970,9 @@ pascal_object_print_value (struct type *
       if (boffset != -1 && (boffset < 0 || boffset >= TYPE_LENGTH (type)))
 	{
 	  /* FIXME (alloc): not safe is baseclass is really really big. */
-	  base_valaddr = (char *) alloca (TYPE_LENGTH (baseclass));
-	  if (target_read_memory (address + boffset, base_valaddr,
+	  bfd_byte *buf = alloca (TYPE_LENGTH (baseclass));
+	  base_valaddr = buf;
+	  if (target_read_memory (address + boffset, buf,
 				  TYPE_LENGTH (baseclass)) != 0)
 	    boffset = -1;
 	}
Index: scm-lang.h
===================================================================
RCS file: /cvs/src/src/gdb/scm-lang.h,v
retrieving revision 1.5
diff -p -u -r1.5 scm-lang.h
--- scm-lang.h	14 Jan 2003 00:49:04 -0000	1.5
+++ scm-lang.h	29 Jan 2005 01:28:19 -0000
@@ -1,6 +1,6 @@
 /* Scheme/Guile language support routines for GDB, the GNU debugger.
 
-   Copyright 1995, 1996, 1998, 1999, 2000, 2003 Free Software
+   Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2005 Free Software
    Foundation, Inc.
 
    This file is part of GDB.
@@ -50,7 +50,7 @@ struct value;
 extern int scm_value_print (struct value *, struct ui_file *,
 			    int, enum val_prettyprint);
 
-extern int scm_val_print (struct type *, char *, int, CORE_ADDR,
+extern int scm_val_print (struct type *, const bfd_byte *, int, CORE_ADDR,
 			  struct ui_file *, int, int, int,
 			  enum val_prettyprint);
 
Index: scm-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/scm-valprint.c,v
retrieving revision 1.7
diff -p -u -r1.7 scm-valprint.c
--- scm-valprint.c	28 Jan 2005 06:40:27 -0000	1.7
+++ scm-valprint.c	29 Jan 2005 01:28:19 -0000
@@ -359,9 +359,10 @@ taloop:
 }
 
 int
-scm_val_print (struct type *type, char *valaddr, int embedded_offset,
-	       CORE_ADDR address, struct ui_file *stream, int format,
-	       int deref_ref, int recurse, enum val_prettyprint pretty)
+scm_val_print (struct type *type, const bfd_byte *valaddr,
+	       int embedded_offset, CORE_ADDR address,
+	       struct ui_file *stream, int format, int deref_ref,
+	       int recurse, enum val_prettyprint pretty)
 {
   if (is_scmvalue_type (type))
     {
Index: valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/valprint.c,v
retrieving revision 1.39
diff -p -u -r1.39 valprint.c
--- valprint.c	28 Jan 2005 23:42:28 -0000	1.39
+++ valprint.c	29 Jan 2005 01:28:19 -0000
@@ -123,9 +123,9 @@ int addressprint;		/* Controls printing 
 
 
 int
-val_print (struct type *type, char *valaddr, int embedded_offset,
-	   CORE_ADDR address, struct ui_file *stream, int format, int deref_ref,
-	   int recurse, enum val_prettyprint pretty)
+val_print (struct type *type, const bfd_byte *valaddr, int embedded_offset,
+	   CORE_ADDR address, struct ui_file *stream, int format,
+	   int deref_ref, int recurse, enum val_prettyprint pretty)
 {
   struct type *real_type = check_typedef (type);
   if (pretty == Val_pretty_default)
@@ -761,8 +761,9 @@ print_char_chars (struct ui_file *stream
  */
 
 void
-val_print_array_elements (struct type *type, char *valaddr, CORE_ADDR address,
-			  struct ui_file *stream, int format, int deref_ref,
+val_print_array_elements (struct type *type, const bfd_byte *valaddr,
+			  CORE_ADDR address, struct ui_file *stream,
+			  int format, int deref_ref,
 			  int recurse, enum val_prettyprint pretty,
 			  unsigned int i)
 {
Index: valprint.h
===================================================================
RCS file: /cvs/src/src/gdb/valprint.h,v
retrieving revision 1.8
diff -p -u -r1.8 valprint.h
--- valprint.h	28 Jan 2005 23:42:28 -0000	1.8
+++ valprint.h	29 Jan 2005 01:28:19 -0000
@@ -50,9 +50,10 @@ extern int output_format;
 
 extern int stop_print_at_null;	/* Stop printing at null char? */
 
-extern void val_print_array_elements (struct type *, char *, CORE_ADDR,
-				      struct ui_file *, int, int, int,
-				      enum val_prettyprint, unsigned int);
+extern void val_print_array_elements (struct type *, const bfd_byte *,
+				      CORE_ADDR, struct ui_file *, int,
+				      int, int, enum val_prettyprint,
+				      unsigned int);
 
 extern void val_print_type_code_int (struct type *, const bfd_byte *,
 				     struct ui_file *);
Index: value.h
===================================================================
RCS file: /cvs/src/src/gdb/value.h,v
retrieving revision 1.64
diff -p -u -r1.64 value.h
--- value.h	28 Jan 2005 16:45:16 -0000	1.64
+++ value.h	29 Jan 2005 01:28:20 -0000
@@ -479,7 +479,7 @@ extern void value_print_array_elements (
 
 extern struct value *value_release_to_mark (struct value *mark);
 
-extern int val_print (struct type *type, char *valaddr,
+extern int val_print (struct type *type, const bfd_byte *valaddr,
 		      int embedded_offset, CORE_ADDR address,
 		      struct ui_file *stream, int format,
 		      int deref_ref, int recurse,

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]