User forums > Using Code::Blocks

Debugging QString

<< < (7/7)

LordCB:
One more question.

When I type a command during debugging it seems CB stores the entered command somwhere.
Does aanybody knows in which file those commands are stored??

eranif:
I did not follow the entire discussion on this thread, but I assume that you are using the script I provided you with, and with it you should be able to view much short output..

for example, for this code:

--- Code: --- QString str;
str = "hello world";
--- End code ---

You should have get this output from gdb (using gdb 6.8 here), after typing 'printqstring str':


--- Code: ---(QString)0x22ff50 (length=11): "hello world"
--- End code ---


Is this still the case?

Eran

LordCB:
Yes I use your script you provided before.

But under gdb6.8 it doesnt work with gdb 6.3 it works.

I always search the gdb command to output the name of the variable. Perhaps like this:

--- Code: --- QString str;
str = "hello world";

(str)->(QString)0x22ff50 (length=11): "hello world"

--- End code ---

Is there a method for example $arg0.d->name or which methods are available in the script you provide.

I took the gdb reference but don“t find any command that gives me the name of the variable.

I try to add a third variable like this


--- Code: --- printf "(%c)->(QString)0x%x (length=%i): \"",$arg0,&$arg0,$arg0.d->size

--- End code ---

eranif:
$arg0 IS a QString
$arg0.d-> is part of the QString implementation and not related to gdb
using this:
printf "%c", $arg0 is equal to this:
printf ("%c", str) -> but as you can see, str is of type QString so it wont work...

You can not get the name of the argument, the same way you cant do it in C++/C

Eran

LordCB:
Hmmm.. Ok ?!?!?!

Thanx a lot I learn alot in this post thanx to all

Navigation

[0] Message Index

[*] Previous page

Go to full version