https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95360
--- Comment #6 from Yibiao Yang <yangyibiao at hust dot edu.cn> --- (In reply to Jonathan Wakely from comment #2) > (In reply to Yibiao Yang from comment #0) > > As showed, Line 6 is hit first and then hit Line 7 with stepi. > > However, when using step, gdb is first hit Line 7 and then hit Line 6. > > This is an inconsistent behaviors between stepi and step > > Why is that a bug? Why is it a GCC bug? To be honest, I am not sure whether this is a gcc bug or a gdb bug. I am very sorry for that. I report it here as I doubt that the line table is generated incorrectly by compilers.