|
From: Betty W. <bet...@gm...> - 2004-09-24 03:21:24
|
Dear all,
I am trying to add a linked list into Valgrind, more specifically
Cachegrind to collect some data access information that is useful to
me. What I want to do is that I collect some data information while
running Valgrind and I want to keep these information into a linked
list.
From reading the documentation, I know that
Valgrind is compiled into a shared object, valgrind.so. This causes
the .so to be loaded as an extra library to any subsequently executed
dynamically-linked ELF binary.
The dynamic linker calls the initialization function of Valgrind. Then
the dynamic linker calls the main of the loaded program. When main
returns, the synthetic CPU calls the finalization function of
valgrind.so. During the execution of the finalization function,
summary of all errors detected are printed and memory leaks are
checked.
Basically, I want to add a linked list as a globle data structure, so
while the main function is exucted, useful data will be collected into
my linked list. And at the end, I will print all the data stored in
the linked list.
Because there is main fuction in Valgrind, I can't declare my linked
list in the main function and let it to be used by all the other
functions, like this:
int main(){
Linked List a;
......
function_A( a );
}//main
|