'IAR cannot set breakpoint a certain lines

I am using IAR for Renesas . The problem I am facing is , I cannot set breakpoint at few lines. Though I recompile and load it multiple times , I am unable to set breakpoint at these lines. If I look at the map file, I do not find any memory allocated for these static variables which I am unable to set breakpoint. Is there any reason for memory being not allocated ?

Thanks



Solution 1:[1]

What optimisation level are you using?
Is it possible that the logic of your code has caused the entire section of code to be optimised away? The compiler will delete code that can never be reached. Look at the compiler assembly listing to see whether there is any code generated for the lines that you are interested in debugging.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 uɐɪ