title: debugging with gdb: why this=0x0?
body: <p>I'm using gdb for debugging a program. And what I see is kind of strange:</p>
  
  <pre><code>(gdb) bt
  
  0xb59656f8 in globalCallStubClass::addCallContext (**this=0x0**)
      at /ccase_enodeb/callp/build_callp/src/test/framework/shared/src/shared_call_context.cc:1962
  
  0xb5b52e64 in rrcStubClass::process_scenario_spontaneous_trigger_RRC_CONNECTION_REQUEST (gcppMsgCtx=...)
      at /ccase_enodeb/callp/build_callp/src/test/framework/rrc/src/rrc_connection_request.cc:90
  
  0xb6c3be4c in Gcpp::routeMessage (this=0xb392e9d0) at /ccase_enodeb/callp/build_callp/src/callp_services/gcpp/src/gcpp.cc:1095
  
  0xb6c3b3b0 in Gcpp::loop (this=0xb392e9d0, Default_Method_Ptr=0)
      at /ccase_enodeb/callp/build_callp/src/callp_services/gcpp/src/gcpp.cc:925
  
  0xb58d2ae0 in stubBthdEntryPoint () at /ccase_enodeb/callp/build_callp/src/test/framework/root/src/stub_root.cc:314
  
  0x000191f8 in lxb_thd_entry (pCtx=0x68c0f8) at /vobs/onepltf/ltefdd/core/src/lxbase/lxbase.c:3289
  
  0xb575602e in start_thread () from /lib/arm-linux-gnueabi/libpthread.so.0
  
  0xb56d6ab8 in ?? () from /lib/arm-linux-gnueabi/libc.so.6
  
  0xb56d6ab8 in ?? () from /lib/arm-linux-gnueabi/libc.so.6
  Backtrace stopped: previous frame identical to this frame (corrupt stack?)
  
  (gdb) print pCallStub
  $1 = (globalCallStubClass *) **0x7a1da8**
  
  (gdb) print this
  $2 = (globalCallStubClass * const) **0x0**
  </code></pre>
  
  <p>The chrash appears at line marked with (-->):</p>
  
  <pre><code>if (pCallStub != NULL) {
  
  --&gt;callStubClass* pCallInst =  pCallStub-&gt;addCallContext();
  
  }
  </code></pre>
  
  <p>Function <code>addCallContext</code> is called for object <code>pCallStub</code> (<code>pCallStub</code> is instantiated and is not <code>NULL</code>). When I print <code>pCallStub</code> I can see that it has an address:</p>
  
  <pre><code>(gdb) print pCallStub
      $1 = (globalCallStubClass *) 0x7a1da8
  </code></pre>
  
  <p>but still, <code>this</code> (which should be <code>pCallStub</code>) is <code>0x0</code>:</p>
  
  <pre><code>(gdb) print this
      $2 = (globalCallStubClass * const) 0x0
  </code></pre>
  
  <p>Can anyone help me?</p>
  
  <p>Thanks,
  Geta</p>