cancel
Showing results for 
Search instead for 
Did you mean: 

Variable Values

jean-claude
Associate II
Posted on July 21, 2009 at 13:30

Variable Values

8 REPLIES 8
jean-claude
Associate II
Posted on May 17, 2011 at 13:18

Hello,

In the IDE Ride7.

In debug mode, when we stop execution and see register.

It is possible to see values of our C-varibles.

[

For exemple,

int main(){

int i=0;

i++;

}

I want to see in an array after execution:

Variable Value

i 1

]

How do that ?

Thanks, JC.

st3
Associate II
Posted on May 17, 2011 at 13:18

As this question is specifically about the Raisonance RIDE-7, you should ask Raisonance!

I seem to remember that Raisonance had some ''issues'' with debugging local (automatic) variables...

jean-claude
Associate II
Posted on May 17, 2011 at 13:18

Thank for your answer,

So witch IDE do you use ?

Does it have issues ?

Can we see variables in an array ?

JC.

st3
Associate II
Posted on May 17, 2011 at 13:18

Quote:

Can we see variables in an array ?

The code you posted does not have any arrays!

jean-claude
Associate II
Posted on May 17, 2011 at 13:18

I would say if existed a windows in the IDE where we can see the values of our varibles.

In my exemple, at the end of execution, i = 1, and i want to check if the good value is save in my variable.

My last experience was on AVR studio 4 with PIC16F and this kind of windows was very useful.

JC.

vincentchoplin9
Associate II
Posted on May 17, 2011 at 13:18

Hi,

Ride allows to display the variables values using the 'watch' mechanism. See the Ride documentation (GettingStartedARM) for more information on how to display this view and add variables to it. Please also make sure that you have installed the latest version of the Ride and ARM kits, from the Raisonance website.

However, your example is so simple that the compiler will detect that variable i is written but never read. So the whole code referring to i will be optimized out and the variable will probably not exist at all, as the C standard allows. Therefore, you will not be able to watch this variable. This is what st7 was referring to as 'issues', but in fact it's just that people are not used to compilers being able to optimize this kind of code. So if you want to watch the i variable in such a simple code, you'll have to declare it as global and volatile. You will find more information on this here:

http://raisonance-forum.xsalto.com/viewtopic.php?id=2694

Best Regards,

Vincent

[ This message was edited by: VincentC on 21-07-2009 14:13 ]

st3
Associate II
Posted on May 17, 2011 at 13:18

Quote:

This is what st7 was referring to as 'issues'

Actually, it wasn't.

It is, of course, as you say about optimisation of trivial code like this - and that it is a common trap for newbies.

However, I seem to remember that RIDE had issues beyond this with displaying automatic variables...

But it was over a year ago now - so it might've been fixed, and/or I could be mistaken...

vincentchoplin9
Associate II
Posted on May 17, 2011 at 13:18

Hi,

Yes, this has improved a lot in the past few months, so if your last experience was one year ago, then I'm not surprised that you saw some problems. The current version is still not perfect, but it is much better.

Best Regards,

Vincent

[ This message was edited by: VincentC on 21-07-2009 17:02 ]