Author Topic: how to debug with Code::Blocks in step mode ?  (Read 6148 times)

Offline vfdff

  • Multiple posting newcomer
  • *
  • Posts: 19
how to debug with Code::Blocks in step mode ?
« on: April 05, 2009, 10:44:21 am »
I can't watch the value int the watch ? only seeing some '?' with the value  same as 
i = No symbol 'i' in current context

my code:
/*
 */

#include <avr/io.h>

int main(void)
{

    // Insert code
    int i = 34;
    int tt = 2*i;

    i= tt+3;
    i <<= 2;

    while(1)
    {
        i++;
    }
    ;

    return 0;
}
while in which can be seen some "i" in the context

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: how to debug with Code::Blocks in step mode ?
« Reply #1 on: April 05, 2009, 11:27:04 am »
A little less information.

Which OS are you on, which version of C::B do you use, which compiler (and version) and which debugger and version ?

Can you give the steps to reproduce the problem (works without problems for me) ?

Offline vfdff

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: how to debug with Code::Blocks in step mode ?
« Reply #2 on: April 08, 2009, 07:30:54 am »
I use it on my windows xp operation,and choose avr project to create ,and compile with avr gcc ?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5218
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: how to debug with Code::Blocks in step mode ?
« Reply #3 on: April 15, 2009, 01:31:43 pm »
I use it on my windows xp operation,and choose avr project to create ,and compile with avr gcc ?

I'm not sure AVR GCC can debug?
Why not try MinGW?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline vfdff

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: how to debug with Code::Blocks in step mode ?
« Reply #4 on: April 18, 2009, 12:00:01 pm »
yeah, it runs all right with GCC