|
From: Rex W. <wa...@gm...> - 2005-04-21 13:01:00
|
Hi My aim is that I want to know which variables have been accessed and written to or modified and how many times in a particular area of the source code(or in the whole source code). The source code could be a collection of 200 files. One way to do that was to parse the source code and do a data flow analysis, but that would mean I would have to write a parser for C, C++, FORTRAN or any other language. The advantage of Valgrind is that it works with symbols and hence it does not matter which programming language the source code was written in. If I can map an address to atleast an entry in the symbol table, and check with "dullard" how many times the address was read from, written to and modified, then my problem is almost solved. What did you mean by source-level instrumentation ? Thanks Rex. On 4/20/05, Nicholas Nethercote <nj...@cs...> wrote: > Valgrind's not really set up for mapping addresses to variables. The > meaning of "variable" is tricky when you're looking at binary code -- a > variable may be kept in memory, or the compiler could have put it into a > register, or a combination of the two. >=20 > Basically, variables are source-level entities. Valgrind's better at > dealing with binary/machine-level entities, such as registers and memory > locations. Would you be better off using source-level instrumentation? >=20 > If you describe what you're doing in more detail, we might be able to > give you more help. >=20 > N > |