This is the mail archive of the gdb-patches@sources.redhat.com 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: [hjl@lucon.org: PATCH: Fix restarting breakpoint (Re: gdb 5.2 removes the conditional breakpoints)]


On Fri, May 17, 2002 at 12:50:53PM -0500, Jim Blandy wrote:
> 
> Daniel Jacobowitz <drow@mvista.com> writes:
> > Well... which is more intuitive?  If I step over a line in an
> > optimized program, and step until I end up on it again (i.e. it was
> > divided into parts) and type 'break', I think that ending up at $PC
> > again is more natural.  But I see a good argument either way.
> 
> I agree that what you describe is more natural.  I see now that the
> sal's symtab and line are merely the line *containing* the given PC;
> the PC could be on any instruction attributed to that line.  I don't
> see any way to allow such a breakpoint to float the way it should when
> the user recompiles.  So unless you see a better solution, this patch
> is approved.  A regression test would be nice.

I'm in blast-from-the-past mode tonight, can you tell?

I've checked this in.  I'm keeping this message around so that I can
remember to write a regression test for it...

No regressions.

> > > > 2002-04-17  H.J. Lu  (hjl@gnu.org)
> > > > 
> > > > 	* breakpoint.c (create_thread_event_breakpoint): Use xasprintf.
> > > > 	(create_breakpoints): Make sure the addr_string field is not
> > > > 	NULL.
> > > > 
> > > > --- gdb/breakpoint.c.break	Wed Mar  6 22:30:42 2002
> > > > +++ gdb/breakpoint.c	Wed Apr 17 17:29:58 2002
> > > > @@ -3859,14 +3859,12 @@ struct breakpoint *
> > > >  create_thread_event_breakpoint (CORE_ADDR address)
> > > >  {
> > > >    struct breakpoint *b;
> > > > -  char addr_string[80];		/* Surely an addr can't be longer than that. */
> > > >  
> > > >    b = create_internal_breakpoint (address, bp_thread_event);
> > > >    
> > > >    b->enable_state = bp_enabled;
> > > >    /* addr_string has to be used or breakpoint_re_set will delete me.  */
> > > > -  sprintf (addr_string, "*0x%s", paddr (b->address));
> > > > -  b->addr_string = xstrdup (addr_string);
> > > > +  xasprintf (&b->addr_string, "*0x%s", paddr (b->address));
> > > >  
> > > >    return b;
> > > >  }
> > > > @@ -4422,7 +4420,12 @@ create_breakpoints (struct symtabs_and_l
> > > >  	b->number = breakpoint_count;
> > > >  	b->cond = cond[i];
> > > >  	b->thread = thread;
> > > > -	b->addr_string = addr_string[i];
> > > > +	if (addr_string[i])
> > > > +	  b->addr_string = addr_string[i];
> > > > +	else
> > > > +	  /* addr_string has to be used or breakpoint_re_set will delete
> > > > +	     me.  */
> > > > +	  xasprintf (&b->addr_string, "*0x%s", paddr (b->address));
> > > >  	b->cond_string = cond_string[i];
> > > >  	b->ignore_count = ignore_count;
> > > >  	b->enable_state = bp_enabled;
> > > > 
> > > > 
> > > > ----------

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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