CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Local Variables shown as out of scope while debugging

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
skoberlink



Joined: 27 May 2010
Posts: 52

View user's profile Send private message

Local Variables shown as out of scope while debugging
PostPosted: Fri Jan 07, 2011 10:24 am     Reply with quote

Hi everybody, I'm not sure if this is a CCS problem or an MPLab problem but I'm trying first here as I've had much better responses here.

I am using the PIC18F2620
CCS version 4.114
MPLab 8.60
MPLab ICD 2

I am debugging using the mplab ICD2 and mplab IDE. If my variables are declared as static I can see them without a problem. However if my variables are local they are listed as "Out of Scope" even if I am in the function that declares and uses them. I've been using this setup for some time with other projects and I Can't understand why this is suddenly happening on this new project.

Some digging discovered that others have had this problem with MPLab and C18 or C30 and fixed it by turning off optimization. I've tried that and it didn't help. I haven't been able to find CCS specific help. Any ideas? Thanks in advance!
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Fri Jan 07, 2011 3:24 pm     Reply with quote

I don't know -- it's ALWAYS been that way for me.

Using the WATCH window, you only get to see variables all the time that are global. (makes sense.)

For variables that are local to a function, that *are* out of scope when not in the function that uses them.

but they are still available to be ADDED to the WATCH window.. (that makes sense too).

I don't think I've ever seen different behavior than that.

Maybe I'm nuts. :D

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
skoberlink



Joined: 27 May 2010
Posts: 52

View user's profile Send private message

PostPosted: Fri Jan 07, 2011 4:32 pm     Reply with quote

Yeah I'm in the right scope when I'm having this problem. Also I can still view the locals in other projects (from their respective Watch windows of course). I did notice that some of them were visible from the main function that's in a different compilation unit.

Well for now I'll make do. Hope someone posts a solution tho...
hgida



Joined: 07 Jan 2011
Posts: 1

View user's profile Send private message

PostPosted: Fri Jan 07, 2011 4:34 pm     Reply with quote

I'm having a similar problem...

I have the following declared in a header file:
Code:

typedef struct context {
unsigned int 8 state;
unsigned int 8 transition;
} context_t;

I do the following in main:
Code:

void main (void){

context_t x;

init (&x);
}

When I try to look at the individual variables of the struct in MPLAB (v.8.60) and CCS (v4.055) I just get zeros or "out of scope" for the variable x.

Is there anyway I can see the variables and their values?

In the Editor Properties and under the "Tooltips" tab there are some Mouseover options which I have selected:
Enable Variable Mouseover Values
Show Address in Mouseover
Mouseover Active on Debug

However, none of them seem to be working. Any ideas why?

Thanks.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group