This is the mail archive of the gdb-patches@sourceware.org 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 1/9] add a key to target sections


On 07/30/2012 04:20 PM, Tom Tromey wrote:
> In my earlier BFD-sharing patch series (the minsym-sharing one), I
> noticed that BFD-sharing actually caused bugs, because the
> target-section code relied on BFD uniqueness.
> 
> This patch adds a key to target sections so we can share BFDs without
> accidentally unpushing the target when a BFD is unrefed.  The key is
> just any handy 'void*'.
> 
> 	* exec.c (exec_close, exec_file_attach): Update.
> 	(add_to_section_table): Initialize 'key' field.
> 	(add_target_sections, remove_target_sections): Add 'key' argument.
> 	* exec.h (add_target_sections, remove_target_sections): Add
> 	'key' argument.
> 	* solib.c (solib_map_sections, update_solib_list, clear_solib)
> 	(reload_shared_libraries_1): Update.
> 	* target.h (struct target_section) <key>: New field.

Clever.  Works for me.

-- 
Pedro Alves


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