Re: Breakpoints in "unrolled loop"



Oliver Betz wrote:
Hello All,

what's the behaviour of your debugger(s) when the code contains
unrolled loops, IOW one source statement corresponds to many locations
in the binary?

I don't see why that should pose any particular problem. Debug information is usually stored as a function of binary location, i.e. you give it a binary location, and it looks up the source location from that.

It's usually the *opposite* case that causes troubles, i.e. when code folding has turned multiple copies of the same functionality into a single instance. Debuggers tend to behave very confusingly in such cases, jumping to what look like totally unrelated pieces of source code that just happen to expand to the same binary code. E.g. as you're stepping through one function, and nearing its end, it'll beam you straight to another function, possibly in another source file, that just happens to end in the same code sequence.

Ultimately, ease of debugging and optimal code are contradicting goals. The better you get at the latter, the worse you'll fare on the former.
.