This is the mail archive of the gdb@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: How can I force the "next" command to use breakpoints and continue instead of single instruction stepping?


On Fri, Oct 25, 2013 at 1:38 PM, Trippi, Mike <mike_trippi@mentor.com> wrote:
> How can I force the "next" command to use breakpoints and continue instead of single instruction stepping?
>
> I have a case where my GDB client is sending the "next" command to do a C instruction step, and I would like my GDB client to implement that using a temporary breakpoint and a continue instead of an assembly step instruction. Is this a configurable option?

Hi.  It's not a configurable option.
One thing that makes this problematic is that gdb can't know, without
looking at the instructions, whether there's a branch there.  To
implement "next" correctly gdb would need to know all the possible
lines the current line could end up at.

If this is to speed up debugging via gdbserver, an optimization has
been added that will be out with 7.7, called "range stepping" where
gdb will give gdbserver a range to keep stepping in.  It's still not
as good as a tbreak at the next line and continue, but it has the
benefit of working in the presence of jumps.

There is also the "advance" command which you may want to read up on.


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