|
From: Nicholas N. <nj...@ca...> - 2003-03-18 22:46:53
|
On Wed, 19 Mar 2003, Eyal Lebedinsky wrote: > OK, this is good. However, I still am unclear on a few idioms in vg. > > e.g., when adding to vg_mylibs.c I see some functions are defines as > Int my_connect (... > while others use > Int VG_(write_socket)(... Are you referring to the use of the VG_ prefix? If so, we use it on any non-static (ie. globally visible) symbols. Since Valgrind shares the same namespace as the client program, at least from the point of view of the dynamic linker, Valgrind and skins shouldn't define any global symbols without VG_ or SK_ or similar prefixes, to minimise the chances of name clashes. It's not necessary for static (ie. local) symbols. (Note that VG_(foo) is just short for vgPlain_foo, that SK_(foo) is just short for vgSkin_foo, etc.) > Another confusing point: I see identical functions defined in different > contexts, like VG_(do_syscall2) in general and my_do_syscall2 in > vg_mylibsc.c. Is there a need for vg_mylibc.c to be independent? I don't see VG_(do_syscall2)() anywhere. But vg_mylibc.c:vg_do_syscall2() is very similar to vg_libpthread.c:my_do_syscall2(). Perhaps the latter could be removed. But they are slightly different, which may be important. Not sure. N |