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: [RFA] Improve performance with lots of shared libraries


> 2011-07-01  Gary Benson  <gbenson@redhat.com>
> 
> 	* infrun.c (solib_event_breakpoint_helper_arg): New structure.
> 	(at_solib_event_breakpoint_helper): New function.
> 	(at_solib_event_breakpoint): Likewise.
> 	(handle_inferior_event): Avoid calling find_pc_partial_function
> 	and skip_inline_frames when stopping at the solib event breakpoint.

I just have a few general comments, that are minor, and yet important
(IMO).

> +/* Argument for at_solib_event_breakpoint_helper.  */
> +
> +struct solib_event_breakpoint_helper_arg
> +{
> +  CORE_ADDR prev_pc;
> +  int shlib_bp_count;
> +  int other_bp_count;

I think the meaning of each field should be documented. A good
example you could look at, for instance, is the declaration of
type struct frame_id in frame.h.

> +/* Helper for at_solib_event_breakpoint.  */

I think it's important to also say WHAT the function does.
'Helper' doesn't help in that respect (no pun intended).

> +static int
> +at_solib_event_breakpoint (struct execution_control_state *ecs)
> +{
> +  struct solib_event_breakpoint_helper_arg arg;
> +  arg.prev_pc = ecs->event_thread->prev_pc;
> +  arg.shlib_bp_count = arg.other_bp_count = 0;

Empty line between variable declarations and code...
(sorry, one of the innumerable coding style rules in the GDB project).

-- 
Joel


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