none
.NET Profiler API: How to access value of "this" + return value of constructors RRS feed

  • Question

  • Hi

    I'm using the CLR profiler described in

    http://msdn.microsoft.com/en-us/magazine/cc188693.aspx

    This profiler does not log the value of "this" at all (I would expect it to be logged before the explicit parameters) and it doesn't log the return value of constructors either (no value is logged). I need to enhance the profiler to do exactly that, but it seems that "this" and constructor return values aren't treated as "normal" parameter/return value - eg, "this" isn't included in IMethod.GetArgumentCount().

    So my question is: Which other calls/tricks must I use in order to get to the value of "this" in FunctionEnter2/FunctionLeave2 and constructor return values in FunctionLeave2?

    Thanks a lot in advance.

    Cheers

    Finn

    Tuesday, January 31, 2012 2:31 PM

Answers

  • OK I've found a solution - "this" is accessed via IMethod.GetContext() and I can also use that for the "return value" for the constructor.

     

    Cheers

    Tuesday, January 31, 2012 3:05 PM