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 parts of ada-lang.c


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

	* ada-lang.c (value_from_contents_and_address)
	(to_record_with_fixed_variant_part)
	(value_tag_from_contents_and_address, ada_to_fixed_type)
	(to_fixed_variant_branch_type, to_fixed_record_type)
	(ada_template_to_fixed_record_type, cond_offset_host)
	(ada_template_to_fixed_record_type_1): Make buffer a const
	bfd_byte.
	* ada-lang.h (ada_template_to_fixed_record_type_1)
	(value_from_contents_and_address, ada_to_fixed_type): Ditto.

Index: ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.66
diff -p -u -r1.66 ada-lang.c
--- ada-lang.c	12 Jan 2005 18:31:29 -0000	1.66
+++ ada-lang.c	28 Jan 2005 19:54:59 -0000
@@ -1,6 +1,7 @@
 /* Ada language support routines for GDB, the GNU debugger.  Copyright
-   1992, 1993, 1994, 1997, 1998, 1999, 2000, 2003, 2004.
-   Free Software Foundation, Inc.
+
+   1992, 1993, 1994, 1997, 1998, 1999, 2000, 2003, 2004, 2005 Free
+   Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -161,7 +162,8 @@ static struct value *evaluate_subexp_typ
 
 static int is_dynamic_field (struct type *, int);
 
-static struct type *to_fixed_variant_branch_type (struct type *, char *,
+static struct type *to_fixed_variant_branch_type (struct type *,
+						  const bfd_byte *,
                                                   CORE_ADDR, struct value *);
 
 static struct type *to_fixed_array_type (struct type *, struct value *, int);
@@ -412,7 +414,8 @@ is_suffix (const char *str, const char *
    ADDRESS.  */
 
 struct value *
-value_from_contents_and_address (struct type *type, char *valaddr,
+value_from_contents_and_address (struct type *type,
+				 const bfd_byte *valaddr,
                                  CORE_ADDR address)
 {
   struct value *v = allocate_value (type);
@@ -458,8 +461,8 @@ coerce_unspec_val_to_type (struct value 
     }
 }
 
-static char *
-cond_offset_host (char *valaddr, long offset)
+static const bfd_byte *
+cond_offset_host (const bfd_byte *valaddr, long offset)
 {
   if (valaddr == NULL)
     return NULL;
@@ -4995,7 +4998,8 @@ ada_value_tag (struct value *val)
    ADDRESS. */
 
 static struct value *
-value_tag_from_contents_and_address (struct type *type, char *valaddr,
+value_tag_from_contents_and_address (struct type *type,
+				     const bfd_byte *valaddr,
                                      CORE_ADDR address)
 {
   int tag_byte_offset, dummy1, dummy2;
@@ -5003,7 +5007,9 @@ value_tag_from_contents_and_address (str
   if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset,
                          &dummy1, &dummy2))
     {
-      char *valaddr1 = (valaddr == NULL) ? NULL : valaddr + tag_byte_offset;
+      const bfd_byte *valaddr1 = ((valaddr == NULL)
+				  ? NULL
+				  : valaddr + tag_byte_offset);
       CORE_ADDR address1 = (address == 0) ? 0 : address + tag_byte_offset;
 
       return value_from_contents_and_address (tag_type, valaddr1, address1);
@@ -6049,7 +6055,8 @@ empty_record (struct objfile *objfile)
    byte-aligned.  */
 
 struct type *
-ada_template_to_fixed_record_type_1 (struct type *type, char *valaddr,
+ada_template_to_fixed_record_type_1 (struct type *type,
+				     const bfd_byte *valaddr,
                                      CORE_ADDR address, struct value *dval0,
                                      int keep_dynamic_fields)
 {
@@ -6209,7 +6216,7 @@ ada_template_to_fixed_record_type_1 (str
    of 1.  */
 
 static struct type *
-template_to_fixed_record_type (struct type *type, char *valaddr,
+template_to_fixed_record_type (struct type *type, const bfd_byte *valaddr,
                                CORE_ADDR address, struct value *dval0)
 {
   return ada_template_to_fixed_record_type_1 (type, valaddr,
@@ -6276,7 +6283,7 @@ template_to_static_fixed_type (struct ty
    contains the necessary discriminant values.  */
 
 static struct type *
-to_record_with_fixed_variant_part (struct type *type, char *valaddr,
+to_record_with_fixed_variant_part (struct type *type, const bfd_byte *valaddr,
                                    CORE_ADDR address, struct value *dval0)
 {
   struct value *mark = value_mark ();
@@ -6354,7 +6361,7 @@ to_record_with_fixed_variant_part (struc
    shortcut and suspect the compiler should be altered.  FIXME.  */
 
 static struct type *
-to_fixed_record_type (struct type *type0, char *valaddr,
+to_fixed_record_type (struct type *type0, const bfd_byte *valaddr,
                       CORE_ADDR address, struct value *dval)
 {
   struct type *templ_type;
@@ -6389,7 +6396,7 @@ to_fixed_record_type (struct type *type0
    indicated in the union's type name.  */
 
 static struct type *
-to_fixed_variant_branch_type (struct type *var_type0, char *valaddr,
+to_fixed_variant_branch_type (struct type *var_type0, const bfd_byte *valaddr,
                               CORE_ADDR address, struct value *dval)
 {
   int which;
@@ -6495,7 +6502,7 @@ to_fixed_array_type (struct type *type0,
    ADDRESS or in VALADDR contains these discriminants.  */
 
 struct type *
-ada_to_fixed_type (struct type *type, char *valaddr,
+ada_to_fixed_type (struct type *type, const bfd_byte *valaddr,
                    CORE_ADDR address, struct value *dval)
 {
   type = ada_check_typedef (type);
Index: ada-lang.h
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.h,v
retrieving revision 1.15
diff -p -u -r1.15 ada-lang.h
--- ada-lang.h	13 Nov 2004 23:10:00 -0000	1.15
+++ ada-lang.h	28 Jan 2005 19:54:59 -0000
@@ -196,7 +196,8 @@ extern int ada_value_print (struct value
 
                                 /* Defined in ada-lang.c */
 
-extern struct value *value_from_contents_and_address (struct type *, char *,
+extern struct value *value_from_contents_and_address (struct type *,
+						      const bfd_byte *,
                                                       CORE_ADDR);
 
 extern void ada_emit_char (int, struct ui_file *, int, int);
@@ -339,13 +340,14 @@ extern struct type *ada_system_address_t
 
 extern int ada_which_variant_applies (struct type *, struct type *, char *);
 
-extern struct type *ada_to_fixed_type (struct type *, char *, CORE_ADDR,
-                                       struct value *);
+extern struct type *ada_to_fixed_type (struct type *, const bfd_byte *,
+				       CORE_ADDR, struct value *);
 
-extern struct type *
-  ada_template_to_fixed_record_type_1 (struct type *type, char *valaddr,
-                                       CORE_ADDR address, struct value *dval0,
-                                       int keep_dynamic_fields);
+extern struct type *ada_template_to_fixed_record_type_1 (struct type *type,
+							 const bfd_byte *valaddr,
+							 CORE_ADDR address,
+							 struct value *dval0,
+							 int keep_dynamic_fields);
 
 extern int ada_name_prefix_len (const char *);
 

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