View previous topic :: View next topic |
Author |
Message |
nurquhar
Joined: 05 Aug 2006 Posts: 149 Location: Redditch, UK
|
MPLAB Won't Watch Some Variables |
Posted: Thu Aug 25, 2011 7:48 am |
|
|
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 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Aug 27, 2011 1:51 pm |
|
|
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
|
|
Posted: Tue Aug 30, 2011 2:25 am |
|
|
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 |
|
|
|