![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
Andreas
Joined: 25 Oct 2004 Posts: 136
|
Constant ARRAY + Debugging |
Posted: Mon Jan 09, 2006 5:27 am |
|
|
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) |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Mon Jan 09, 2006 7:40 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|