diff options
author | Mike McLaughlin <mikem@microsoft.com> | 2015-03-16 15:02:02 -0700 |
---|---|---|
committer | Mike McLaughlin <mikem@microsoft.com> | 2015-03-19 14:51:26 -0700 |
commit | 92cacf39a19d1807ded839cbd65cb496dcfe2412 (patch) | |
tree | cb17e1077d8566faf0a5c53f84d79a05243c77e4 /src/ToolBox | |
parent | 65843fdba94820ce3566396ececdeb8ffd00f09c (diff) | |
download | coreclr-92cacf39a19d1807ded839cbd65cb496dcfe2412.tar.gz coreclr-92cacf39a19d1807ded839cbd65cb496dcfe2412.tar.bz2 coreclr-92cacf39a19d1807ded839cbd65cb496dcfe2412.zip |
Enable the rest of the Dump commands and supporting functions.
Undo some mistakes made in my previous commits.
Don't create the sync manager, seh threads and seh itself.
Addressed @jkotas, @sergiy-k and @janvorli review feedback. Added a set of PAL_Initialize flags that control what gets initialized and a new PAL_InitializeDLL entry point that the SOS and DAC module use. This new entry point only does the subset of PAL init that is needed for a module outside of the coreclr runtime.
Fixed GetCurrentFrame() to get the current selected stack frame.
Used @janvorli suggestion of installing a PAL hardware exception and having it throw a C++ exception so the DAC can cause invalid pointers.
Diffstat (limited to 'src/ToolBox')
-rw-r--r-- | src/ToolBox/SOS/Strike/datatarget.cpp | 2 | ||||
-rw-r--r-- | src/ToolBox/SOS/Strike/exts.cpp | 3 | ||||
-rw-r--r-- | src/ToolBox/SOS/Strike/exts.h | 2 | ||||
-rw-r--r-- | src/ToolBox/SOS/Strike/strike.cpp | 41 | ||||
-rw-r--r-- | src/ToolBox/SOS/Strike/util.cpp | 40 | ||||
-rw-r--r-- | src/ToolBox/SOS/Strike/util.h | 4 | ||||
-rw-r--r-- | src/ToolBox/SOS/lldbplugin/debugclient.cpp | 145 | ||||
-rw-r--r-- | src/ToolBox/SOS/lldbplugin/debugclient.h | 27 | ||||
-rw-r--r-- | src/ToolBox/SOS/lldbplugin/inc/dbgeng.h | 69 | ||||
-rw-r--r-- | src/ToolBox/SOS/lldbplugin/mstypes.h | 11 |
10 files changed, 271 insertions, 73 deletions
diff --git a/src/ToolBox/SOS/Strike/datatarget.cpp b/src/ToolBox/SOS/Strike/datatarget.cpp index c4f5a72308..b3cd098797 100644 --- a/src/ToolBox/SOS/Strike/datatarget.cpp +++ b/src/ToolBox/SOS/Strike/datatarget.cpp @@ -162,7 +162,7 @@ DataTarget::GetThreadContext( { return E_UNEXPECTED; } - return g_ExtClient->GetThreadContextById(threadID, contextFlags, contextSize, context); + return g_ExtSystem->GetThreadContextById(threadID, contextFlags, contextSize, context); } HRESULT STDMETHODCALLTYPE diff --git a/src/ToolBox/SOS/Strike/exts.cpp b/src/ToolBox/SOS/Strike/exts.cpp index a64662ccc7..cf34981165 100644 --- a/src/ToolBox/SOS/Strike/exts.cpp +++ b/src/ToolBox/SOS/Strike/exts.cpp @@ -367,6 +367,7 @@ PDEBUG_DATA_SPACES g_ExtData; PDEBUG_CONTROL2 g_ExtControl; PDEBUG_SYMBOLS g_ExtSymbols; PDEBUG_SYSTEM_OBJECTS g_ExtSystem; +PDEBUG_REGISTERS g_ExtRegisters; extern "C" HRESULT ExtQuery(PDEBUG_CLIENT Client) @@ -376,6 +377,7 @@ ExtQuery(PDEBUG_CLIENT Client) g_ExtData = (PDEBUG_DATA_SPACES)Client; g_ExtSymbols = (PDEBUG_SYMBOLS)Client; g_ExtSystem = (PDEBUG_SYSTEM_OBJECTS)Client; + g_ExtRegisters = (PDEBUG_REGISTERS)Client; return S_OK; } @@ -387,6 +389,7 @@ ExtRelease(void) g_ExtData = NULL; g_ExtSymbols = NULL; g_ExtSystem = NULL; + g_ExtRegisters = NULL; } #endif // FEATURE_PAL
\ No newline at end of file diff --git a/src/ToolBox/SOS/Strike/exts.h b/src/ToolBox/SOS/Strike/exts.h index fbab1fbffd..8adee69773 100644 --- a/src/ToolBox/SOS/Strike/exts.h +++ b/src/ToolBox/SOS/Strike/exts.h @@ -137,12 +137,12 @@ extern PDEBUG_CONTROL2 g_ExtControl; extern PDEBUG_DATA_SPACES g_ExtData; extern PDEBUG_SYMBOLS g_ExtSymbols; extern PDEBUG_SYSTEM_OBJECTS g_ExtSystem; +extern PDEBUG_REGISTERS g_ExtRegisters; #ifndef FEATURE_PAL // Global variables initialized by query. extern PDEBUG_DATA_SPACES2 g_ExtData2; -extern PDEBUG_REGISTERS g_ExtRegisters; extern PDEBUG_SYMBOLS2 g_ExtSymbols2; extern PDEBUG_ADVANCED3 g_ExtAdvanced3; diff --git a/src/ToolBox/SOS/Strike/strike.cpp b/src/ToolBox/SOS/Strike/strike.cpp index 325485eef1..dbc54d0fe5 100644 --- a/src/ToolBox/SOS/Strike/strike.cpp +++ b/src/ToolBox/SOS/Strike/strike.cpp @@ -112,9 +112,7 @@ #define DEFINE_EXT_GLOBALS #include "data.h" -#ifndef FEATURE_PAL #include "disasm.h" -#endif // !FEATURE_PAL #include "predeftlsslot.h" @@ -200,10 +198,11 @@ HMODULE g_hInstance = NULL; #endif #ifdef FEATURE_PAL + #define NOTHROW -#else -#define NOTHROW (std::nothrow) -#endif +#define MINIDUMP_NOT_SUPPORTED() + +#else // !FEATURE_PAL #define MINIDUMP_NOT_SUPPORTED() \ if (IsMiniDumpFile()) \ @@ -213,7 +212,8 @@ HMODULE g_hInstance = NULL; return Status; \ } -#ifndef FEATURE_PAL +#define NOTHROW (std::nothrow) + #include "safemath.h" DECLARE_API (MinidumpMode) @@ -560,6 +560,8 @@ DECLARE_API (EEStack) return Status; } +#endif // FEATURE_PAL + HRESULT DumpStackObjectsRaw(size_t nArg, __in_z LPSTR exprBottom, __in_z LPSTR exprTop, BOOL bVerify) { size_t StackTop = 0; @@ -709,6 +711,8 @@ DECLARE_API(DumpMD) return Status; } +#ifndef FEATURE_PAL + BOOL GatherDynamicInfo(TADDR DynamicMethodObj, DacpObjectData *codeArray, DacpObjectData *tokenArray, TADDR *ptokenArrayAddr) { @@ -786,6 +790,7 @@ BOOL GatherDynamicInfo(TADDR DynamicMethodObj, DacpObjectData *codeArray, return bRet; } + DECLARE_API(DumpIL) { INIT_API(); @@ -1104,6 +1109,8 @@ DECLARE_API(DumpSigElem) return Status; } +#endif // FEATURE_PAL + /**********************************************************************\ * Routine Description: * @@ -2000,8 +2007,6 @@ DECLARE_API(DumpObj) return Status; } -#endif // FEATURE_PAL - CLRDATA_ADDRESS isExceptionObj(CLRDATA_ADDRESS mtObj) { // We want to follow back until we get the mt for System.Exception @@ -5152,6 +5157,8 @@ DECLARE_API(FinalizeQueue) return Status; } +#endif // FEATURE_PAL + enum { // These are the values set in m_dwTransientFlags. // Note that none of these flags survive a prejit save/restore. @@ -5437,6 +5444,7 @@ DECLARE_API(DumpAssembly) return Status; } + String GetHostingCapabilities(DWORD hostConfig) { String result; @@ -6589,7 +6597,6 @@ private: }; Breakpoints g_bpoints; -#endif // Controls whether optimizations are disabled on module load and whether NGEN can be used BOOL g_fAllowJitOptimization = TRUE; @@ -7404,6 +7411,8 @@ DECLARE_API(ThreadPool) return Status; } +#endif // FEATURE_PAL + DECLARE_API(FindAppDomain) { INIT_API(); @@ -7487,6 +7496,8 @@ DECLARE_API(FindAppDomain) return Status; } +#ifndef FEATURE_PAL + /**********************************************************************\ * Routine Description: * * * @@ -12232,8 +12243,6 @@ DECLARE_API(SaveModule) { INIT_API(); MINIDUMP_NOT_SUPPORTED(); - -#ifndef FEATURE_PAL StringHolder Location; DWORD_PTR moduleAddr = NULL; @@ -12420,13 +12429,6 @@ DECLARE_API(SaveModule) end: CloseHandle (hFile); return Status; - -#else - - _ASSERTE(false); - return E_FAIL; - -#endif // FEATURE_PAL } #ifdef _DEBUG @@ -12935,7 +12937,6 @@ Exit: return Status; } -#ifndef FEATURE_PAL // TODO: Convert PAL_TRY_NAKED to something that works on the Mac. HRESULT CALLBACK ImplementEFNStackTraceTry( PDEBUG_CLIENT Client, @@ -12980,7 +12981,7 @@ HRESULT CALLBACK _EFN_StackTrace( return Status; } -#endif // !FEATURE_PAL + BOOL FormatFromRemoteString(DWORD_PTR strObjPointer, __out_ecount(cchString) PWSTR wszBuffer, ULONG cchString) { diff --git a/src/ToolBox/SOS/Strike/util.cpp b/src/ToolBox/SOS/Strike/util.cpp index af193255bf..3579518947 100644 --- a/src/ToolBox/SOS/Strike/util.cpp +++ b/src/ToolBox/SOS/Strike/util.cpp @@ -9,9 +9,7 @@ // // ==--== #include "sos.h" -#ifndef FEATURE_PAL #include "disasm.h" -#endif // FEATURE_PAL #include <dbghelp.h> #include "corhdr.h" @@ -1942,8 +1940,6 @@ CLRDATA_ADDRESS GetAppDomainForMT(CLRDATA_ADDRESS mtPtr) assembly.ParentDomain; } -#ifndef FEATURE_PAL - CLRDATA_ADDRESS GetAppDomain(CLRDATA_ADDRESS objPtr) { CLRDATA_ADDRESS appDomain = NULL; @@ -2055,8 +2051,6 @@ CLRDATA_ADDRESS GetAppDomain(CLRDATA_ADDRESS objPtr) return appDomain; } -#endif // !FEATURE_PAL - HRESULT FileNameForModule (DWORD_PTR pModuleAddr, __out_ecount (MAX_PATH) WCHAR *fileName) { DacpModuleData ModuleData; @@ -2258,12 +2252,15 @@ void DomainInfo (DacpAppDomainData *pDomain) ExtOut("\n"); } - #ifdef FEATURE_PAL + DWORD_PTR GetExpression(const char *exp) { - return exp ? strtoul(exp, NULL, 16) : 0; + DWORD_PTR result = 0; + g_ExtClient->GetExpression(exp, &result); + return result; } + #endif // FEATURE_PAL /**********************************************************************\ @@ -2456,8 +2453,6 @@ BOOL IsStringObject (size_t obj) return FALSE; } -#ifndef FEATURE_PAL - void DumpStackObjectsOutput(const char *location, DWORD_PTR objAddr, BOOL verifyFields) { #ifndef FEATURE_PAL @@ -2522,10 +2517,13 @@ void DumpStackObjectsInternal(size_t StackTop, size_t StackBottom, BOOL verifyFi void DumpRegObjectHelper(const char *regName, BOOL verifyFields) { - ULONG IREG; - DEBUG_VALUE value; DWORD_PTR reg; - +#ifdef FEATURE_PAL + if (FAILED(g_ExtRegisters->GetValueByName(regName, ®))) + return; +#else + DEBUG_VALUE value; + ULONG IREG; if (FAILED(g_ExtRegisters->GetIndexByName(regName, &IREG)) || FAILED(g_ExtRegisters->GetValue(IREG, &value))) return; @@ -2537,6 +2535,7 @@ void DumpRegObjectHelper(const char *regName, BOOL verifyFields) #else #error Unsupported target #endif +#endif // FEATURE_PAL DumpStackObjectsOutput(regName, reg, verifyFields); } @@ -2828,8 +2827,6 @@ Failure: return NULL; } -#endif // !FEATURE_PAL - /**********************************************************************\ * Routine Description: * * * @@ -3509,10 +3506,10 @@ CLRDATA_ADDRESS GetCurrentManagedThread () return NULL; } -#ifndef FEATURE_PAL void ReloadSymbolWithLineInfo() { +#ifndef FEATURE_PAL static BOOL bLoadSymbol = FALSE; if (!bLoadSymbol) { @@ -3533,9 +3530,12 @@ void ReloadSymbolWithLineInfo() // reload mscoree.pdb and clrjit.pdb to get line info bLoadSymbol = TRUE; } +#endif } +#ifndef FEATURE_PAL + // Return 1 if the function is our stub // Return MethodDesc if the function is managed // Otherwise return 0 @@ -3733,7 +3733,7 @@ void StringObjectContent(size_t obj, BOOL fLiteral, const int length) } DWORD_PTR dwAddr = (DWORD_PTR)pwszBuf.GetPtr(); - if (g_sos->GetObjectStringData(TO_CDADDR(obj), stInfo.m_StringLength, pwszBuf, NULL)!=S_OK) + if (g_sos->GetObjectStringData(TO_CDADDR(obj), stInfo.m_StringLength+1, pwszBuf, NULL)!=S_OK) { ExtOut("Error getting string data\n"); return; @@ -4149,7 +4149,7 @@ HRESULT LoadClrDebugDll(void) #ifdef FEATURE_PAL if (g_pCLRDataCreateInstance == NULL) { - int err = PAL_Initialize(0, NULL); + int err = PAL_InitializeDLL(); if(err != 0) { return E_FAIL; @@ -4780,8 +4780,6 @@ UnloadClrDebugDll(void) #endif } -#ifndef FEATURE_PAL - typedef enum { GC_HEAP_INVALID = 0, @@ -4796,8 +4794,6 @@ typedef enum * * \**********************************************************************/ -#endif // !FEATURE_PAL - DacpGcHeapData *g_pHeapData = NULL; DacpGcHeapData g_HeapData; diff --git a/src/ToolBox/SOS/Strike/util.h b/src/ToolBox/SOS/Strike/util.h index 0af03d62c3..812a0d6e1e 100644 --- a/src/ToolBox/SOS/Strike/util.h +++ b/src/ToolBox/SOS/Strike/util.h @@ -2075,15 +2075,11 @@ struct StringHolder ULONG DebuggeeType(); -#ifndef FEATURE_PAL - inline BOOL IsKernelDebugger () { return DebuggeeType() == DEBUG_CLASS_KERNEL; } -#endif // !FEATURE_PAL - void ResetGlobals(void); HRESULT LoadClrDebugDll(void); extern "C" void UnloadClrDebugDll(void); diff --git a/src/ToolBox/SOS/lldbplugin/debugclient.cpp b/src/ToolBox/SOS/lldbplugin/debugclient.cpp index 7366bf23e9..a925901b3e 100644 --- a/src/ToolBox/SOS/lldbplugin/debugclient.cpp +++ b/src/ToolBox/SOS/lldbplugin/debugclient.cpp @@ -62,6 +62,18 @@ DebugClient::GetCurrentThread() return thread; } +lldb::SBFrame +DebugClient::GetCurrentFrame() +{ + lldb::SBFrame frame; + lldb::SBThread thread = GetCurrentThread(); + if (thread.IsValid()) + { + frame = thread.GetSelectedFrame(); + } + return frame; +} + //---------------------------------------------------------------------------- // IDebugControl2 //---------------------------------------------------------------------------- @@ -524,6 +536,93 @@ DebugClient::GetCurrentThreadSystemId( return S_OK; } +HRESULT +DebugClient::GetThreadIdBySystemId( + ULONG sysId, + PULONG id) +{ + *id = 0; + + lldb::SBProcess process = GetCurrentProcess(); + if (!process.IsValid()) + { + return E_FAIL; + } + lldb::SBThread thread = process.GetThreadByID(sysId); + if (!thread.IsValid()) + { + return E_FAIL; + } + + *id = thread.GetIndexID(); + return S_OK; +} + +//---------------------------------------------------------------------------- +// IDebugRegisters +//---------------------------------------------------------------------------- + +HRESULT +DebugClient::GetValueByName( + PCSTR name, + PDWORD_PTR debugValue) +{ + *debugValue = 0; + lldb::SBFrame frame = GetCurrentFrame(); + if (!frame.IsValid()) + { + return E_FAIL; + } + lldb::SBValue value = frame.FindRegister(name); + if (!value.IsValid()) + { + return E_FAIL; + } + *debugValue = value.GetValueAsUnsigned(); + return S_OK; +} + +HRESULT +DebugClient::GetInstructionOffset( + PULONG64 offset) +{ + *offset = 0; + lldb::SBFrame frame = GetCurrentFrame(); + if (!frame.IsValid()) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT +DebugClient::GetStackOffset( + PULONG64 offset) +{ + *offset = 0; + lldb::SBFrame frame = GetCurrentFrame(); + if (!frame.IsValid()) + { + return E_FAIL; + } + *offset = frame.GetSP(); + return S_OK; +} + +HRESULT +DebugClient::GetFrameOffset( + PULONG64 offset) +{ + *offset = 0; + lldb::SBFrame frame = GetCurrentFrame(); + if (!frame.IsValid()) + { + return E_FAIL; + } + *offset = frame.GetFP(); + return S_OK; +} + //---------------------------------------------------------------------------- // IDebugClient //---------------------------------------------------------------------------- @@ -561,4 +660,50 @@ DebugClient::GetThreadContextById( dtcontext->Rbp = frame.GetFP(); return S_OK; +} + +HRESULT +DebugClient::GetExpression( + lldb::SBFrame frame, + PCSTR exp, + PDWORD_PTR result) +{ + lldb::SBValue value = frame.EvaluateExpression(exp, lldb::eNoDynamicValues); + if (!value.IsValid()) + { + return E_FAIL; + } + lldb::SBError error; + *result = value.GetValueAsUnsigned(error); + if (error.Fail()) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT +DebugClient::GetExpression( + PCSTR exp, + PDWORD_PTR result) +{ + *result = 0; + if (exp == nullptr) + { + return E_FAIL; + } + lldb::SBFrame frame = GetCurrentFrame(); + if (!frame.IsValid()) + { + return E_FAIL; + } + HRESULT hr = GetExpression(frame, exp, result); + if (hr != S_OK) + { + std::string str; + str.append("0x"); + str.append(exp); + hr = GetExpression(frame, str.c_str(), result); + } + return hr; }
\ No newline at end of file diff --git a/src/ToolBox/SOS/lldbplugin/debugclient.h b/src/ToolBox/SOS/lldbplugin/debugclient.h index 80eb7ffb1d..8c7906416a 100644 --- a/src/ToolBox/SOS/lldbplugin/debugclient.h +++ b/src/ToolBox/SOS/lldbplugin/debugclient.h @@ -12,6 +12,8 @@ private: void OutputString(ULONG mask, PCSTR str); lldb::SBProcess GetCurrentProcess(); lldb::SBThread GetCurrentThread(); + lldb::SBFrame GetCurrentFrame(); + HRESULT GetExpression(lldb::SBFrame frame, PCSTR exp, PDWORD_PTR result); public: DebugClient(lldb::SBDebugger &debugger, lldb::SBCommandReturnObject &returnObject); @@ -114,6 +116,27 @@ public: HRESULT GetCurrentThreadSystemId( PULONG sysId); + HRESULT GetThreadIdBySystemId( + ULONG sysId, + PULONG id); + + //---------------------------------------------------------------------------- + // IDebugRegisters + //---------------------------------------------------------------------------- + + HRESULT GetValueByName( + PCSTR name, + PDWORD_PTR debugValue); + + HRESULT GetInstructionOffset( + PULONG64 offset); + + HRESULT GetStackOffset( + PULONG64 offset); + + HRESULT GetFrameOffset( + PULONG64 offset); + //---------------------------------------------------------------------------- // IDebugClient //---------------------------------------------------------------------------- @@ -123,4 +146,8 @@ public: ULONG32 contextFlags, ULONG32 contextSize, PBYTE context); + + HRESULT GetExpression( + PCSTR exp, + PDWORD_PTR result); }; diff --git a/src/ToolBox/SOS/lldbplugin/inc/dbgeng.h b/src/ToolBox/SOS/lldbplugin/inc/dbgeng.h index bb5d1a084f..735209f006 100644 --- a/src/ToolBox/SOS/lldbplugin/inc/dbgeng.h +++ b/src/ToolBox/SOS/lldbplugin/inc/dbgeng.h @@ -271,49 +271,68 @@ public: // Not currently supported when kernel debugging. virtual HRESULT GetCurrentThreadSystemId( PULONG sysId) = 0; + + // Looks up a debugger thread ID for the given + // system thread ID. + // Currently when kernel debugging this will fail + // if the thread is not executing on a processor. + virtual HRESULT GetThreadIdBySystemId( + ULONG sysId, + PULONG id) = 0; + + // This is a special sos/lldb function used to implement the ICLRDataTarget interface and + // not actually part of dbgeng's IDebugSystemObjects interface. + virtual HRESULT GetThreadContextById( + /* [in] */ ULONG32 threadID, + /* [in] */ ULONG32 contextFlags, + /* [in] */ ULONG32 contextSize, + /* [out, size_is(contextSize)] */ PBYTE context) = 0; }; typedef class IDebugSystemObjects* PDEBUG_SYSTEM_OBJECTS; //---------------------------------------------------------------------------- -// IDebugAdvanced3 +// IDebugRegister //---------------------------------------------------------------------------- -class IDebugAdvanced3 +class IDebugRegister { public: - // IDebugAdvanced. - - // Get/SetThreadContext offer control over - // the full processor context for a thread. - // Higher-level functions, such as the - // IDebugRegisters interface, allow similar - // access in simpler and more generic ways. - // Get/SetThreadContext are useful when - // large amounts of thread context must - // be changed and processor-specific code - // is not a problem. - virtual HRESULT GetThreadContext( - PVOID context, - ULONG contextSize) = 0; + // This is the combination of dbgeng's GetIndexByName and GetValue and not + // actually part of the dbgeng's IDebugRegister interface. + virtual HRESULT GetValueByName( + PCSTR name, + PDWORD_PTR value) = 0; + + // Abstracted pieces of processor information. + // The mapping of these values to architectural + // registers is architecture-specific and their + // interpretation and existence may vary. They + // are intended to be directly compatible with + // calls which take this information, such as + // stack walking. + virtual HRESULT GetInstructionOffset( + PULONG64 offset) = 0; + + virtual HRESULT GetStackOffset( + PULONG64 offset) = 0; + + virtual HRESULT GetFrameOffset( + PULONG64 offset) = 0; }; -typedef class IDebugAdvanced3* PDEBUG_ADVANCED3; +typedef class IDebugRegister* PDEBUG_REGISTERS; //---------------------------------------------------------------------------- // IDebugClient //---------------------------------------------------------------------------- -class IDebugClient : IDebugControl2, IDebugDataSpaces, IDebugSymbols, IDebugSystemObjects +class IDebugClient : IDebugControl2, IDebugDataSpaces, IDebugSymbols, IDebugSystemObjects, IDebugRegister { public: - // This is a special sos/lldb function used to implement the ICLRDataTarget interface and - // not actually part of the IDebugClient interface. - virtual HRESULT GetThreadContextById( - /* [in] */ ULONG32 threadID, - /* [in] */ ULONG32 contextFlags, - /* [in] */ ULONG32 contextSize, - /* [out, size_is(contextSize)] */ PBYTE context) = 0; + virtual HRESULT GetExpression( + /* [in] */ PCSTR exp, + /* [out] */ PDWORD_PTR result) = 0; }; typedef class IDebugClient* PDEBUG_CLIENT; diff --git a/src/ToolBox/SOS/lldbplugin/mstypes.h b/src/ToolBox/SOS/lldbplugin/mstypes.h index 9948ae8f8b..338fcb7e82 100644 --- a/src/ToolBox/SOS/lldbplugin/mstypes.h +++ b/src/ToolBox/SOS/lldbplugin/mstypes.h @@ -15,10 +15,13 @@ typedef unsigned int ULONG; typedef ULONG ULONG32; typedef ULONG *PULONG; typedef unsigned char BYTE; +typedef unsigned char UCHAR; typedef BYTE *PBYTE; typedef unsigned short WORD; +typedef unsigned short USHORT; typedef unsigned int DWORD; +typedef long long LONG64; typedef unsigned long long ULONG64; typedef ULONG64 *PULONG64; @@ -26,6 +29,14 @@ typedef long long LONGLONG; typedef unsigned long long ULONGLONG; typedef ULONGLONG DWORD64; +#ifdef DBG_TARGET_64BIT +typedef ULONG64 ULONG_PTR, *PULONG_PTR; +typedef ULONG64 DWORD_PTR, *PDWORD_PTR; +#else +typedef ULONG32 ULONG_PTR, *PULONG_PTR; +typedef ULONG32 DWORD_PTR, *PDWORD_PTR; +#endif + typedef wchar_t WCHAR; typedef WCHAR *PWCHAR; typedef const WCHAR *PCWSTR; |