|
From: Rob H. <ti...@ge...> - 2005-08-18 19:17:16
|
Hola, Ok, so the next stumbling block... All the client request stuff is working wonderfully. I'm really happy with all the neat stuff I can do with the valgrind framework, it's really excellent. I have only one small problem now which is that I can't get at the originals for functions I've replaced. The reason I need this is that I need to audit the format strings only once per series of *printf calls. To explain that a little, most *printf calls actually call another *printf call themselves to do the end work. I need to make sure I only check the format string on the call the client actually made, and not the internal ones that follow. In the preload library which Tavis wrote, we took pointers to the original functions on load. The trouble is that valgrind does redirection based on address and not name. So, when the *printf functions call another *printf function, that is redirected as well. It makes a bit of a mess :) So, I'm trying to think of a way to get at the original versions so I can call those from my wrappers. Any ideas? I could take note of the calling stack frame and then ignore the format string for anything below the initial frame. But, seems a bit ugly :/ I could use a VG_(really_call_the_function_please)(printf). Is there something like this already? Or would it be a good idea for me to try and write one? I'm not sure if this is something anyone else would find useful (hence not sure if it's suitable for inclusion in "mainline"), and I wouldn't want to have to always patch valgrind to use my tool, so I'm looking for suggestions for sane solutions. Many thanks, Rob --=20 |