Format in vars window

Vladimir Prus ghost at cs.msu.su
Mon Mar 12 06:31:10 GMT 2007


On Sunday 11 March 2007 21:50, Andreas Pakulat wrote:
> On 11.03.07 20:05:35, Leon Pollak wrote:
> > On Sunday 11 March 2007, Andreas Pakulat wrote:
> > > On 11.03.07 15:03:02, Leon Pollak wrote:
> > > > Hello.
> > > >
> > > > There is a very nice new option in variables window of the debugger -
> > > > formatting of the variable presentation in decimal, hex, etc...
> > > > Very useful thing.
> > > > I should like to ask, if possible, to add there a "string" option and
> > > > print simply a line of chars.
> > >
> > > Huh? char* should be printed and it does work for me. The same is true
> > > for QString's, I'm not sure about std::string.
> > >
> > > Andreas
> > OK, thanks, did not used this option of (char*) to my char str[20] array, 
> > because "p str" in gdb worked... Inertia...
> > Now, with this casting it works. But why to do casting? :-)
> 
> Well, I guess there's a reason, however that would be something that
> only Vladimir can answer. He barely reads this list, so I'm cc'ing
> it to the kdevelop-devel list. Please continue the discussion there.

Because gdb's default printing of char[20] is to print each element in turn.
I suppose we can override that; what should we do if there's no terminating
zero amoung those 20 chars? Just terminate the string at the 20th character?

- Volodya





More information about the KDevelop mailing list