Discussion:
Newline in CDT variable inspection
Ruben Stein
2009-11-09 17:05:55 UTC
Permalink
Hello,

I just stumbled over the python-enabled printing of stl-containers from
the gdb-wiki:

http://sourceware.org/gdb/wiki/STLSupport

Having enabled this I hoped to get rid of switching to the gdb-console
inside cdt to watch containers in a pretty formatted way. My problem is:

Printing a variable on GDB-Console inside CDT gives this output:

p initialLEDs

$1 = std::map with 2 elements = {
[1] = {
x = 124,
y = 99,
led = 1 '\001',
val = 0
},
[2] = {
x = 126,
y = 102,
led = 2 '\002',
val = 0
}
}

fine - just what I want.

Clicking on the "Variables" tab to this variable instead shows this:

std::map with 2 elements = {\n [1] = {\n x = 124, \n y = 99, \n
led = 1 '\001', \n val = 0\n },\n [2] = {\n x = 126, \n y =
102, \n led = 2 '\002', \n val = 0\n }\n}

Deflating the triangle in front of the variable shows the STL internals
as usual. Is this the "intended" or at least current behaviour of CDT? I
don't know as I just started using the python printing.

I found the following in bugzilla, but this seems to be related to the
application console and should be resolved in CDT 6.01.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=255946
https://bugs.eclipse.org/bugs/show_bug.cgi?id=286785

My Versions:
Version: 3.5.1
Build id: M20090917-0800

I tried several versions of CDT:
CDT: 5.0.2 / 6.0.1 / 6.0.2-I200911060608

Is it normal, that the newline character is not parsed in the variables
value frame? Am I just missing any setting?

Regards, Ruben

Loading...