Print option in debugger

Andreas Pakulat apaku at gmx.de
Wed Feb 28 14:40:54 GMT 2007


On 28.02.07 13:29:40, Leon Pollak wrote:
> On Wednesday 28 February 2007, Andreas Pakulat wrote:
> > > If yes, then how some variable appears there?
> > All variables that gdb reports are shown there, or what do you mean?
> I am not big in gdb interfaces, just a user. And I do not see in this window a 
> lot of variables mentioned in the code. Actually, only local variables are 
> displayed automatically and this is correct and good!
> But there are much more...:-))

Does that mean there exist variables at a given line of code that are
not shown in the variables window (regardless of their scope).

> > > where X is the variable under the cursor. And gdb knows very well which
> > > type is X. And it needs not be only the built-in C, as you mentioned. It
> > > knows all the types, classes, enums, defines, etc. defined in the
> > > executable.
> > Yes it knows the type, but knowing a given type doesn't tell it how the
> > type has to be printed. For example for QString you have to fetch a
> > specific internal member variable to get to the actual value and also
> > process that value a bit.
> Yes, there are many possible complicated cases where just "print" will not 
> work, I understand. And I do not suggest to use "print" INSTEAD of "watch" 
> or "evaluate". Just together. And it seems to be not very difficult to 
> implement, no?

No, its not that difficult to implement, the problem is that if that
variable shows up in the variables view and no proper value is displayed
then a p <var> won't help. If the variable just doesn't show up in the
variable view, then there's a problem with gdb. I'm just trying to find
out what exactly you are seeing, maybe you can upload a screenshot that
shows your problem to somewhere?

> I should like to say that you (and kdevelop team?) are a bit closed on the 
> concept of the strict, only KDE development.

I don't think so, QString was just an example. std::vector cannot be
printed either. I'm not sure if std::string can. Basically any variable
that uses struct or class cannot be printed, you can of course alwayes
navigate through the members and if those are printable then they show
up fine.

> But debugger interface, if compared to the rest of 
> the IDE is less rich (no suitable registers view, no mixed (source/asm) view, 
> problems with console and MI interface to gdb, etc.). I am not blaming 
> anybody in any way, just telling my own feelings...

You are free to write wishlist reports for any of these to get this for
4.0. The only thing that I think can't be done is a mixed source/asm
view, because our editor doesn't allow that.

Andreas

-- 
Don't go surfing in South Dakota for a while.




More information about the KDevelop mailing list