Groups | Blog | Home
all groups > dotnet clr > september 2004 >

dotnet clr : SetEnterLeaveFunctionHooks and JITCompilationStarted


Qj Zhang
9/14/2004 12:24:12 PM
I use SetEnterLeaveFunctionHooks profiling API to catch all method
calls. For each method call, I can find class name, method name,
parameter type and return type. I am wondering if it is possible to
catch parameter values and return value.

Use JITCompilationStarted, it is possible to catch parameter values and
return value by modifying IL code on the fly. However, it can only catch
top level methods in the class; any framework methods call info plus
their parameter values and return values will not be available.

Any help will be appreciated.


*** Sent via Developersdex http://www.developersdex.com ***
jkeljo NO[at]SPAM online.microsoft.com (
9/16/2004 6:28:48 PM
You can do the same IL-instrumentation trick on the framework methods that
you do for other methods, only you'll have to force the CLR to JIT them
instead of using the NGENed versions (do this by setting
*pbUseCachedFunction to FALSE from JITCachedFunctionSearchStarted).

With .NET 2.0 Beta 1, you can get the params and retval directly from a new
version of the Enter/Leave hooks.

Jonathan

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: Qj Zhang <qjpaaz@yahoo.com>
| X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
| Subject: SetEnterLeaveFunctionHooks and JITCompilationStarted
| Mime-Version: 1.0
| Content-Type: text/plain; charset="us-ascii"
| Content-Transfer-Encoding: 7bit
| Message-ID: <#9LKrBpmEHA.2680@TK2MSFTNGP15.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.clr
| Date: Tue, 14 Sep 2004 12:24:12 -0700
| NNTP-Posting-Host: 67.41.129.85
| Lines: 1
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15
.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.clr:11813
| X-Tomcat-NG: microsoft.public.dotnet.framework.clr
|
| I use SetEnterLeaveFunctionHooks profiling API to catch all method
| calls. For each method call, I can find class name, method name,
| parameter type and return type. I am wondering if it is possible to
| catch parameter values and return value.
|
| Use JITCompilationStarted, it is possible to catch parameter values and
| return value by modifying IL code on the fly. However, it can only catch
| top level methods in the class; any framework methods call info plus
| their parameter values and return values will not be available.
|
| Any help will be appreciated.
|
|
| *** Sent via Developersdex http://www.developersdex.com ***
| Don't just participate in USENET...get rewarded for it!
|
AddThis Social Bookmark Button