diff options
author | Andrew Au <andrewau@microsoft.com> | 2017-06-17 00:32:39 +0300 |
---|---|---|
committer | Andrew Au <andrewau@microsoft.com> | 2017-06-17 00:32:39 +0300 |
commit | 8ad71c3554bd74a792c5bfd52d8fea98e2fe1218 (patch) | |
tree | d6bf3d8f74b28787d8143a88fbf64ce90b97d94e | |
parent | 9b5108849025b1d1ea5f780c8bfefbf1783eee36 (diff) |
Debugger Support
[tfs-changeset: 1661991]
4 files changed, 41 insertions, 1 deletions
diff --git a/src/Native/Runtime/DebugFuncEval.cpp b/src/Native/Runtime/DebugFuncEval.cpp index 75ed8e808..5d695909f 100644 --- a/src/Native/Runtime/DebugFuncEval.cpp +++ b/src/Native/Runtime/DebugFuncEval.cpp @@ -6,6 +6,7 @@ #include "CommonTypes.h" #include "DebugFuncEval.h" +GVAL_IMPL_INIT(UInt32, g_FuncEvalMode, 0); GVAL_IMPL_INIT(UInt64, g_FuncEvalTarget, 0); GVAL_IMPL_INIT(UInt32, g_FuncEvalParameterBufferSize, 0); @@ -21,6 +22,11 @@ UInt32 DebugFuncEval::GetFuncEvalParameterBufferSize() return g_FuncEvalParameterBufferSize; } +UInt32 DebugFuncEval::GetFuncEvalMode() +{ + return g_FuncEvalMode; +} + /// <summary> /// Retrieve the global FuncEval target address. /// </summary> @@ -43,7 +49,7 @@ EXTERN_C REDHAWK_API void* __cdecl RhpGetFuncEvalTargetAddress() /// During debugging, if a FuncEval is requested, /// the func eval infrastructure needs to know how much buffer to allocate for the debugger to /// write the parameter information in. The C# supporting code will call this API to obtain the -/// buffer size. By that time, the value should have been set through the UpdateFuncEvalParameterSize() +/// buffer size. By that time, the value should have been set through the UpdateFuncEvalParameterBufferSize() /// method on the ISosRedhawk7 interface. /// </remarks> EXTERN_C REDHAWK_API UInt32 __cdecl RhpGetFuncEvalParameterBufferSize() @@ -51,4 +57,18 @@ EXTERN_C REDHAWK_API UInt32 __cdecl RhpGetFuncEvalParameterBufferSize() return DebugFuncEval::GetFuncEvalParameterBufferSize(); } +/// <summary> +/// Retrieve the global FuncEval mode. +/// </summary> +/// <remarks> +/// During debugging, if a FuncEval is requested, +/// the func eval infrastructure needs to know what mode to execute the FuncEval request +/// The C# supporting code will call this API to obtain the mode. By that time, the value +/// should have been set through the UpdateFuncEvalMode() method on the ISosRedhawk7 interface. +/// </remarks> +EXTERN_C REDHAWK_API UInt32 __cdecl RhpGetFuncEvalMode() +{ + return DebugFuncEval::GetFuncEvalMode(); +} + #endif //!DACCESS_COMPILE diff --git a/src/Native/Runtime/DebugFuncEval.h b/src/Native/Runtime/DebugFuncEval.h index e38d94300..e611ac3c0 100644 --- a/src/Native/Runtime/DebugFuncEval.h +++ b/src/Native/Runtime/DebugFuncEval.h @@ -42,6 +42,17 @@ public: /// method on the ISosRedhawk7 interface. /// </remarks> static UInt32 GetFuncEvalParameterBufferSize(); + + /// <summary> + /// Retrieve the global FuncEval mode. + /// </summary> + /// <remarks> + /// During debugging, if a FuncEval is requested, + /// the func eval infrastructure needs to know what mode to execute the FuncEval request + /// The C# supporting code will call this API to obtain the mode. By that time, the value + /// should have been set through the UpdateFuncEvalMode() method on the ISosRedhawk7 interface. + /// </remarks> + static UInt32 GetFuncEvalMode(); }; #endif //!DACCESS_COMPILE diff --git a/src/System.Private.CoreLib/src/Internal/Runtime/Augments/RuntimeAugments.cs b/src/System.Private.CoreLib/src/Internal/Runtime/Augments/RuntimeAugments.cs index ab23fccb0..fcb769d05 100644 --- a/src/System.Private.CoreLib/src/Internal/Runtime/Augments/RuntimeAugments.cs +++ b/src/System.Private.CoreLib/src/Internal/Runtime/Augments/RuntimeAugments.cs @@ -1080,6 +1080,12 @@ namespace Internal.Runtime.Augments } [CLSCompliant(false)] + public static uint RhpGetFuncEvalMode() + { + return RuntimeImports.RhpGetFuncEvalMode(); + } + + [CLSCompliant(false)] public static unsafe uint RhpRecordDebuggeeInitiatedHandle(IntPtr objectHandle) { return RuntimeImports.RhpRecordDebuggeeInitiatedHandle((void*)objectHandle); diff --git a/src/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs b/src/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs index 683dfa846..faf323104 100644 --- a/src/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs +++ b/src/System.Private.CoreLib/src/System/Runtime/RuntimeImports.cs @@ -44,6 +44,9 @@ namespace System.Runtime internal static extern uint RhpGetFuncEvalParameterBufferSize(); [DllImport(RuntimeLibrary, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] + internal static extern uint RhpGetFuncEvalMode(); + + [DllImport(RuntimeLibrary, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] internal static extern unsafe uint RhpRecordDebuggeeInitiatedHandle(void* objectHandle); [DllImport(RuntimeLibrary, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] |