|
From:
<and...@gm...> - 2007-05-10 23:16:04
|
I don't mind writing such a tool as I am very familiar with graphviz, but that is provided the Valgrind part of the equation is not too much work. I believe this could be done by a big copy and paste followed by some modification, but I hope you have some comments on that. Can the 'deepCopyIRSB(..)' work as a good complete example for traversing the list of trees? I am a little bit worried about the implementation not being commented, but it is a finite set of different types of functions that are used so maybe it will not be that bad. Is there any predefined IR traversals (ala Preorder, Postorder) implemented in Valgrind? Are the ppIR* functions the best templates for getting names/labels of a nodes in the VEX IR? It is a shame that the ppIR* family of functions don't rely on another set of functions which returns a C string or something similar, since such an implementation would allow side-effects to somewhere else than the screen if you wanted to. Do you think such a refactoring makes sense for Valgrind as a project? Memory deallocation would probably be an issue when returning C strings, so I don't know if you want to do this kind of change. An alternative implementation for getting the names for the IR nodes would be more specific to the graphviz dot generation. I could do a copy and paste of the printIR* and modify the functions to work specifically for the dot generation, but I don't like that design because it would make it such that two similar codes would have to be maintained in parallel. Andreas On 5/9/07, Nicholas Nethercote <nj...@cs...> wrote: > On Wed, 9 May 2007, Andreas S=E6bj=F8rnsen wrote: > > > Is a dot visualization tool available for the Valgrind IR or does such > > a tool for Valgrind not make sense at all? I remember seeing you use > > graphviz for the DDFG, but otherwise I can't think of seeing a > > graphical representation of your IR (btw. zgrviewer is excellent for > > visualizing dot graphs). > > IR is a list of trees, so you could visualise it with dot, but I don't th= ink > anyone has. > > > Is there any particular tools or techniques you use to more > > efficiently understand the IR when you are developing a tool? > > Not really, as far as I know. > > Nick |