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 CCS Technical Support

MPLAB Won't Watch Some Variables

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



Joined: 05 Aug 2006
Posts: 149
Location: Redditch, UK

View user's profile Send private message Visit poster's website

MPLAB Won't Watch Some Variables
PostPosted: Thu Aug 25, 2011 7:48 am     Reply with quote

USING :
MPLAB 8.76
CCS PCM C Compiler, Version 4.123
PIC12F1840

I am trying to debug some code and noticed that some of my variables, structures and are not correctly shown in the WATCH window.

For example I have

Code:
#define   MAXCMDPARA   4
// Group Command Structure
typedef struct {
   uint8   len ;      // Command Group length
   char   cmd ;      // Command Type
//   uint16   adr ;      // Command Address
   uint8   adr ;      // Command Address
   uint8   para8[MAXCMDPARA] ;   // Parameters
} CmdGroup ;

// Group Command
CmdGroup grp ;



Which show in the .SYM files as :
04A-050 grp

But when I put 'grp' into the watch window it gives it the incorrect address of 000 rather than the expected 04A. It does however correctly give a '+' button which can show all the correct member symbols.

Is this an MPLAB or CCS issue Question
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Aug 27, 2011 1:51 pm     Reply with quote

For us to work on this, you need to post a complete (but extremely short)
test program that we can copy-and-paste into MPLAB, and compile and test.
Ttelmah



Joined: 11 Mar 2010
Posts: 19499

View user's profile Send private message

PostPosted: Tue Aug 30, 2011 2:25 am     Reply with quote

As a comment on this, you do realise that _local_ variables (ones declared inside a function), are not 'active', unless/until the debugger is inside the function that declares them. The same memory is re-used for other things when you are in other functions, and they will behave as you are describing.

Best Wishes
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