Thursday, June 12, 2014

Debugging C++ Code with NetBeans and GDB on Linux

Download NetBeans

Download:
https://netbeans.org/downloads/index.html

Run the file, very easy install.

Debug

Start your program with debug symbols loaded.
NetBeans > Debug > Attach > Pick running program

STL Container Support

Reference:
https://sourceware.org/gdb/wiki/STLSupport

Change directory (cd) to the directory you want the scripts to live in

svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python

If you are behind a firewall, then you may need to edit the ~/.subversion/server file under [global] and uncomment all of the http-* commands and give them the correct info for your proxy. You should then change the svn:// to http://

Then edit the ~/.gdbinit file and add the following:

python
import sys
sys.path.insert(0, '/home/me/gdb_printers/python')
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end


No comments:

Post a Comment