On Tue, Jun 23, 2009 at 12:57 PM, Venky<[email protected]> wrote: > i am new to valgrind and was planning to use valgrind function wrapping for > testing my system (particularly to hit the error and rare cases in the system > which are hard to occur). here are a couple of questions: > #1. all examples i saw in the documentation are with C functions. There is a > mention of C++ doing wrapping based on wildcard matches in soname and function > name. if i understand this correctly, i cannot specify the wrapper using > class::member syntax -- it should be flattened names, correct? is there any > experience/examples of this?
I think you'll need to use the mangled name. I don't really know the answers to your other questions. The manual has reasonable detail on wrapping but I guess you've read that. Generally, for the complex cases you mentioned (eg. default args) you probably need to understand how they get converted to normal functions at the machine code level. (Eg. mangling is how class::member names get converted to flat names; references must be converted into pointers, etc). Function wrapping is pretty low-level and just designed for C, for Valgrind's own purposes. Using it for C++ will definitely stretch it, possibly to breaking point. > #7. is there any inbuilt/efficient valgrind mechanism to know the call stack > at a given location? if so where can i get more information on that? >From within Valgrind or outside Valgrind? - Inside: VG_(get_StackTrace)() and VG_(pp_StackTrace)() -- see include/pub_tool_stacktrace.h. - Outside: VALGRIND_PRINTF_BACKTRACE (in valgrind.h) prints the stack trace Nick ------------------------------------------------------------------------------ Are you an open source citizen? Join us for the Open Source Bridge conference! Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250. Need another reason to go? 24-hour hacker lounge. Register today! http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org _______________________________________________ Valgrind-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/valgrind-users
