hi,
i'm using a stm32f3discovery. I am compiling a really basic code, it works, but the debug windows seems broken; variable value seems wrong, but for sure actial code evidentation is wrong, as it "cicle" where there is no loop, and souch. break point seems to folow the evidentation and not the underling code.
i'm on linux with arm-none-eabi, and the same debug configuration used without chibios work just fine.
[solved]eclipse cdt + openocd degug wrong code/simbol
Moderators: RoccoMarco, lbednarz, tfAteba
[solved]eclipse cdt + openocd degug wrong code/simbol
Last edited by lesto on Sun May 25, 2014 3:26 pm, edited 1 time in total.
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: eclipse cdt + openocd degug wrong code/simbol
You need to compile without optimizations if you need an accurate debugging session: -O0 in the Makefile.
Giovanni
Giovanni
Re: eclipse cdt + openocd degug wrong code/simbol
it work!
thatk you. Could I suggest to chenge default makefile for demo to -O0, or add a comment about this? (i know probably this is basic concept for many )
BTW checked, my others's project makefile was using -Og -g3, but i will stick to -O0 for the debug session.
thatk you. Could I suggest to chenge default makefile for demo to -O0, or add a comment about this? (i know probably this is basic concept for many )
BTW checked, my others's project makefile was using -Og -g3, but i will stick to -O0 for the debug session.
Re: [solved]eclipse cdt + openocd degug wrong code/simbol
Using gcc's -O3 option is extermely aggressive; it will move code around and inline all sorts of things that you don't expect. Honestly I never have had trouble with -O1 causing debugging problems. I would probably recommend using -O1 as the base level optimization rather than -O0 unless you find it's still causing confusion. Using -O0 can actually be problematic in some cases, maybe someone else here can recall times where -O0 caused stack overflows or other weird behavior. I think the ChibiOS/RT idle thread may be one place such a problem can occur.