This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] eliminate unused gdbarch free parameter
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Mon, 04 Aug 2003 18:21:35 -0400
- Subject: [commit] eliminate unused gdbarch free parameter
Hello,
The "free" parameter, previously used to free per-architecture data, is
no longer used. This eliminates it.
committed,
Andrew
2003-08-04 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (gdbarch_data_free_ftype): Delete declaration.
(register_gdbarch_data): Delete "free" parameter. Update
comments.
* gdbarch.h, gdbarch.c: Re-generate.
* reggroups.c (_initialize_reggroup): Update.
* gnu-v3-abi.c (init_gnuv3_ops): Update.
* frame-base.c (_initialize_frame_base): Update.
* frame-unwind.c (_initialize_frame_unwind): Update.
* user-regs.c (_initialize_user_regs): Update.
* remote.c (_initialize_remote): Update.
* regcache.c (_initialize_regcache): Update.
Index: frame-base.c
===================================================================
RCS file: /cvs/src/src/gdb/frame-base.c,v
retrieving revision 1.7
diff -u -r1.7 frame-base.c
--- frame-base.c 16 Jul 2003 22:29:13 -0000 1.7
+++ frame-base.c 4 Aug 2003 22:15:23 -0000
@@ -146,5 +146,5 @@
void
_initialize_frame_base (void)
{
- frame_base_data = register_gdbarch_data (frame_base_init, NULL);
+ frame_base_data = register_gdbarch_data (frame_base_init);
}
Index: frame-unwind.c
===================================================================
RCS file: /cvs/src/src/gdb/frame-unwind.c,v
retrieving revision 1.6
diff -u -r1.6 frame-unwind.c
--- frame-unwind.c 16 Jul 2003 22:29:13 -0000 1.6
+++ frame-unwind.c 4 Aug 2003 22:15:23 -0000
@@ -95,5 +95,5 @@
void
_initialize_frame_unwind (void)
{
- frame_unwind_data = register_gdbarch_data (frame_unwind_init, NULL);
+ frame_unwind_data = register_gdbarch_data (frame_unwind_init);
}
Index: gdbarch.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.c,v
retrieving revision 1.237
diff -u -r1.237 gdbarch.c
--- gdbarch.c 22 Jul 2003 19:49:57 -0000 1.237
+++ gdbarch.c 4 Aug 2003 22:15:55 -0000
@@ -5646,8 +5646,7 @@
};
struct gdbarch_data *
-register_gdbarch_data (gdbarch_data_init_ftype *init,
- gdbarch_data_free_ftype *free)
+register_gdbarch_data (gdbarch_data_init_ftype *init)
{
struct gdbarch_data_registration **curr;
/* Append the new registraration. */
Index: gdbarch.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.h,v
retrieving revision 1.204
diff -u -r1.204 gdbarch.h
--- gdbarch.h 22 Jul 2003 19:49:58 -0000 1.204
+++ gdbarch.h 4 Aug 2003 22:15:58 -0000
@@ -3257,7 +3257,11 @@
The per-architecture data-pointer is either initialized explicitly
(set_gdbarch_data()) or implicitly (by INIT() via a call to
- gdbarch_data()). FREE() is ignored.
+ gdbarch_data()).
+
+ Memory for the per-architecture data shall be allocated using
+ gdbarch_obstack_zalloc. That memory will be deleted when the
+ corresponding architecture object is deleted.
When a previously created architecture is re-selected, the
per-architecture data-pointer for that previous architecture is
@@ -3269,10 +3273,7 @@
struct gdbarch_data;
typedef void *(gdbarch_data_init_ftype) (struct gdbarch *gdbarch);
-typedef void (gdbarch_data_free_ftype) (struct gdbarch *gdbarch,
- void *pointer);
-extern struct gdbarch_data *register_gdbarch_data (gdbarch_data_init_ftype *init,
- gdbarch_data_free_ftype *free);
+extern struct gdbarch_data *register_gdbarch_data (gdbarch_data_init_ftype *init);
extern void set_gdbarch_data (struct gdbarch *gdbarch,
struct gdbarch_data *data,
void *pointer);
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.260
diff -u -r1.260 gdbarch.sh
--- gdbarch.sh 22 Jul 2003 19:49:58 -0000 1.260
+++ gdbarch.sh 4 Aug 2003 22:16:15 -0000
@@ -1175,7 +1175,11 @@
The per-architecture data-pointer is either initialized explicitly
(set_gdbarch_data()) or implicitly (by INIT() via a call to
- gdbarch_data()). FREE() is ignored.
+ gdbarch_data()).
+
+ Memory for the per-architecture data shall be allocated using
+ gdbarch_obstack_zalloc. That memory will be deleted when the
+ corresponding architecture object is deleted.
When a previously created architecture is re-selected, the
per-architecture data-pointer for that previous architecture is
@@ -1187,10 +1191,7 @@
struct gdbarch_data;
typedef void *(gdbarch_data_init_ftype) (struct gdbarch *gdbarch);
-typedef void (gdbarch_data_free_ftype) (struct gdbarch *gdbarch,
- void *pointer);
-extern struct gdbarch_data *register_gdbarch_data (gdbarch_data_init_ftype *init,
- gdbarch_data_free_ftype *free);
+extern struct gdbarch_data *register_gdbarch_data (gdbarch_data_init_ftype *init);
extern void set_gdbarch_data (struct gdbarch *gdbarch,
struct gdbarch_data *data,
void *pointer);
@@ -1890,8 +1891,7 @@
};
struct gdbarch_data *
-register_gdbarch_data (gdbarch_data_init_ftype *init,
- gdbarch_data_free_ftype *free)
+register_gdbarch_data (gdbarch_data_init_ftype *init)
{
struct gdbarch_data_registration **curr;
/* Append the new registraration. */
Index: gnu-v3-abi.c
===================================================================
RCS file: /cvs/src/src/gdb/gnu-v3-abi.c,v
retrieving revision 1.17
diff -u -r1.17 gnu-v3-abi.c
--- gnu-v3-abi.c 8 Jun 2003 18:27:13 -0000 1.17
+++ gnu-v3-abi.c 4 Aug 2003 22:16:15 -0000
@@ -433,7 +433,7 @@
static void
init_gnuv3_ops (void)
{
- vtable_type_gdbarch_data = register_gdbarch_data (build_gdb_vtable_type, 0);
+ vtable_type_gdbarch_data = register_gdbarch_data (build_gdb_vtable_type);
gnu_v3_abi_ops.shortname = "gnu-v3";
gnu_v3_abi_ops.longname = "GNU G++ Version 3 ABI";
Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.93
diff -u -r1.93 regcache.c
--- regcache.c 4 Aug 2003 21:12:46 -0000 1.93
+++ regcache.c 4 Aug 2003 22:16:17 -0000
@@ -1662,7 +1662,7 @@
void
_initialize_regcache (void)
{
- regcache_descr_handle = register_gdbarch_data (init_regcache_descr, NULL);
+ regcache_descr_handle = register_gdbarch_data (init_regcache_descr);
REGISTER_GDBARCH_SWAP (current_regcache);
register_gdbarch_swap (&deprecated_registers, sizeof (deprecated_registers), NULL);
register_gdbarch_swap (&deprecated_register_valid, sizeof (deprecated_register_valid), NULL);
Index: reggroups.c
===================================================================
RCS file: /cvs/src/src/gdb/reggroups.c,v
retrieving revision 1.5
diff -u -r1.5 reggroups.c
--- reggroups.c 4 Aug 2003 20:34:10 -0000 1.5
+++ reggroups.c 4 Aug 2003 22:16:17 -0000
@@ -259,7 +259,7 @@
void
_initialize_reggroup (void)
{
- reggroups_data = register_gdbarch_data (reggroups_init, NULL);
+ reggroups_data = register_gdbarch_data (reggroups_init);
/* The pre-defined list of groups. */
add_group (&default_groups, general_reggroup, XMALLOC (struct reggroup_el));
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.112
diff -u -r1.112 remote.c
--- remote.c 4 Aug 2003 20:52:27 -0000 1.112
+++ remote.c 4 Aug 2003 22:16:20 -0000
@@ -6056,7 +6056,7 @@
struct cmd_list_element *tmpcmd;
/* architecture specific data */
- remote_gdbarch_data_handle = register_gdbarch_data (init_remote_state, NULL);
+ remote_gdbarch_data_handle = register_gdbarch_data (init_remote_state);
/* Old tacky stuff. NOTE: This comes after the remote protocol so
that the remote protocol has been initialized. */
Index: user-regs.c
===================================================================
RCS file: /cvs/src/src/gdb/user-regs.c,v
retrieving revision 1.2
diff -u -r1.2 user-regs.c
--- user-regs.c 31 Jul 2003 21:42:39 -0000 1.2
+++ user-regs.c 4 Aug 2003 22:16:20 -0000
@@ -201,5 +201,5 @@
void
_initialize_user_regs (void)
{
- user_regs_data = register_gdbarch_data (user_regs_init, NULL);
+ user_regs_data = register_gdbarch_data (user_regs_init);
}