Writing a custom dumper
-
Hello,
I opened a bug report QTCREATORBUG-5508 for this, maybe I can get some help here.
What I want is a dumper that will display for a certain type a member or a function evaluation. The only thing I want to change is the 'Value' display for the class, I want to be able to expand it and see its members like before.
How do I do that?
-
Here is the "answer":http://doc.qt.nokia.com/qtcreator-snapshot/creator-debugging-helpers.html
-
I read the docs (see my bug report). That's not what I want.
Moreover, I tried to create a most simple dumper:
@
def qdump__MyClass(d, item):
d.putStringValue(item.value["string"])
d.putNumChild(0)
@with the code:
@
class MyClass
{
const char *string;
public:
MyClass() : string("test") {}
};int main()
{
MyClass c;
return 0;
}
@It makes gdb crash...
-
Got it. putStringValue is only for QString...
I did:
@
def qdump__MyClass(d, item):
d.putValue(encodeCharArray(item.value["string"], 40), Hex2EncodedLatin1)
d.putNumChild(0)
@now it works. Can it be simpler than that?
-
I found a simpler way:
@d.putValue(extractCharArray(item.value["string"], 40))@