title: Examine boost shared_ptr with gdb
body: <p>Following is my source code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;boost/shared_ptr.hpp&gt;
  
  class MyClass
  {
      public:
          MyClass()
          {
              i=10;
          }
      private:
          int i;
  };
  
  
  int main(int argc, const char *argv[])
  {
      boost::shared_ptr &lt;MyClass&gt; obj(new MyClass());
      return 0;
  }
  </code></pre>
  
  <p>I want to examine obj in gdb, and view the value of member variable i.</p>
  
  <p>This is what I get with normal print:</p>
  
  <pre><code>29          boost::shared_ptr &lt;MyClass&gt; obj(new MyClass());
  (gdb) n
  30          return 0;
  (gdb) p obj
  $1 = {px = 0x602010, pn = {pi_ = 0x602030}}
  </code></pre>
  
  <p>I tried the tip mentioned in <a href="http://tools.proteomecenter.org/wiki/index.php?title=Debugging%3aWorking_with_boost%3a%3ashared_ptr">this link</a> , but does not work.</p>
  
  <pre><code>(gdb) call (obj.get())-&gt;print()
  Cannot evaluate function -- may be inlined
  </code></pre>
  
  <p>Is there any other way? gdb version is 7.0.1.</p>