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 to interrupt a stepping GDB ?


> 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


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