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] Remove same-pc breakpoint notification for internal BPs


On Thursday 21 April 2011 16:05:30, Tom Tromey wrote:
> >>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:
> 
> Pedro> I never understood why we need that function (as is implemented) though.
> 
> IIRC I added it to pull common code out of a few spots, and at the same
> time regularize it.  I think different spots were using slightly
> different checks.
> 
> I don't object to the current patch.
> 
> Pedro> What could be !user_settable_breakpoint whose b->number is > 0?
> Pedro> IOW, why isn't that just :
> [...]
> 
> I don't know; I think the change to introduce the function just
> commonized pre-existing code.

Yeah, user_settable_p, but I'm thinking further back than that.

user_settable_breakpoint was introduced here:

<http://sourceware.org/ml/gdb-patches/2001-06/msg00321.html>

but it was a refactor.  I looked at the sources of a gdb
of around that time, and internal breakpoints with negative
numbers already existed then.

I looked further back.  Looking at gdb 4.6's (1992) sources, gdb
already had breakpoint types (bp_until, etc.) by then, but there's no
decrementing `internal_breakpoint_number' yet, and the code
Cagney's patch is refactoring out appears to be there already,
in a more primitive form.  `internal_breakpoint_number' appears to
have been added circa 1996 (from ChangeLog).

breakpoint_1, gdb 4.2:

/*  We only print out user settable breakpoints unless the allflag is set. */
	if (!allflag
	    && b->type != bp_breakpoint
	    && b->type != bp_watchpoint)
	  continue;

It looks like this grew as breakpoint types were added, but when
`internal_breakpoint_number' was added, it was kept.

-- 
Pedro Alves


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