Greetings,
I'm using the Linaro tool chain with Eclipse (Juno) (under Windows) and openOCD to write firmware for an STM32F20x based design (using an ST-Link2 debugger).
In general, that all works fairly well.
The part I'm having problems with is debugging (step-in, etc) from Eclipse.
The execution flow seems chaotic when single stepping through C code: it skips statements, it jumps into the middle of a function, then returns to the start of a function, it loops over certain statements (while there's no loop in the code), etc. (It's close to useless).
I have seen this behavior with other IDE's and tool chains when code was built with optimization turned on.
However, I specify 'no optimization' (-O0) when I build my code.
My questions:
a) Is there some implicit optimization being done in the compiler, even though I tell it not to do so, which may affect proper debugging?
b) Are other people using Eclipse (Juno) and are they seeing the same issue? Are there any known ways to fix this chaotic debugger behavior?
Kind regards,
~ Paul Claessen
Hi Paul,
I use Eclipse Juno for some projects (Android, Python, LLVM) and the debug works as well as when using native gdb (which Eclipse uses), so anything weird is GDB's fault. ;)
On 24 May 2013 20:14, Paul CLaessen paul@claessen.com wrote:
a) **Is there some implicit optimization being done in the compiler, even though I tell it not to do so, which may affect proper debugging?
There should be none. O0 is also known as "debug illusion", which is the same as "keep the line information in code sequential order at all costs". Sometimes you get some jumping in C++ (C-tors, D-tors, static objects), but when going through a function, it shouldn't jump too much.
**
**
**b) **Are other people using Eclipse (Juno) and are they seeing the same issue? Are there any known ways to fix this chaotic debugger behavior?
I never used ST-Link, so I can't guess about its interaction with Eclipse, but if you have plain old C code compiled at O0, you should have no problems at all, especially with an MS, that is very deterministic.
Have you tried DS-5? Since it's an Eclipse based product and was built specifically for embedded debugging, at least you might want to try it out, using the same toolchain you use today, at least to remove some of the uncertainties...
cheers, --renato
linaro-toolchain@lists.linaro.org