This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB infinite loop when stepping on "while (1) i++;"
- From: qinwei<qinwei at sunnorth dot com dot cn>
- To: gdb at sourceware dot org
- Date: Thu, 22 Mar 2007 17:15:09 +0800
- Subject: Re: GDB infinite loop when stepping on "while (1) i++;"
> > When program stops at "while (1) i++;", and printing "next" command
will
> > cause gdb infinite loop.
> > The target are x86, score, or other? (gdb-6.6 release version)
> >
> > Is the reason that the following dwarf-2 info:
> >
> > "Special opcode 104: advance Address by 7 to 0x8048357 and Line by 1
to
> > 4"
> > "Advance PC by 7 to 804835e"
> >
> > which makes "while (1)" and "i++;" the same line number? And gdb will
get
> > "stop_pc" from the range [0x8048357, 0x804835e] and will not stop?
>
> Yes. The command `next' is used to move to advance execution to the next
> line of the current function.
Thanks!