Note that there are some explanatory texts on larger screens.

plurals
  1. POPretty Printers for debugging C++ code with Eclipse/CDT in Mac OS
    primarykey
    data
    text
    <p>I'm trying to accomplish pretty printers (for viewing variables of type vectors,lists etc, STL containers) for debugging C++ using Eclipse (Version: Kepler Service Release 1) and CDT <strong>in Mac OSX Mountain Lion</strong>. I know I can use XCODE to debug, but want to debug using Eclipse. I appreciated any help. Thanks.</p> <p>I tried the following, but failed debugging:</p> <ol> <li><p>Downloaded GNU gdb from <code>ftp://ftp.gnu.org/gnu/gdb/gdb-7.6.tar.gz</code></p></li> <li><p>Installed GNU GDB with python the following way</p> <pre><code>./configure --prefix=/usr/local/gdb7.6 --with-python=/usr/bin/python make make install </code></pre></li> <li><p>Checked-out the latest Python libstdc++ printers to a folder ~/gdb_printers</p> <pre><code>svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python </code></pre></li> <li><p>Created ~/gdb_printers/.gdbinit and added the following in the .gdbinit file</p> <pre><code>python import sys sys.path.insert(0, '/Users/ravi/gdb_printers/python') from libstdcxx.v6.printers import register_libstdcxx_printers register_libstdcxx_printers (None) end </code></pre></li> <li><p>Eclipse Setup</p></li> </ol> <p>In Windows > Preferences > C/C++ > Debug > GDB</p> <p>Where it Says GDB Debugger <code>/usr/local/gdb7.6/bin/gdb</code></p> <p>Where it says GDB Command File: <code>/Users/ravi/gdb_printers/.gdbinit</code></p> <ol> <li><p>Now, when I try to debug, I get the following error.</p> <pre><code>Error in final launch sequence Failed to execute MI command: source /Users/ravi/gdb_printers/.gdbinit Error message from debugger back end: /Users/ravi/gdb_printers/.gdbinit:6: Error in sourced command file:\nError while executing Python code. /Users/ravi/gdb_printers/.gdbinit:6: Error in sourced command file:\nError while executing Python code. </code></pre></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload