This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/9] add a key to target sections
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 31 Jul 2012 17:40:04 +0100
- Subject: Re: [PATCH 1/9] add a key to target sections
- References: <87r4rt5l96.fsf@fleche.redhat.com>
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