|
From: Josef W. <Jos...@gm...> - 2005-04-21 15:52:37
|
On Thursday 21 April 2005 15:24, Nicholas Nethercote wrote: > On Thu, 21 Apr 2005, Rex Walburn wrote: > > 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 > > ... > "variable"? What about compound structures like arrays and struct -- are > they a single variable or do you consider the individual elements as > variables? What about stack vs. static vs. heap-allocated variables? > Etc. One other problem is the amount of statistics data produced if there are many instances of data of same type. It probably makes sense to relate to data types. > I see. AIUI the symbol table handles code addresses, eg. function names, > but not variable names. Variable names are in the debugging information. Static data objects are also in the symbol table. See manual page of "nm" for symbol types. These are usually skipped in Valgrinds symbol reader, unless VG_(needs_data_syms)() is called. The type information of symbols will be found in the debug info. IMHO there should be a hook for tools to be able to collect data symbol information [This was the crappy patch I send some time ago ;-) ]. Calling VG_(describe_addr)() at every memory access is probably way to slow. Josef > Local variables on the stack are going to be tricky to deal with, since > you'll have to identify when you're entering/exiting functions, which is > harder than it first seems. > > > What did you mean by source-level instrumentation ? > > A bit like the source code parsing/data flow analysis that you mentioned > -- add instrumentation to the original source code, which would require > parsing the source code, and some static analysis. Then you would run the > program and get the stats. > > N > > > ------------------------------------------------------- > This SF.Net email is sponsored by: New Crystal Reports XI. > Version 11 adds new functionality designed to reduce time involved in > creating, integrating, and deploying reporting solutions. Free runtime > info, new features, or free trial, at: > http://www.businessobjects.com/devxi/728 > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers |