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] Fix "ambiguous linespec" regression: break lineno


On Fri, 08 Jun 2012 22:40:55 +0200, Tom Tromey wrote:
> However, why should this apply to linespecs used by 'break' but not by
> other ones?
+
> If we really need two, can we do the processing in linespec.c?

Because the values were called default_breakpoint_* before the patch
	commit eb1a2e1ef3957213a420bbeedff9c045016e3aa0
	Author: Justin Lebar <justin.lebar@gmail.com>
	skip/blacklist patch
renamed default_breakpoint_* into *_last_displayed_ functions.

So I find OK to use default_breakpoint_* in breakpoint.c and not to use
default_breakpoint_* in other .c files.


> Jan> +      if (last_displayed_sal_is_valid ()
> 
> linespec.c:initialize_defaults has:
> 
>       struct symtab_and_line cursal = 
> 	get_current_source_symtab_and_line ();
> 
> It seems like we have two similar notions here -- the "current" source
> line and the "last displayed" source line.

default_breakpoint_* vs. current_source_* locations were always duplicate this
way.


> This doesn't make sense to me.  Can we not just have a single notion and
> use it everywhere?

I have some draft patch almost without regressions but those two locations had
some logic.  "break" should put breakpoint to the current frame and not to
some last arbitrary line listed.

But that seems as definitely a cleanup patch outside of the scope of this one.


> I realize you're just reverting a bit of code - but is that ObjC hack
> really needed?  I'd like us to get away from this kind of thing.

It needs to detect the pattern ^[+-] (for 'break +5', 'break -3' etc.) but it
should not get confused by the ObjC breakpoints for -[func] or +[func].

I agree if the two locations get unified it is no longer needed.


Thanks,
Jan


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