HC12 Debug static Data Members

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HC12 Debug static Data Members

Jump to solution
1,203 Views
Pitsch
Contributor I

I use CodeWarrior IDE 5.7.0, HCS12X and C++.

 

My own SCI-Driver Class has only static Data Members and static Functions.

Code:

class CSCIDriver{public:      static void RxInterrupt ();      static unsigned char Data_read (unsigned char *Data);protected:      static unsigned char Buffer[256];      static unsigned char Bufferpos;}

 

 

How can I debug static Data Members of a class? I can not see the static members in the global selection of the module CSCIDriver.cpp.

Message Edited by CrasyCat on 2007-04-13 11:10 AM

Labels (1)
Tags (1)
0 Kudos
1 Solution
396 Views
CompilerGuru
NXP Employee
NXP Employee
static members are shown together with the non static members.
Well, I see the problem, if you do not have a non static member, you don't see them directly, although they are there.
I have at least two different workarounds for you.
- if you do define one global instance of your class, then it will show up in the variable window, and you can use it to see the statics. Note that this does not actually use memory as the variable is not allocated if it is not referenced.
- The second way is to use the inspect window and to look via the this pointer of some function in the symbol table. Unless you switched the compiler generated functions off, the re will be at least some compiler generated constructor which you can use. Again, the constructor is there even if it is not used.
I see that both those ways are not the real thing, well, at least you see your variables.

Daniel

View solution in original post

0 Kudos
1 Reply
397 Views
CompilerGuru
NXP Employee
NXP Employee
static members are shown together with the non static members.
Well, I see the problem, if you do not have a non static member, you don't see them directly, although they are there.
I have at least two different workarounds for you.
- if you do define one global instance of your class, then it will show up in the variable window, and you can use it to see the statics. Note that this does not actually use memory as the variable is not allocated if it is not referenced.
- The second way is to use the inspect window and to look via the this pointer of some function in the symbol table. Unless you switched the compiler generated functions off, the re will be at least some compiler generated constructor which you can use. Again, the constructor is there even if it is not used.
I see that both those ways are not the real thing, well, at least you see your variables.

Daniel
0 Kudos