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]

[RFA 2/7 take 2] API for inhibiting section map updates


Tom Tromey wrote:
> >>>>> "Gary" == Gary Benson <gbenson@redhat.com> writes:
> 
> Gary> +void
> Gary> +inhibit_section_map_updates (void)
> Gary> +{
> Gary> +  get_objfile_pspace_data (current_program_space)->inhibit_updates = 1;
> Gary> +}
> Gary> +
> Gary> +/* See comments in objfiles.h.  */
> Gary> +
> Gary> +void
> Gary> +resume_section_map_updates (void)
> Gary> +{
> Gary> +  get_objfile_pspace_data (current_program_space)->inhibit_updates = 0;
> Gary> +}
> Gary> +
> Gary> +/* See comments in objfiles.h.  */
> Gary> +
> Gary> +void
> Gary> +resume_section_map_updates_cleanup (void *arg)
> Gary> +{
> Gary> +  resume_section_map_updates ();
> Gary>  }
> 
> It seems like it might be slightly safer if these all took the
> program space as an argument.  That way if something happens to
> change the current program space, then, e.g., the cleanup will
> still affect the program space for which it was made.
> 
> What do you think of that?

That's an excellent idea.  The attached patch implements this.

Cheers,
Gary

Attachment: rtld-probes-2-inhibit-sm-updates.patch
Description: Text document


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