Jump to content
Sign in to follow this  
robcarter

Watch Window In Mplab

Recommended Posts

Hi

 

don't know if this is a sourceboost problem or mplab, maybe someone can advise?

 

I have declared a structure thus:

typedef struct{

unsigned int usage12;

....

unsigned int opvolts12;

unsigned char model_no [12];

unsigned char del_no[8];

unsigned char serial_no[6];

unsigned int acctime_12V;

unsigned int acctime_24V;

unsigned int chg_time;

unsigned int checksum;

}CONFIG_T;

and in main.c:

CONFIG_T config;

 

the code compiles ok and runs, but if i add the config variable to the watch is shows the structure but not the arrays within the structure, they are shown as a char, however the address within the structure is correct (see picture)

Can anyone advise if I am doing something wrong or is it mplab maybe

thanks in advance

rob carter

post-3075-1215794751_thumb.jpg

Share this post


Link to post
Share on other sites
Hi

 

don't know if this is a sourceboost problem or mplab, maybe someone can advise?

 

I have declared a structure thus:

typedef struct{

unsigned int usage12;

....

unsigned int opvolts12;

unsigned char model_no [12];

unsigned char del_no[8];

unsigned char serial_no[6];

unsigned int acctime_12V;

unsigned int acctime_24V;

unsigned int chg_time;

unsigned int checksum;

}CONFIG_T;

and in main.c:

CONFIG_T config;

 

the code compiles ok and runs, but if i add the config variable to the watch is shows the structure but not the arrays within the structure, they are shown as a char, however the address within the structure is correct (see picture)

Can anyone advise if I am doing something wrong or is it mplab maybe

thanks in advance

rob carter

 

 

 

Just discovered this problem myself and it is almost a year old with no answer.

 

Can only see the first element of a char array within a structure in MPLAB watch window.

 

Can't make any sense using the SourceBoost debugger either. Any solution apart from not using arrays in structures?

 

Regards

 

davidb

Share this post


Link to post
Share on other sites

What versions of MPLAB and SB are you using? I have periodically run into this problem. If you want to see what's in model_no you might have to put it separately into the watch window like this: config.model_no

 

I've also had problems viewing struct members when using a pointer to the struct. Not sure if it's MPLAB or SB or a combination of the two. Let us know what you find out.

Share this post


Link to post
Share on other sites
What versions of MPLAB and SB are you using? I have periodically run into this problem. If you want to see what's in model_no you might have to put it separately into the watch window like this: config.model_no

 

I've also had problems viewing struct members when using a pointer to the struct. Not sure if it's MPLAB or SB or a combination of the two. Let us know what you find out.

 

I am using:

 

SourceBoost V6.95

MPLAB V8.30

Win XP PRO SP3

 

I have no problems seeing the members of a structure, its when one or more of those members is an array. Take the following simple example:

 

struct {
unsigned char array[10];
unsigned char byte_a;
unsigned char byte_b;
}test;

 

When viewed using the watch window in MPLAB or SB dubugger the structure 'test' expands correctly to show the members byte_a and byte_b but array[] just appears as a normal char and does not expand any further so only the first element of this can be seen and modified. The generated code appears to work correctly and so only causes problems when debugging.

 

MPLAB help shows the correct expansion with their own compilers.

 

I am pretty sure this is an SB issue but haven't had time to prove it beyond all doubt.

 

davidb

Share this post


Link to post
Share on other sites
don't know if this is a sourceboost problem or mplab, maybe someone can advise?

 

I have declared a structure thus:

typedef struct{

unsigned int usage12;

....

unsigned int opvolts12;

unsigned char model_no [12];

unsigned char del_no[8];

unsigned char serial_no[6];

unsigned int acctime_12V;

unsigned int acctime_24V;

unsigned int chg_time;

unsigned int checksum;

}CONFIG_T;

and in main.c:

CONFIG_T config;

 

the code compiles ok and runs, but if i add the config variable to the watch is shows the structure but not the arrays within the structure, they are shown as a char, however the address within the structure is correct (see picture)

Can anyone advise if I am doing something wrong or is it mplab maybe

This issue has been fixed in BoostC V6.96, certain debug information was missing from the coff (debug file) generated by BoostC linker.

 

Regards

Dave

Share this post


Link to post
Share on other sites
This issue has been fixed in BoostC V6.96, certain debug information was missing from the coff (debug file) generated by BoostC linker.

 

Regards

Dave

Is there a bug list for RC1 (that we can view)? A release date for RC2 or final release? Not trying to give you headache by asking... just curious.

 

Thanks,

Henry

Edited by soft2

Share this post


Link to post
Share on other sites

Soft2,

This issue has been fixed in BoostC V6.96, certain debug information was missing from the coff (debug file) generated by BoostC linker.

 

Regards

Dave

Is there a bug list for RC1 (that we can view)? A release date for RC2 or final release? Not trying to give you headache by asking... just curious.

 

Thanks,

Henry

Yes. Its is on the version log page that is off the main download page:

http://www.sourceboost.com/CommonDownload/VersionLog.html

 

Regards

Dave

Share this post


Link to post
Share on other sites
don't know if this is a sourceboost problem or mplab, maybe someone can advise?

 

I have declared a structure thus:

typedef struct{

unsigned int usage12;

....

unsigned int opvolts12;

unsigned char model_no [12];

unsigned char del_no[8];

unsigned char serial_no[6];

unsigned int acctime_12V;

unsigned int acctime_24V;

unsigned int chg_time;

unsigned int checksum;

}CONFIG_T;

and in main.c:

CONFIG_T config;

 

 

 

the code compiles ok and runs, but if i add the config variable to the watch is shows the structure but not the arrays within the structure, they are shown as a char, however the address within the structure is correct (see picture)

Can anyone advise if I am doing something wrong or is it mplab maybe

This issue has been fixed in BoostC V6.96, certain debug information was missing from the coff (debug file) generated by BoostC linker.

 

Regards

Dave

 

V6.96 RC seems to have fixed this issue in MPLAB and arrays in structures expand correctly (and automatically) but it still doesn't seem to work at all in the SB Debugger. e.g. entering test.array shows 0x0 'NUL' but test.array[0] just gives an error.

 

davidb

Share this post


Link to post
Share on other sites

davidb,

V6.96 RC seems to have fixed this issue in MPLAB and arrays in structures expand correctly (and automatically) but it still doesn't seem to work at all in the SB Debugger. e.g. entering test.array shows 0x0 'NUL' but test.array[0] just gives an error.
Yes you are quite right, the missing coff information was added in V6.96 so it works in MPLABs.

Work is currently being done on SourceBoost IDE debugger to fix this issue and allow evaluation of complex expression, so this will be fixed in a future release.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×