Folks,
Excuse me if I am asking dumb questions.
What I am trying to do:
I am trying to clone and modify MIVariableManager (and necessary classes around) to have one which can handle data from QtCreator pretty printers for Momentics. If I am looking at Qt types through Momentics, you simply get information which
is very hard (or impossible) to read, simple pretty printers such as we are using today simply sucks facing complexity of Qt objects.
QtCreator has very nice and powerful pretty printers, which are mimicking GDB/MI object behavior - we did some further changes which allow easy to put in CDT infrastructure for us.
Yet there are significant differences. CDT/GDB is using multistep evaluation of variable to e.g. access its children, there are also necessary workarounds to find if children are pretty printed etc. This is all resolved on Python level
in QtCreator PP.
While everything is driven by expressions there are some noticeable differences:
-
Qt PP are using something called iname - similar to GDB –var-create generated name
-
Values are generally encoded to avoid problem with platform dependent encoding
-
By getting particular variable, you are getting also its children + for it children, immediate children includes information about count of their descendants.
It would be very inefficient to copy every single step and do evaluations again and again, good example could be e.g MIRootVariableObject – if I have this object, I can also immediately construct it descendants as long as I have all info
to do so:
Two examples, creating “argv” and “mainApp”
^done,data="">
ild="0",type="char *",valueencoded="6",value="636f6d2e6578616d706c652e50756c6c4d7942656172642e746573\
744465765f50756c6c4d7942656172643433313133303465",},{addr="0x7a9f2d8",numchild="0",type="char *",val\
ueencoded="6",value="48656c6c6f",},{addr="0x7a9f2dc",numchild="0",type="char *",valueencoded="6",val\
ue="46726f6d",},{addr="0x7a9f2e0",numchild="0",type="char *",valueencoded="6",value="4242544c61756e6\
3685061727469636970616e74",},],type="char **",value="<4 items>",},],typeinfo=[{name="Y2hhciAq",size=\
"4"}{name="dW5zaWduZWQgY2hhcg==",size="1"}]
^done,data="">
ld="4",children=[{iname="local.mainApp.@1",name="[QObject]",addr="0x7a9f2b0",numchild="1",addr="0x7a\
9f2b0",type="QObject",value=" ",},{name="mSoundManager",addr="0x804a114",addr="0x804a114",numchild="\
2",origaddr="0x7a9f2b8",type="SoundManager",value="{...}",},],type="PullMyBeardApp",value="{...}",},\
],typeinfo=[{name="dW5zaWduZWQgbG9uZw==",size="4"}{name="U291bmRNYW5hZ2Vy",size="132"}{name="U291bmR\
NYW5hZ2VyICo=",size="4"}]
One problem I facing and I am not sure if I can crack through, is that MIRootVariableObject.create(….) after sending request to evaluate root variable and handleCompleted is finished, I have all data to create children … but I have very
weak idea what should be the approach to do so. Creating only expressions from iname property and asking all over again for all data would be inefficient -> I am very concerned by complexity of
public <V extends ICommandResult> ICommandToken queueCommand(final ICommand<V> command, DataRequestMonitor<V> rm) where a different commands queue each other and so on.
Does anybody know what would be the best approach?
Thank you,
--Petr
---------------------------------------------------------------------