|
From: Rex W. <wa...@gm...> - 2005-04-21 17:52:23
|
Hi I tried using VG_(describe_addr) and it returns a value (null) for every address. I have included VG_(needs_data_syms) in SK_(pre_clo_init). So instead I used VG_(get_fnname_if_entry) and it returns function names wherever it can. With this I can grep for my symbol names which matter to me (these names I can get by doing "nm a.out") . THe limitation with this is that I can only get symbol names that are static or global, and for arrays only that of the beginning address. I have no idea why VG_(describe_addr) gives me "(null)" for every addr. Anyway I am happy with atleast some data which I needed, and I am working on how to get names of symbols which are local ... any ideas? I was thinking, checking for Scope and trying something of that sort ... I was interested in callgrind but I could not find it in valgrind-2.4.0 so I tried downloading the latest source code snapshot using cvs but I was not able to login anonymously. It asks for a password and I have tried blank, "anoncvs" , "anonymous" but i am not able to login. I have followed whatever instruction is given on the valgrind website. Thanks.=20 Vikas >=20 > Message: 6 > From: Josef Weidendorfer <Jos...@gm...> > To: val...@li... > Subject: Re: [Valgrind-developers] Dullard with 2.4.0 > Date: Thu, 21 Apr 2005 17:49:41 +0200 >=20 > 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 -- a= re > > they a single variable or do you consider the individual elements as > > variables? What about stack vs. static vs. heap-allocated variables? > > Etc. >=20 > 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. >=20 > > I see. AIUI the symbol table handles code addresses, eg. function name= s, > > but not variable names. Variable names are in the debugging informatio= n. >=20 > 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, unles= s > VG_(needs_data_syms)() is called. The type information of symbols will be > found in the debug info. >=20 > 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 sl= ow. >=20 > Josef >=20 > > 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 i= s > > 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 mentione= d > > -- 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 > > > > |