|
From: Emilio C. <er...@gm...> - 2011-08-24 19:12:42
|
Hi I am trying to write a new tool. For my purpose i need to track function entry/exit, I read tracking-fn-entry-exit.txt and see some code of callgrind (it's not easy to isolate the code that i need), but I am not so good and so I have some problem. I write some code that basically insert a call to an helper function at the beginning of each BB (guest_chase_thresh = 0). Then I simulate a stack during the execution of the program based on SP changes: - if VG_(get_fnname_if_entry) is true, I simulate a call - if the stack pointer provided by Valgrind is bigger than the SP on my stack, I simulate one or more return (callgrind, I think, call this operation unwind_call_stack) This does not work correctly (I compare my result with callgrind), something is missing. The code fo the simulated stack is attached to this email. Do you have any suggestion? How can I correcly trace function entry/exit without analyse all jumps? Sorry for my bad english. Emilio. |