On 09/23/2014 03:31 AM, Myoungkyu Song wrote: > I have a question, which maybe was discussed. I would like to implement a > wrapper function for standard API such as "strcpy". However, I failed to > do. When I tested a user-defined function like "hello(char *, char *)" > below, I successfully wrapped it, accessing to arguments and a return > value.
The problem is here > char* I_WRAP_SONAME_FNNAME_ZU(NONE,strcpy) ( char *dest, const char *src ) By using "(NONE,strcpy)" you are requesting to wrap the function strcpy in the main executable (that's what "NONE") means. But strcpy lives in libc.so. Really you need to use VG_Z_LIBC_SONAME (with a suitable definition for VG_Z_LIBC_SONAME) to make it work. Unfortunately the definition of VG_Z_LIBC_SONAME is system-dependent. You should be able to find all the examples you need in shared/vg_replace_strmem.c Note also, using -v is very helpful for debugging wrapping/intercept problems. If you need complete details, also try --trace-redir=yes. J ------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users