0

The problem I am facing is that on constantly hitting step over command, without being in a loop, you can expect the program counter arrow (->) to move to the bottom one (or more) lines at a time. I have a piece of software that makes lldb not work like that. So for those who are familiar with lldb behavior, which is I suppose, not that different from gdb, do you know why such a thing might happen?

It may seem not critical at first, but I find it confusing when debugging a piece of code that I am not familiar with and trying to study it from interactive debugger session.

On running source info in lldb when being at position X1 and then X2, I can see that the two lines have increasing consecutive non-overlapping ranges associated with them. But the thing is that X1 > X2...

2 Answers2

1

Are you compiling with optimizations? If so, the compiler often will generate code that will appear to hop around randomly. It also means that many variables will often not be available in the variable view. I would try compiling with -O0 for the best debugging experience.

Greg Clayton
  • 271
  • 2
  • 3
0

Well, an easy mistake to make. I have modified the source code after compiling the executable. Of course, the executable does not store any source code in it. So it simply refers to lines in a file as it knows them.