Re: How can I force the "next" command to use breakpoints and continue instead of single instruction stepping?
Doug Evans <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <CADPb22RTy0d4inhi74qJjZ0g_wbnhRwJGMqrgH9XnbR9MtSAvw@mail.gmail.com> |
On Fri, Oct 25, 2013 at 1:38 PM, Trippi, Mike <[email protected]> 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.