Forums

Opinions on Atmel Studio4 sw?

Started by Martin Griffith July 2, 2008
I'm still trying to get away from the 8051 with the Raisonance C
compiler, which is normally fine for the junk I do. 

I've got the latest Winavr/GCC and Studio 4 installed, but I getting a
bit suspicious of the simulator in Studio 4 when doing stuff in C

It's probably me doing it wrong.

The simulator/debug seems to miss single stepping through procedures,
like my "TwiddlePORTD" routine, just appearing to ignore them in my
main while(1) loop. PORTD does update, so I'm wondering if I've missed
a menu somewhere for showing this?

Not a bad day, learnt quite a lot :)



martin
Martin Griffith wrote:

> The simulator/debug seems to miss single stepping through procedures, > like my "TwiddlePORTD" routine, just appearing to ignore them in my > main while(1) loop. PORTD does update, so I'm wondering if I've missed > a menu somewhere for showing this?
I don't know Atmel Studio, but I know GCC and maybe you compiled it with optimizing settings (e.g. -O3), which can confuse the debugger, because there is not always a 1:1 mapping between C code and assembler after optimizing. Try compiling it in debug mode, e.g. with -O0 -g3. -- Frank Buss, fb@frank-buss.de http://www.frank-buss.de, http://www.it4-systems.de
On Jul 2, 2:38 pm, Martin Griffith <mart_in_med...@yah00.es> wrote:

> The simulator/debug seems to miss single stepping through procedures, > like my "TwiddlePORTD" routine, just appearing to ignore them in my > main while(1) loop. PORTD does update, so I'm wondering if I've missed > a menu somewhere for showing this?
Most debuggers have two step buttons - one which steps "over" the call (executing it as if it were a single instruction) and another that steps into it. Then there's also often one to "step out" of the current procedure if you decide that it's not what you wanted to be looking at (or if you hit step in when you should have hit step over). Probably various icons on the menus and functions keys for these step capabilities. And the function key assignments are never consistent. Even between various product offerings of the same vendor!
On Wed, 2 Jul 2008 21:01:27 +0200, in comp.arch.embedded Frank Buss
<fb@frank-buss.de> wrote:

>Martin Griffith wrote: > >> The simulator/debug seems to miss single stepping through procedures, >> like my "TwiddlePORTD" routine, just appearing to ignore them in my >> main while(1) loop. PORTD does update, so I'm wondering if I've missed >> a menu somewhere for showing this? > >I don't know Atmel Studio, but I know GCC and maybe you compiled it with >optimizing settings (e.g. -O3), which can confuse the debugger, because >there is not always a 1:1 mapping between C code and assembler after >optimizing. Try compiling it in debug mode, e.g. with -O0 -g3.
Thanks Frank, I will try to get my head around GCC and make files. martin
On Wed, 2 Jul 2008 21:01:27 +0200, in comp.arch.embedded Frank Buss
<fb@frank-buss.de> wrote:

>Martin Griffith wrote: > >> The simulator/debug seems to miss single stepping through procedures, >> like my "TwiddlePORTD" routine, just appearing to ignore them in my >> main while(1) loop. PORTD does update, so I'm wondering if I've missed >> a menu somewhere for showing this? > >I don't know Atmel Studio, but I know GCC and maybe you compiled it with >optimizing settings (e.g. -O3), which can confuse the debugger, because >there is not always a 1:1 mapping between C code and assembler after >optimizing. Try compiling it in debug mode, e.g. with -O0 -g3.
Found it in an Atmel menu, set to O0, it works fine, but I could not find the g3 part Thanks :) martin
Martin Griffith wrote:

> Found it in an Atmel menu, set to O0, it works fine, but I could not > find the g3 part
-g3 creates many debug information, maybe you don't need it, if it works. Usually you can see all the switches in the compiling window. If you can't see any g-option, then the default, -g2, is used, which creates source code line number information, so from the GCC side it should work then. -- Frank Buss, fb@frank-buss.de http://www.frank-buss.de, http://www.it4-systems.de