Table of Contents
• Building CodeLite - Linux
GDB pretty printing is a gdb feature that allows gdb to display complex objects (and other containers) in a more friendly way.
For example, when gdb pretty printing is disabled, viewing an STL map is pretty much useless. Consider the following code:
typedef std::map<std::string, int> StringToIntMap_t; ... StringToIntMap_t mymap; mymap.insert( std::make_pair("String One", 1) ); mymap.insert( std::make_pair("String Two", 2) ); mymap.insert( std::make_pair("String Three", 3) );
Without pretty printing enabled, viewing mymap in the Locals view will give the following:
However, with Pretty Printing enabled, it will look like this:
Before you can enable this feature within CodeLite, you will need to install the following:
Make sure to point CodeLite to the correct gdb. You can do this from the main menu Settings -> GDB Settings -> GNU gdb debugger -> General
Once everything is set up properly, go to CodeLite's menu bar: Settings -> GDB Settings -> GNU gdb debugger -> General and enable the option Enable GDB pretty printing.
Next, switch to Start up commands and make sure you have the following startup commands:
python import sys sys.path.insert(0, 'PATH_TO_CODELITE_SETTINGS_FOLDER/gdb_printers') from libstdcxx.v6.printers import register_libstdcxx_printers register_libstdcxx_printers (None) from qt4 import register_qt4_printers register_qt4_printers (None) from wx import register_wx_printers register_wx_printers (None) end
Note: make sure to replace
and under Windows it should point to:
Replace the placeholder
This is how the Startup Commands looks on my Windows box: