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]

[patch] Add gdbarch parameter to gdbarch_data()


Just FYI,

This adds an explict gdbarch parameter to the gdbarch_data() method and 
then updates all callers.

committed,
Andrew
2002-05-11  Andrew Cagney  <ac131313@redhat.com>

	* gdbarch.sh (gdbarch_data): Add gdbarch parameter.
	* gdbarch.h, gdbarch.c: Regenerate.
	* gnu-v3-abi.c: Update copyright.
	(vtable_address_point_offset): Update.
	(gnuv3_rtti_type): Update.
	(gnuv3_baseclass_offset): Update.
	* solib-svr4.c (svr4_fetch_link_map_offsets): Update.
	(init_fetch_link_map_offsets): Update.
	* remote.c (get_remote_state): Update.
	
Index: gdbarch.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.c,v
retrieving revision 1.123
diff -u -r1.123 gdbarch.c
--- gdbarch.c	8 May 2002 20:43:03 -0000	1.123
+++ gdbarch.c	12 May 2002 00:17:26 -0000
@@ -4803,10 +4803,10 @@
    data-pointer. */
 
 void *
-gdbarch_data (struct gdbarch_data *data)
+gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
 {
-  gdb_assert (data->index < current_gdbarch->nr_data);
-  return current_gdbarch->data[data->index];
+  gdb_assert (data->index < gdbarch->nr_data);
+  return gdbarch->data[data->index];
 }
 
 
Index: gdbarch.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.h,v
retrieving revision 1.91
diff -u -r1.91 gdbarch.h
--- gdbarch.h	24 Apr 2002 16:28:15 -0000	1.91
+++ gdbarch.h	12 May 2002 00:17:27 -0000
@@ -2575,7 +2575,7 @@
 			      struct gdbarch_data *data,
 			      void *pointer);
 
-extern void *gdbarch_data (struct gdbarch_data*);
+extern void *gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *);
 
 
 /* Register per-architecture memory region.
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.134
diff -u -r1.134 gdbarch.sh
--- gdbarch.sh	8 May 2002 20:43:04 -0000	1.134
+++ gdbarch.sh	12 May 2002 00:17:29 -0000
@@ -1108,7 +1108,7 @@
 			      struct gdbarch_data *data,
 			      void *pointer);
 
-extern void *gdbarch_data (struct gdbarch_data*);
+extern void *gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *);
 
 
 /* Register per-architecture memory region.
@@ -1853,10 +1853,10 @@
    data-pointer. */
 
 void *
-gdbarch_data (struct gdbarch_data *data)
+gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
 {
-  gdb_assert (data->index < current_gdbarch->nr_data);
-  return current_gdbarch->data[data->index];
+  gdb_assert (data->index < gdbarch->nr_data);
+  return gdbarch->data[data->index];
 }
 
 
Index: gnu-v3-abi.c
===================================================================
RCS file: /cvs/src/src/gdb/gnu-v3-abi.c,v
retrieving revision 1.9
diff -u -r1.9 gnu-v3-abi.c
--- gnu-v3-abi.c	3 May 2002 19:38:29 -0000	1.9
+++ gnu-v3-abi.c	12 May 2002 00:17:31 -0000
@@ -1,6 +1,7 @@
 /* Abstraction of GNU v3 abi.
    Contributed by Jim Blandy <jimb@redhat.com>
-   Copyright 2001 Free Software Foundation, Inc.
+
+   Copyright 2001, 2002 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -174,7 +175,8 @@
 static int
 vtable_address_point_offset ()
 {
-  struct type *vtable_type = gdbarch_data (vtable_type_gdbarch_data);
+  struct type *vtable_type = gdbarch_data (current_gdbarch,
+					   vtable_type_gdbarch_data);
 
   return (TYPE_FIELD_BITPOS (vtable_type, vtable_field_virtual_functions)
           / TARGET_CHAR_BIT);
@@ -185,7 +187,8 @@
 gnuv3_rtti_type (struct value *value,
                  int *full_p, int *top_p, int *using_enc_p)
 {
-  struct type *vtable_type = gdbarch_data (vtable_type_gdbarch_data);
+  struct type *vtable_type = gdbarch_data (current_gdbarch,
+					   vtable_type_gdbarch_data);
   struct type *value_type = check_typedef (VALUE_TYPE (value));
   CORE_ADDR vtable_address;
   struct value *vtable;
@@ -293,7 +296,8 @@
                         struct fn_field *f, int j,
 			struct type *type, int offset)
 {
-  struct type *vtable_type = gdbarch_data (vtable_type_gdbarch_data);
+  struct type *vtable_type = gdbarch_data (current_gdbarch,
+					   vtable_type_gdbarch_data);
   struct value *value = *value_p;
   struct type *value_type = check_typedef (VALUE_TYPE (value));
   struct type *vfn_base;
@@ -368,7 +372,8 @@
 gnuv3_baseclass_offset (struct type *type, int index, char *valaddr,
 			CORE_ADDR address)
 {
-  struct type *vtable_type = gdbarch_data (vtable_type_gdbarch_data);
+  struct type *vtable_type = gdbarch_data (current_gdbarch,
+					   vtable_type_gdbarch_data);
   struct type *basetype = TYPE_BASECLASS (type, index);
   struct value *full_object, *vbase_object, *orig_object;
   struct value *vtable, *orig_typeinfo, *orig_base_info;
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.79
diff -u -r1.79 remote.c
--- remote.c	13 Apr 2002 00:12:30 -0000	1.79
+++ remote.c	12 May 2002 00:17:53 -0000
@@ -256,7 +256,7 @@
 static struct remote_state *
 get_remote_state ()
 {
-  return gdbarch_data (remote_gdbarch_data_handle);
+  return gdbarch_data (current_gdbarch, remote_gdbarch_data_handle);
 }
 
 static void *
Index: solib-svr4.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-svr4.c,v
retrieving revision 1.24
diff -u -r1.24 solib-svr4.c
--- solib-svr4.c	6 Apr 2002 01:51:35 -0000	1.24
+++ solib-svr4.c	12 May 2002 00:17:53 -0000
@@ -1293,7 +1293,7 @@
 svr4_fetch_link_map_offsets (void)
 {
   struct link_map_offsets *(*flmo)(void) =
-    gdbarch_data (fetch_link_map_offsets_gdbarch_data);
+    gdbarch_data (current_gdbarch, fetch_link_map_offsets_gdbarch_data);
 
   if (flmo == NULL)
     {
@@ -1330,7 +1330,7 @@
 init_fetch_link_map_offsets (struct gdbarch *gdbarch)
 {
   struct link_map_offsets *(*flmo) =
-    gdbarch_data (fetch_link_map_offsets_gdbarch_data);
+    gdbarch_data (gdbarch, fetch_link_map_offsets_gdbarch_data);
 
   if (flmo == NULL)
     return legacy_fetch_link_map_offsets;

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