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++;"


(gdb) n
4         while (1) i++;
(gdb) n

I think there is nothing wrong. You let GDB next, it next. And your line is a infinite loop, so it never stops.


If "while (1) i++;" in you source code is put in a line. I think the debugging information should be a line. If not, maybe you compiler has problems. It is different with a single line function, i.e. "int a() {}".

If you want to step into, why not use "step"?

Wenbo

--
Wenbo Yang
SimpLight Nanoelectronics Ltd.




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