Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] "display as array" behavior

You will need at least gdb 7.0 with python support. Then you must install the 
STL pretty printers (see http://sourceware.org/gdb/wiki/STLSupport). This way 
you will get the content of STL vectors shown in the variables detail pane.

However, to get pretty printing working properly in Eclipse you need the 
following patch https://bugs.eclipse.org/bugs/show_bug.cgi?id=302121

  Axel

Am Donnerstag 15 Juli 2010, 01:13:17 schrieb Tim Black:
> I couldn't find any conclusion about this on the CDT Forum or in Bugzilla,
> so here goes:
> 
> I am getting strange behavior when doing "Display as array" on the array
> pointer found within a std::vector in the Variables tab of Debug
> perspective while actively debugging using GDB/MI launcher and Helios
> release. "Display as array" seems to work fine on a "regular" int *, and I
> can redisplay with different sized to my heart's content. However, when I
> simply try to open up a vector in the Variables tab, either before or
> after my code has
> initialized and resized the vector, I get the following in the GDB console:
> 
> "A syntax error in expression, near `v))'.
> 
> where v is defined as "std::vector<int> v;".
> 
> Of course, any subsequent attempts to open up members of v result in
> similar "syntax error in expression" GDB errors. When I try to "Display as
> array" on the vector data pointer _M_start, I get the syntax error as well
> as:
> 
> "mi_cmd_var_create: unable to create variable object."
> 
> If I change my launcher to "Standard Create Process" type this works
> better, but still not perfectly:
> 
> The first time I "display as array", it displays the correct number of
> elements. Sometimes, and frequently, subsequent attempts to "display as
> array" on that same pointer result in:
> 
> (a) the pointer is no longer displayed as an array and its value is not
> even displayed
> (b) upon relaunching the same debug launcher, the same pointer will always
> be displayed as array with the last requested length (the one that failed
> previously).
> 
> Not being able to view arrays is obviously a pretty serious problem for an
> IDE. Let me know if I can provide more info, if you know of a workaround,
> or if I should file a bug...
> 
> Thanks,
> T



Back to the top