This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: Breakpoints
- To: William Gatliff <gatliff at haulpak dot com>
- Subject: Re: Breakpoints
- From: David Williams <davidwilliams at ozemail dot com dot au>
- Date: Tue, 04 Jan 2000 08:53:13 +1100
- CC: "gdb at sourceware dot cygnus dot com" <gdb at sourceware dot cygnus dot com>
- References: <01BF4D1C.4AD8ABC0.davidwilliams@ozemail.com.au> <3870B8E0.B4BB4034@haulpak.com>
I have seen gdb use breakpoints when steping at the source level. It mostly uses
multiple 's' packets but occasionally uses a break point. Of course when stepping
over a function (next) it always uses a breakpoint. No one has given me a
definitive answer on this, but from my experience so far it would seem that gdb
does not set multiple breakpoints when stepping (using either step or next). If
anyone has had a different experience I would love to hear from you.
Thanks
David Williams
davidwilliams@ozemail.com.au
William Gatliff wrote:
> Whenever I have seen gdb step through source, it always uses multiple 's'
> packets--- it doesn't set breakpoints at all.
>
> b.g.
>
> David Williams wrote:
>
> > My question is still does GDB need to set more than one breakpoint when
> > stepping through source? Thinking about it a little more GDB should have
> > all of the information available to decide whether a branch will occur. It
> > has the current value of all the registers (esp CCR) so it can work it out
> > - the real question is does it use this information?
> >
> > Dave.
> >
> > ----------
> > From: Mark Salter[SMTP:msalter@cygnus.com]
> > Sent: Thursday, December 23, 1999 2:09 AM
> > To: kevinb@cygnus.com
> > Cc: davidwilliams@ozemail.com.au; gdb@sourceware.cygnus.com
> > Subject: Re: Breakpoints
> >
> > >>>>> Kevin Buettner writes:
> >
> > > On Dec 22, 2:29pm, David Williams wrote:
> > >> Does GDB ever need to set more than one breakpoint when stepping through
> > >> source code? I have not (as yet) seen this type of behaviour.
> >
> > > Can the target do a singlestep in hardware or do you have to do
> > > software emulation? If the latter, when you're stepping by machine
> > > instruction, you'd need two breakpoints on a conditional branch;
> > > one for the branch target, the other for the instruction after the
> > > branch.
> >
> > Even in the latter case, the stub can evaluate the condition of the
> > branch to see which way its going to go.
> >
> > --Mark
>
> --
> William A. Gatliff
> Senior Design Engineer
> Komatsu Mining Systems
> To teach is to learn.