How get value of parameters in stacktrace

前端 未结 2 1475
面向向阳花
面向向阳花 2020-12-09 17:37

I can get information about a parameter by StackTrace using something like this:

catch (Exception ex)
{
    var st = new StackTrace(ex);

    System.Reflecti         


        
2条回答
  •  星月不相逢
    2020-12-09 18:15

    There are two ways. The more powerful is the COM API for .NET Debugging. For example, arguments and local variables of function in the call stack are both accessible from ICorDebugILFrame. But this must be run from a separate process that is attached to your process as the debugger.

    For in-process introspection, there's the Profiler API, which also can find information about function arguments. Look at the information about "shadow stacks".

提交回复
热议问题