|
From: Robert W. <rj...@du...> - 2004-04-13 20:43:46
|
> Sounds plausible. Is it documented? Phngh. > I'm not sure if the comments in > vg_intercept.vgi now match with the reality. A precis of your description > could be what's needed... Okey dokey. I'll put a better description extracted from my message into vg_intercept.c.base. > Also, I see in the generated vg_intercept.c lines like this: > > int VG_INTERCEPT(soname$3Alibc$2Eso$2E6$3A__raise)(int) > > How does that work? What's with the dollar signs? VG_INTERCEPT is a C macro that just sticks a magic preamble onto the symbol so that we can pick it up automatically when we're scanning the symbol table. The dollar symbols are legal in symbols in gcc, believe it or not. We use them to delimit bits of the symbol. The two numbers following it are hex digits of a character that isn't legal in a symbol, so $3A == ':' and $2E == '.'. So this function is: soname:libc.so.6:__raise This is plucked apart by the scanning code to set up the intercept table. This basically says "the function called _vgi__soname$3Alibc$2Eso$2E6$3A__raise is an intercept for __raise in the shared object called libc.so.6." Ugly, but it works. :-) If you can think of a cleaner mechanism, I'd like to hear about it. Regards, Robert. |