* 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.
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.
+
* regcache.c (xfree_regcache_descr): Delete function.
(_initialize_regcache): Update call to register_gdbarch_data.
(init_regcache_descr, init_legacy_regcache_descr): Use
void
_initialize_frame_base (void)
{
- frame_base_data = register_gdbarch_data (frame_base_init, NULL);
+ frame_base_data = register_gdbarch_data (frame_base_init);
}
void
_initialize_frame_unwind (void)
{
- frame_unwind_data = register_gdbarch_data (frame_unwind_init, NULL);
+ frame_unwind_data = register_gdbarch_data (frame_unwind_init);
}
};
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. */
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
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);
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
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);
};
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. */
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";
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);
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));
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. */
void
_initialize_user_regs (void)
{
- user_regs_data = register_gdbarch_data (user_regs_init, NULL);
+ user_regs_data = register_gdbarch_data (user_regs_init);
}