Print option in debugger

Leon Pollak leonp at plris.com
Wed Feb 28 10:24:55 GMT 2007


On Wednesday 28 February 2007, Andreas Pakulat wrote:
> On 27.02.07 17:07:34, Leon Pollak wrote:
> > Independently of the version, I should like to suggest to add to the
> > right click menu option "print variable" (as it is done in DDD.
> > This is very useful option, especially in the case when we do not have in
> > kdevelop possibility to hoover with cursor over variable and see its
> > value. This is because options "evaluate" and "watch" are more "solid",
> > while many times one needs to look at some variable once only.
>
> I don't really understand, print <variable> issued to the debugger
> wouldn't show you the variable value unless its a built-in C type, i.e.
> char*, int and such thing. And those are available using the value tree
> already. So IMHO there's no point in having that print option.
>
> Andreas
If I understand you correctly, the "value tree" is that appears in the 
variable window?
If yes, then how some variable appears there? By right clicking on it in the 
source window and choosing "evaluate" or "watch"? And thus it stays there 
forever. And if I choose "evaluate" it stays and makes me think that this is 
the value, which may already be changed. And to remove it, I must choose the 
menu...

Contrary, typing in the gdb console "p X" in 99% of the cases does the work.
What I meant in my first mail is to pass to the gdb simple command "p X", 
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.

Regards
-- 
Leon




More information about the KDevelop mailing list