[lldb-dev] Frame documentation

Jose H jose.francisco.hevia at gmail.com
Tue Dec 2 16:44:57 PST 2014


Wow!! Greg, this is simple an incredible answer. Very useful
information, thank you again.

I was scrapping little bits of the information you have posted on your
mail on my own, but it is way more clear now. It will take a while for
me to process all this information.

One of the things I realized about variables is that they are not a
hierarchy but a network. So in order to make a graphical treeview that
in independent of the back end code it seems I need to do little
tricks.

Imagine we have an structure parent, parent references children, but
each children also references their parent, so we have circular
references or loop references.

The same could happen if we use double linked chain list , with each
node pointing to next node but also to the last one.

Now I want to represent the hierarchical structure of the variables in
a DataSource(the model of the data in a ModelViewContoller design)
that a viewcontroller is going to represent in the GUI. The
viewcontroller knows nothing about SBData or any other lldb code,
which makes porting(and maintaining) to other GUIs like Qt later much
easier.

So for generating this Data Model we load the frame variable parent*
as an SBValue, we dereference the pointers with each of their
children, now we continue with each children and we find the reference
to the parent again, so if we continue it will never end, and the
three will be infinite.

So for every reference I need some way of looking at the other
references in the in process tree, and if already there stop there.

But I suppose the people of lldb faced this problem before I did and
you have already solved it somehow. Did you?

Anyway,like with Frankenstein, the thing is finally taking shape and
soon will get alive. The possibilities lldb bring look out of this
world. Dreams like creating a video of the evolution of data
structures while the program become possible, making possible to see
your program from other perspectives and using parts of your brain
that monotone text atrophies is within reach now, something you could
almost touch now.



More information about the lldb-dev mailing list