This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Why can't I set breakpoints elsewhere in this function?

I have build a project, and it has been running normally. Now, I want to test a font data, so I created a function. But strangely, although the compilation has been successful, I can't set breakpoints in this function. As a result, I can't perform step-by-step tracking debug, and when I trace, I find that those can't be set Breakpoint statements, when the program runs, it has skip directly, this is why? i can only set a break point in the "u8_t databuf[2*COL] = {0};",like this:

  • Hi,

    I would expect that code to be heavily optimized by the compiler, so that you end up with machine code that do not correspond directly to lines. Code may have been heavily modified, or removed completely. In that case you cannot put breakpoints at any particular line within that area.

    Try building a debug build, or otherwise disable optimization. Then all lines (with code on them) should be available for putting a breakpoint.

    Regards,
    Terje

Related