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: 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!


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