.netclrclr-profiling-apiclrprofiler

Parsing the COR_PRF_FUNCTION_ARGUMENT_INFO Structure


I'm wondering how I should go about parsing the COR_PRF_FUNCTION_ARGUMENT_INFO structure that is supplied to the callback method of the SetEnterLeaveFunctionHooks3WithInfo function.

From my understand the structure contains a group of memory addresses which contain the locations of the function parameter values. The info regarding this structure can be found here: https://learn.microsoft.com/en-us/dotnet/framework/unmanaged-api/profiling/cor-prf-function-argument-info-structure

I've also parsed the function's metadata to determine the number of parameters supplied to the function and each parameter's type. I used the GetMethodProps function of the IMetaDataImport interface.

I'm stuck on what to do next and how would I would proceed to get the actual value of each parameter using the COR_PRF_FUNCTION_ARGUMENT_INFO structure? Do I need to determine the size of each parameter to calculate an offset from a memory address for each parameter? Thanks for any help


Solution

  • You should be able to work out the size of each argument and how to interpret it based on the type of the argument: