System:
Code Warrior R6  (CWR6)
Palm OS Emulator 2.1d25
ROM: OS 3.1
Wintel

I've been experiencing erratic behavior with Code Warrior when trying to look at
 values in the debugger.
Specifically, I'm trying to store function pointers to member functions of a
class.  If I set a breakpoint and look at the value of the function pointer, it
shows as NULL (0).
However, the behavior seems to be erratic in the rest of the code.  Sometimes it
 will act as if the pointer is NULL, and sometimes not.

Here is a simple example that I've been using to try and debug the problem.  Set
 a breakpoint on #1 and you will see the pointer as NULL.
Then, step to #2.  Sometimes it will go there, sometimes not.

Any ideas?
Thanks in advance for any help!


  class Test {
  public:
     Test();
     void Increment();
     int i;
};

Test::Test() : i(0){
  void (Test::* pFunction)(void) = &Increment;  // #1debugger shows pFunction=0
  if (pFunction)
     (this->*pFunction)();    // #2 but we still step into this line!!
}

void Test::Increment(){
     i++;
}



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to