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

Constant ARRAY + Debugging

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



Joined: 25 Oct 2004
Posts: 136

View user's profile Send private message

Constant ARRAY + Debugging
PostPosted: Mon Jan 09, 2006 5:27 am     Reply with quote

Hi All,

Has somebody of You an Idea why the content of an const Array can not bee seen during debuging ?

What I mean :

I make a constant array like this:

static const char Filesystem[0x6E1] = {
0x84,0x1,0x28,0x0,0x2D,0xDD,0x0,0x69,0x6E,0x64};

This array has a length of 0x6E1 when complete.

then I make a search on entries like this:


Code:

    for (cnt2= 0; /*cnt2 < flcnt*/ filename[cnt2] != '.' ; cnt2++)
         {
         if (Filesystem[Ind+7+cnt2] != filename[cnt2])
            {
            ff = false;
            }
         }


If I like to debug with single step I never get the correct contents of Filesystem[] displayed, more over I always get the content of my serial Inputbuffer which is named completly different.

I think it has something todo with the way how CCS is implementing the
constant array, but maybe somebody has an idea how to overcome this
bottleneck

best regards
Andreas (Vienna)
Ttelmah
Guest







PostPosted: Mon Jan 09, 2006 7:40 am     Reply with quote

The 'easy' way, is to copy the value to a temporary variable. So:
temp=Filesystem[Ind+7+cnt2];

Will put the value into temp, where it can be looked at. Given that you know what you have put into the array, you can of course just work it out for yourself.
The point is that the constant retrieval, is actually a subroutine, which then calculates the memory address, and retrieves the byte(s) from this ROM address. There is no physical RAM storage associated with this (it is the contents of RAM, that the debugger displays). The same is true of other approaches to 'constant' storage on the PIC, it is not a CCS limitation.

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