cancel
Showing results for 
Search instead for 
Did you mean: 

Mismatch correlation between debug pointer and main.c

Fèlix
Associate II

When I debug a specific project I see that there is a big mismatch correlation between the “Debug Current Instruction Pointer�? (The blue arrow that highlights your next instruction to be executed) and the text. That means that maybe the debug pointer puts himself in a line where there are no any instruction, or it tells you that is in an instruction that isn’t really there because you can see how does not respect the execution order. You can see a picture of this attached to the post.

Tips:

I’ve tried the debug level at Defaul (-g2) and Maximal (-g3) with Optimization “None�? and “For Debug�?. And it seems to make no difference.

This only happends on main.c, in other core .c files like stm32h7xx_hal.c it works fine.

The main .c is 3000 lines long, I was wondering if this could be a problem. I’m very stuck on this. Any help will be very appreciated, thanks a lot.

Btw: I’ve not written any extra line of code after starting the debugging session. Because this is the typical error if you’re debugging and then you accidently add a new code line and you keep debugging, that the correlation between the Debug Pointer and the source file is displaced one line.

1 REPLY 1
KnarfB
Principal III

One reason might be inconsistent line endings in the source file, e.g. only a CR or LF where CR LF is expected etc..