clr-profiling-api

Understanding “this” argument for structs (specifically Iterators/async)

丶灬走出姿态 提交于 2021-02-19 01:36:09
问题 I'm currently inspecting deep objects in the CLR using the Profiler API. I have a specific problem analyzing "this" argument for Iterators/async methods (generated by the compiler, in the form of <name>d__123::MoveNext ). While researching this I found that there is indeed a special behavior. First, the C# compiler compiles these generated methods as structs (only in Release mode). ECMA-334 (C# Language Specification, 5th edition: https://www.ecma-international.org/publications/files/ECMA-ST

CLR profiler: issue in using DefineAssemblyRef

試著忘記壹切 提交于 2019-12-08 14:38:03
问题 I want to write a CLR profiler to hook our application function with GetILFunctionBody/SetILFunctionBody . I want to use DefineAssemblyRef to import our c# dll (for use in IL code) in this code DefineAssemblyRef always return True ? Does my dll have to be signed? Does it need to be installed in the Global Assembly Cache (GAC)? HRESULT CProfilerCallback::JITCompilationStarted ( UINT functionId, BOOL fIsSafeToBlock ) { ClassID classID; ModuleID moduleID; mdToken token; wchar_t wszClass[512];

What does 'Cor' stand for?

僤鯓⒐⒋嵵緔 提交于 2019-11-30 01:43:48
I've seen in it in the primary CLR dll, mscorlib.dll, and I've seen in it in this CLR Profiling API interface, ICorProfilerCallback2. Just curious: what does the word 'Cor' stand for? "Common Object Runtime" For more, see: http://www.danielmoth.com/Blog/2005/05/mscorlibdll.html cor: Before .NET was chosen as the name, this new platform was a successor to COM so it was codenamed COM 3.0 and then the name chosen was… Common Object Runtime (cor) and that is where mscorlib derives its name from (and that stuck regardless of the fact that .NET was the final name)! EDIT: Here's an interesting

What does 'Cor' stand for?

白昼怎懂夜的黑 提交于 2019-11-28 23:12:05
问题 I've seen in it in the primary CLR dll, mscorlib.dll, and I've seen in it in this CLR Profiling API interface, ICorProfilerCallback2. Just curious: what does the word 'Cor' stand for? 回答1: "Common Object Runtime" For more, see: http://www.danielmoth.com/Blog/2005/05/mscorlibdll.html cor: Before .NET was chosen as the name, this new platform was a successor to COM so it was codenamed COM 3.0 and then the name chosen was… Common Object Runtime (cor) and that is where mscorlib derives its name

Is is possible to use Profiling API right from C#?

半城伤御伤魂 提交于 2019-11-28 19:24:17
I just want to use .NET Profiling API ( ICorProfilerCallback etc) but at the same time don't want to deal with C++. I've been looking around for a while and haven't found any example in C# but C# + C++ where the most interesting part is written using C++. Chris Schmich No, you cannot implement the CLR profiling APIs in managed code (C# or otherwise) since the profiling callbacks are called at very specific times when the managed environment is assumed to be in a certain state. Implementing your callbacks in managed code would violate a lot of assumptions. David Broman, the developer of the CLR

Is is possible to use Profiling API right from C#?

泄露秘密 提交于 2019-11-27 12:17:43
问题 I just want to use .NET Profiling API ( ICorProfilerCallback etc) but at the same time don't want to deal with C++. I've been looking around for a while and haven't found any example in C# but C# + C++ where the most interesting part is written using C++. 回答1: No, you cannot implement the CLR profiling APIs in managed code (C# or otherwise) since the profiling callbacks are called at very specific times when the managed environment is assumed to be in a certain state. Implementing your