HC12 Debug static Data Members

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

HC12 Debug static Data Members

ソリューションへジャンプ
1,804件の閲覧回数
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

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
997件の閲覧回数
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 件の賞賛
返信
1 返信
998件の閲覧回数
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 件の賞賛
返信