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]

Re: [patch,rfc] Switch user-regs.[hc] to per-gdbarch obstack


Hello,

The attached patch switches the per-architecture user registers to use the per-architecture obstack. That way, if the architecture ever gets deleted, the allocated memory goes with it.

I'll look to commit this to the mainline in a few days.

I've checked this into the mainline.


Andrew

2003-07-28 Andrew Cagney <cagney@redhat.com>

	* user-regs.c (struct user_reg): Add "next" link.
	(struct user_regs): Replace "user" with "first" and "last" links.
	(append_user_reg): Add pre-allocated "reg" parameter.
	(builtin_user_regs): Provide initial value for "last".
	(user_reg_add_builtin): XMALLOC memory for append_user_reg.
	(user_regs_init): Allocate memory from the gdbarch obstack.
	(user_reg_add): GDBARCH_OBSTACK_ZALLOC memory for append_user_reg.
	(user_reg_map_name_to_regnum): Rewrite to search the user_reg
	linked list.
	(usernum_to_user_reg): New function.
	(user_reg_map_regnum_to_name): Use usernum_to_user_reg.
	(value_of_user_reg): Use usernum_to_user_reg.
	(user_regs_free): Delete function.
	(_initialize_user_regs): Update register_gdbarch_data call.




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