On Friday 07 March 2008, waseem wrote:
> Hello Friends,
>                          I am working with Embla which is a data dependency
> analysis tool and uses Valgrind for its operation. As in an C/C++ program
> there could be number of methods/procedures/ functions  that could be
> called. I am in search of  any suitable method so that valgrind will inform
> my tool when ever control reaches at a point which i would like to pay
> special attention. For example consider following code snapshot.
> 
>  1:  #include<stdio.h>
>  2:  #include<stdlib.h>
>  3:
>  4:  void pro1(){ /* do something;*/}
>  5:
>  6:  void pro2(){ /* do something else */}
>  7:
>  8:  void pro3(){ /* do some thing*/}
>  9:
> 10:  int main(){
> 11:
> 12:      void (*fn)(void);
> 13:      void (*fn2)(void);
> 14:      void (*fn3)(void);
> 15:
> 16:      fn=pro1;
> 17:      (*fn)();
> 18:
> 19:      fn2=pro2;
> 20:      (*fn2)();
> 21:
> 22:      fn3=pro3;
> 23:      /**
> 24:       * at this point valgrind should tell my tool that it is going to
> call pro3
> 26:       */
> 28:      (*fn3)();
> 29:
> 30:      return 0;
> 31:  }
> 
> In above snapshot at line # 28 we have used a function pointer to call pro3
> method. I want to know a suitable method using some sort of macro or other
> construct that i could insert in the program that my  tool is analyzing, and
> valgrind inform my tool about those points when these points are about to be
> executed.

You can define a client request for your tool, and insert this client
request at the beginning of the pro3 function. Or am I missing something here?

Josef

> 



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Valgrind-developers mailing list
Valgrind-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-developers

Reply via email to