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: FYI: add some breakpoint setter methods


> As an aside, it seems to me that the breakpoint observers should
> probably take a 'struct breakpoint *' as an argument, rather than a
> breakpoint number.  This would be more efficient: I think most users
> will want to have access to the actual breakpoint anyhow, and this would
> avoid a search through all breakpoints for the number.  Perhaps I will
> implement this.

Seems like a good idea. I had a discussion like that with one of the
contributors a while ago, trying to convince him to use a breakpoint
struct instead of the breakpoint number in his observer. I think it was
for annotations.  In any case, he argued that this was sufficient for
his needs so far, so I let it go, but it came back to "bite" me later on
("bite" <=> I had to change it to use struct breakpoint).

> 2011-01-27  Tom Tromey  <tromey@redhat.com>
> 
> 	* infcmd.c (finish_backward): Use breakpoint_set_silent.
> 	* python/py-breakpoint.c (bppy_set_silent): Use
> 	breakpoint_set_silent.
> 	(bppy_set_thread): Use breakpoint_set_thread.
> 	(bppy_set_task): Use breakpoint_set_task.
> 	* breakpoint.h (breakpoint_set_silent, breakpoint_set_thread)
> 	(breakpoint_set_task): Declare.
> 	(make_breakpoint_silent): Remove.
> 	* breakpoint.c (breakpoint_set_silent): New function.
> 	(breakpoint_set_thread): Likewise.
> 	(breakpoint_set_task): Likewise.
> 	(make_breakpoint_silent): Remove.

Just a nit I noticed:

> +/* Set the internal `silent' flag on the breakpoint.  Note that this
> +   is not the same as the "silent" that may appear in the breakpoint's
> +   commands.  */
> +
> +void
> +breakpoint_set_silent (struct breakpoint *b, int silent)
> +{
> +  int old_silent = b->silent;
> +  b->silent = silent;

Missing empty line after variable declaration (it's happening multiple
times throughout the patch).

-- 
Joel


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