Re: RFA: patch to fix multi-breakpoint enable/disable handling of inline functions

Douglas Evans
2007-11-05T20:06:24Z

On Oct 22, 2007 2:25 PM, Daniel Jacobowitz <drow@false.org> wrote:
> On Mon, Oct 22, 2007 at 02:22:31PM -0700, Douglas Evans wrote:
> > Ping.
> >
> > I've split the patch into two parts, separating out the tweaks to
> > mb-templates.exp,mb-ctor.exp (I'll send this in a separate message).
> > I also fixed a few typos. The revised patch is attached.
> >
> > Ok to check in?
>
> I've been hoping Vladimir would look at this - Vladimir?
>
> If he doesn't have time I'll try to figure it out.

The bug is that transferring enable/disable status from the old
breakpoint list to the new one (which is done each time the program is
run) gets the wrong results for static inline functions with
multi-breakpoints. In my testcase 1.1 is enabled and 1.2 is disabled,
but when the program is run 1.1 becomes disabled and 1.2 becomes
enabled. The code uses strcmp to distinguish the functions but
clearly that can't work in this case. The patch adds code to
recognize this case of ambiguous function names and when detected uses
the pc address instead. Using the pc address is less preferable to
strcmp because if the user changes the program, functions can move,
but in this case strcmp doesn't work at all. OTOH the patch is simple
and gets the right answer most of the time. More complex solutions
are possible - I'd still add this patch until then, but that's just my
$0.02.