|
From: Nicholas N. <nj...@cs...> - 2005-04-21 03:41:15
|
On Wed, 20 Apr 2005, Rex Walburn wrote: > So Dullard gives out addresses which have been read from, written to > or modified . I want to map a particular address to its corresponding > variable or symbol. Can I do that ? Could someone give me a hint as to > how I would do that. I have read vg_symtab2.c and know that a symbol > can be mapped to an address. But I think dullard works with UCode and > UCode is independent of symbols. Am I right in thinking this ? > I have been reading through the valgrind code for 2 days now and I > have read the user manual as well. My main aim is to count how many > times a particular variable is accessed (read from, written to, > modified etc.). So I started with dullard, which seems to tell me > partly what I want. > I am looking for some guidance. 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. 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? If you describe what you're doing in more detail, we might be able to give you more help. N |