This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: How to interrupt a stepping GDB ?
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: jimb at codesourcery dot com
- Cc: sascha at pasalacqua dot de, gdb at sourceware dot org
- Date: Mon, 3 Jul 2006 21:17:46 +0200 (CEST)
- Subject: Re: How to interrupt a stepping GDB ?
- References: <20060620122335.GB20079@nevyn.them.org> <vt2u05yczkx.fsf@theseus.home.>
> From: Jim Blandy <jimb@codesourcery.com>
> Date: Mon, 03 Jul 2006 11:28:46 -0700
>
> Maybe this has been discussed before, but:
>
> Should 'step' stop stepping if the PC fails to make forward progress?
> In every situation I can think of, that would mean that a loop
> iteration has been completed. It shouldn't affect loops that cover
> more than one line.
I think that's wrong; "step" operators on a line-level, not statement
level.
> But it might be confusing to the user: "I told it to step, and nothing
> happened!"
I think that would indeed be a problem.
The solution for the problem is to change the source code such that
there actually is a statement inside the loop:
while(a)
a--;
or perhaps
for (; a; a--)
;
will even work.
Mark