|
From:
<and...@gm...> - 2007-05-08 20:10:58
|
I am starting my Valgrind learning process and I have a question
regarding which developer resources are available. What I am looking
for is
* a lot of small examples on how to extract information from the IR
* API and/or IR node documentation
* any other helpful documentation
(for various reasons I am not able to run make dist)
Thanks
Andreas
|
|
From: Nicholas N. <nj...@cs...> - 2007-05-08 22:21:28
|
On Tue, 8 May 2007, Andreas S=E6bj=F8rnsen wrote: > I am starting my Valgrind learning process and I have a question > regarding which developer resources are available. What I am looking > for is > * a lot of small examples on how to extract information from the IR > * API and/or IR node documentation > * any other helpful documentation > (for various reasons I am not able to run make dist) First, make sure you have up-to-date code from the SVN repository (trunk),= =20 as some documentation has been improved compared to 3.2.3. The main IR documentation is in VEX/pub/libvex_ir.h. It's reasonably=20 comprehensive in terms of what is available. As for examples, the existing tools are the best for that. Start with=20 Lackey (lackey/lk_main.c) which is fairly simple and extracts a few=20 different kinds of information. Nick |
|
From:
<and...@gm...> - 2007-05-09 15:48:24
|
Thanks. :) My follow up question is how you efficiently can explore the IR when developing a tool. In some of my previous work I have done analysis on ASTs and for that application graphviz dot graphs has been very useful for understand the AST. As the IR is extremely large (and probably not of a set size in general) I am not sure if such a tool would make sense for anything else but visualizing small parts of it, but it is at least worth a thought. 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). Is there any particular tools or techniques you use to more efficiently understand the IR when you are developing a tool? Andreas On 5/8/07, Nicholas Nethercote <nj...@cs...> wrote: > On Tue, 8 May 2007, Andreas S=E6bj=F8rnsen wrote: > > > I am starting my Valgrind learning process and I have a question > > regarding which developer resources are available. What I am looking > > for is > > * a lot of small examples on how to extract information from the IR > > * API and/or IR node documentation > > * any other helpful documentation > > (for various reasons I am not able to run make dist) > > First, make sure you have up-to-date code from the SVN repository (trunk)= , > as some documentation has been improved compared to 3.2.3. > > The main IR documentation is in VEX/pub/libvex_ir.h. It's reasonably > comprehensive in terms of what is available. > > As for examples, the existing tools are the best for that. Start with > Lackey (lackey/lk_main.c) which is fairly simple and extracts a few > different kinds of information. > > Nick |
|
From: Nicholas N. <nj...@cs...> - 2007-05-09 21:42:34
|
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 thin= k=20 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 |
|
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 |