Add a note about Python pretty printers in GDB

This commit is contained in:
Fischlurch 2011-01-07 18:03:26 +01:00
parent 96c1192747
commit 21118d4831
3 changed files with 95 additions and 19 deletions

View file

@ -0,0 +1,64 @@
GDB Python pretty printers
==========================
Since some time, GDB supports Python written extension modules, especially
for pretty printing of data structures. A selection of pre-defined pretty printers
for STL containers is part of the standard distribution. The graphical debugger frontend
provided by the Eclipse CDT automatically uses this debugger provided presentation
to show the value of variables in the detail pane of the variables view, while the
individual variable entries always show the expandable structure view.
Installation notes
------------------
This feature requires an python enabled GDB (>6.8.50). Debian/Lenny isn't enough,
but compiling the GDB package from Debian/Squeeze (GDB-7.1) is straightforward.
Moreover, you need to check out and install the python pretty-printers and
you need to activate them through your +~/.gdbinit+
[source,python]
----
#
# .gdbinit : GDB Config file
#
# 3/2010 - Ichthyo: add python pretty printers for STL
python
import sys
sys.path.insert(0, '/opt/gdb/stlPrettyPrinter')
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end
----
For more informations link:http://sourceware.org/gdb/wiki/STLSupport[see here..]
.Hello World
[source,C]
----
#include <iostream>
#include <string>
#include <vector>
using std::string;
using std::cout;
using std::endl;
int
main (int, char**)
{
std::string str = "hullo wöld";
std::vector<int> vec (1000);
for (uint i = 0; i < vec.size(); ++i)
vec[i] = i;
cout << str << "\n.gulp.\n";
return 0;
}
----
When selecting the string or the vector in the Eclipse variables view
(or when issuing "print str" at the GDB prompt), the GDB python pretty-printer
should be activated.

View file

@ -0,0 +1,18 @@
Developer HOWTOs
================
This section contains a loose collection of instructions, recipes, tutorials and
similar usefull pieces of information targeted at Lumiera developers. See also
- the general link:{l}/project/faq.html[Lumiera FAQ]
- the link:{ldoc}/user/index.html[User documentation]
== Notepad
- link:DebugGdbPretty.html[Python pretty printers for GDB]
[icon="warning.png"]
WARNING: Website under construction

View file

@ -1,40 +1,34 @@
////
Technote Documentation
======================
Technical Documentation
=======================
* link:http://www.lumiera.org/doxy/[Doxygen generated documentation]
* link:gui/index.html[GUI-Layer]
* link:proc/index.html[Proc-Layer]
* link:backend/index.html[Backend]
* link:build/index.html[Buildsystem]
[icon="warning.png"]
WARNING: Website under construction
////
== Technical Documentation
This documentation section contains technical documentation about Lumiera.
To get an overview of all the internals and components, you might want to read
link:innerCore/the_inner_core.html[Lumiera the Inner Core]
=== Three Layers
== Three Layers
The technical documentation is split in three parts, one for each of the three main layers of Lumiera.
You may want to read the link:../design/index.html[Design Documents] first to get an overview of all the components.
* link:gui/index.html[*Graphical User Interface*] : Documents about the default GTK GUI that comes with Lumiera.
* link:gui/index.html[*Graphical User Interface*] : Documents related to the GTK based Lumiera GUI
* link:proc/index.html[*Processing layer*]
* link:proc/index.html[*Processing layer*] : Documents regarding Session, models and the engine structure
* link:backend/index.html[*Backend system*]
* link:backend/index.html[*Backend system*] : Documents about the data and processing backend
== Tools
=== Tools
.Development
* link:http://www.lumiera.org/doxy/[*Doxygen generated documentation*] : Complete reference for the code of Lumiera.
.Building
* link:build/index.html[*Buildsystem*] : Installation & compilation tools, dependencies and packaging.
.HOWTO
* link:howto/index.html[*Developer HOWTOs*] : Collection of instructions, recipes, hints and similar
materials intended for developers
[icon="warning.png"]
WARNING: Website under construction