This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Single stepping a simple C-program, but...
- From: Daniel Jacobowitz <drow at false dot org>
- To: Peter Toft <pto at linuxbog dot dk>
- Cc: gdb at sourceware dot org
- Date: Mon, 19 May 2008 16:28:47 -0400
- Subject: Re: Single stepping a simple C-program, but...
- References: <Pine.LNX.4.64.0805192201460.20752@petertoft.dk>
On Mon, May 19, 2008 at 10:18:36PM +0200, Peter Toft wrote:
> Why does the second "step" i.e. "s" take me BACK to line 7 after I have
> been in line 8????
Probably because you compiled with optimization on. The compiler
scheduled part of the call before the if was finished.
--
Daniel Jacobowitz
CodeSourcery