summaryrefslogtreecommitdiff
path: root/src/ToolBox/SOS/Strike/EventCallbacks.h
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2016-11-23 19:09:09 +0900
committerJiyoung Yun <jy910.yun@samsung.com>2016-11-23 19:09:09 +0900
commit4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (patch)
tree98110734c91668dfdbb126fcc0e15ddbd93738ca /src/ToolBox/SOS/Strike/EventCallbacks.h
parentfa45f57ed55137c75ac870356a1b8f76c84b229c (diff)
downloadcoreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.tar.gz
coreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.tar.bz2
coreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.zip
Imported Upstream version 1.1.0upstream/1.1.0
Diffstat (limited to 'src/ToolBox/SOS/Strike/EventCallbacks.h')
-rw-r--r--src/ToolBox/SOS/Strike/EventCallbacks.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/ToolBox/SOS/Strike/EventCallbacks.h b/src/ToolBox/SOS/Strike/EventCallbacks.h
new file mode 100644
index 0000000000..acd5e412d1
--- /dev/null
+++ b/src/ToolBox/SOS/Strike/EventCallbacks.h
@@ -0,0 +1,68 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#ifndef __EventCallbacks__
+#define __EventCallbacks__
+
+#include "exts.h"
+
+// A set of callbacks that are registered with windbg whenever SOS is loaded
+// Right now these callbacks only act on the module load event for CLR, but
+// feel free to add other event hooks as needed
+//
+// TODO: we should probably be using these callbacks to hook clrnotify exceptions
+// rather than attaching a user handler on the clrn event. That handler is both
+// visible to the user and could be accidentally erased by them.
+class EventCallbacks : IDebugEventCallbacks
+{
+public:
+ EventCallbacks(IDebugClient* pDebugClient);
+ ~EventCallbacks();
+
+ // IUnknown implementation
+ HRESULT __stdcall QueryInterface(REFIID riid, VOID** ppInterface);
+ ULONG __stdcall AddRef();
+ ULONG __stdcall Release();
+
+ // IDebugEventCallbacks implementation
+ HRESULT __stdcall Breakpoint(PDEBUG_BREAKPOINT bp);
+ HRESULT __stdcall ChangeDebuggeeState(ULONG Flags, ULONG64 Argument);
+ HRESULT __stdcall ChangeEngineState(ULONG Flags, ULONG64 Argument);
+ HRESULT __stdcall ChangeSymbolState(ULONG Flags, ULONG64 Argument);
+ HRESULT __stdcall CreateProcess(ULONG64 ImageFileHandle,
+ ULONG64 Handle,
+ ULONG64 BaseOffset,
+ ULONG ModuleSize,
+ PCSTR ModuleName,
+ PCSTR ImageName,
+ ULONG CheckSum,
+ ULONG TimeDateStamp,
+ ULONG64 InitialThreadHandle,
+ ULONG64 ThreadDataOffset,
+ ULONG64 StartOffset);
+ HRESULT __stdcall CreateThread(ULONG64 Handle,
+ ULONG64 DataOffset,
+ ULONG64 StartOffset);
+ HRESULT __stdcall Exception(PEXCEPTION_RECORD64 Exception, ULONG FirstChance);
+ HRESULT __stdcall ExitProcess(ULONG ExitCode);
+ HRESULT __stdcall ExitThread(ULONG ExitCode);
+ HRESULT __stdcall GetInterestMask(PULONG Mask);
+ HRESULT __stdcall LoadModule(ULONG64 ImageFileHandle,
+ ULONG64 BaseOffset,
+ ULONG ModuleSize,
+ PCSTR ModuleName,
+ PCSTR ImageName,
+ ULONG CheckSum,
+ ULONG TimeDateStamp);
+ HRESULT __stdcall SessionStatus(ULONG Status);
+ HRESULT __stdcall SystemError(ULONG Error, ULONG Level);
+ HRESULT __stdcall UnloadModule(PCSTR ImageBaseName, ULONG64 BaseOffset);
+
+
+private:
+ volatile ULONG m_refCount;
+ IDebugClient* m_pDebugClient;
+};
+
+#endif