summaryrefslogtreecommitdiff
path: root/src/ToolBox/SOS/Strike
diff options
context:
space:
mode:
Diffstat (limited to 'src/ToolBox/SOS/Strike')
-rw-r--r--src/ToolBox/SOS/Strike/CMakeLists.txt11
-rw-r--r--src/ToolBox/SOS/Strike/ExpressionNode.cpp20
-rw-r--r--src/ToolBox/SOS/Strike/ExpressionNode.h14
-rw-r--r--src/ToolBox/SOS/Strike/datatarget.cpp4
-rw-r--r--src/ToolBox/SOS/Strike/sildasm.cpp2
-rw-r--r--src/ToolBox/SOS/Strike/sos_stacktrace.h8
-rw-r--r--src/ToolBox/SOS/Strike/sosdocsunix.txt1
-rw-r--r--src/ToolBox/SOS/Strike/stressLogDump.cpp2
-rw-r--r--src/ToolBox/SOS/Strike/strike.cpp65
-rw-r--r--src/ToolBox/SOS/Strike/util.cpp66
-rw-r--r--src/ToolBox/SOS/Strike/util.h16
-rw-r--r--src/ToolBox/SOS/Strike/vm.cpp10
12 files changed, 142 insertions, 77 deletions
diff --git a/src/ToolBox/SOS/Strike/CMakeLists.txt b/src/ToolBox/SOS/Strike/CMakeLists.txt
index 5d25865780..8ba0ade1d8 100644
--- a/src/ToolBox/SOS/Strike/CMakeLists.txt
+++ b/src/ToolBox/SOS/Strike/CMakeLists.txt
@@ -24,7 +24,9 @@ elseif(CLR_CMAKE_PLATFORM_ARCH_I386)
add_definitions(-DSOS_TARGET_X86=1)
add_definitions(-D_TARGET_X86_=1)
add_definitions(-DDBG_TARGET_32BIT)
- add_definitions(-DSOS_TARGET_ARM=1)
+ if(WIN32)
+ add_definitions(-DSOS_TARGET_ARM=1)
+ endif(WIN32)
elseif(CLR_CMAKE_PLATFORM_ARCH_ARM)
add_definitions(-DSOS_TARGET_ARM=1)
add_definitions(-D_TARGET_WIN32_=1)
@@ -155,8 +157,13 @@ if(CLR_CMAKE_PLATFORM_ARCH_AMD64)
elseif(CLR_CMAKE_PLATFORM_ARCH_I386)
set(SOS_SOURCES_ARCH
disasmX86.cpp
- disasmARM.cpp
)
+ if(WIN32)
+ list(APPEND
+ SOS_SOURCES_ARCH
+ disasmARM.cpp
+ )
+ endif(WIN32)
elseif(CLR_CMAKE_PLATFORM_ARCH_ARM)
set(SOS_SOURCES_ARCH
disasmARM.cpp
diff --git a/src/ToolBox/SOS/Strike/ExpressionNode.cpp b/src/ToolBox/SOS/Strike/ExpressionNode.cpp
index 6516823aaa..920afbaedc 100644
--- a/src/ToolBox/SOS/Strike/ExpressionNode.cpp
+++ b/src/ToolBox/SOS/Strike/ExpressionNode.cpp
@@ -129,7 +129,7 @@ VOID ExpressionNode::DFSVisit(ExpressionNodeVisitorCallback pFunc, VOID* pUserDa
// Creates a new expression with a given debuggee value and frame
-ExpressionNode::ExpressionNode(__in_z WCHAR* pExpression, ICorDebugValue* pValue, ICorDebugILFrame* pFrame)
+ExpressionNode::ExpressionNode(__in_z const WCHAR* pExpression, ICorDebugValue* pValue, ICorDebugILFrame* pFrame)
{
Init(pValue, NULL, pFrame);
_snwprintf_s(pAbsoluteExpression, MAX_EXPRESSION, _TRUNCATE, L"%s", pExpression);
@@ -137,7 +137,7 @@ ExpressionNode::ExpressionNode(__in_z WCHAR* pExpression, ICorDebugValue* pValue
}
// Creates a new expression that has an error and no value
-ExpressionNode::ExpressionNode(__in_z WCHAR* pExpression, __in_z WCHAR* pErrorMessage)
+ExpressionNode::ExpressionNode(__in_z const WCHAR* pExpression, __in_z const WCHAR* pErrorMessage)
{
Init(NULL, NULL, NULL);
_snwprintf_s(pAbsoluteExpression, MAX_EXPRESSION, _TRUNCATE, L"%s", pExpression);
@@ -146,7 +146,7 @@ ExpressionNode::ExpressionNode(__in_z WCHAR* pExpression, __in_z WCHAR* pErrorMe
}
// Creates a new child expression
-ExpressionNode::ExpressionNode(__in_z WCHAR* pParentExpression, ChildKind ck, __in_z WCHAR* pRelativeExpression, ICorDebugValue* pValue, ICorDebugType* pType, ICorDebugILFrame* pFrame, UVCP_CONSTANT pDefaultValue, ULONG cchDefaultValue)
+ExpressionNode::ExpressionNode(__in_z const WCHAR* pParentExpression, ChildKind ck, __in_z const WCHAR* pRelativeExpression, ICorDebugValue* pValue, ICorDebugType* pType, ICorDebugILFrame* pFrame, UVCP_CONSTANT pDefaultValue, ULONG cchDefaultValue)
{
Init(pValue, pType, pFrame);
if(ck == ChildKind_BaseClass)
@@ -1979,7 +1979,7 @@ HRESULT ExpressionNode::GetCanonicalElementTypeForTypeName(__in_z WCHAR* pTypeNa
// Searches the debuggee for any ICorDebugType that matches the given fully qualified name
// This will search across all AppDomains and Assemblies
-HRESULT ExpressionNode::FindTypeByName(__in_z WCHAR* pTypeName, ICorDebugType** ppType)
+HRESULT ExpressionNode::FindTypeByName(__in_z const WCHAR* pTypeName, ICorDebugType** ppType)
{
HRESULT Status = S_OK;
ToRelease<ICorDebugAppDomainEnum> pAppDomainEnum;
@@ -2001,7 +2001,7 @@ HRESULT ExpressionNode::FindTypeByName(__in_z WCHAR* pTypeName, ICorDebugType**
// Searches the debuggee for any ICorDebugType that matches the given fully qualified name
// This will search across all Assemblies in the given AppDomain
-HRESULT ExpressionNode::FindTypeByName(ICorDebugAppDomain* pAppDomain, __in_z WCHAR* pTypeName, ICorDebugType** ppType)
+HRESULT ExpressionNode::FindTypeByName(ICorDebugAppDomain* pAppDomain, __in_z const WCHAR* pTypeName, ICorDebugType** ppType)
{
HRESULT Status = S_OK;
ToRelease<ICorDebugAssemblyEnum> pAssemblyEnum;
@@ -2022,7 +2022,7 @@ HRESULT ExpressionNode::FindTypeByName(ICorDebugAppDomain* pAppDomain, __in_z WC
}
// Searches the assembly for any ICorDebugType that matches the given fully qualified name
-HRESULT ExpressionNode::FindTypeByName(ICorDebugAssembly* pAssembly, __in_z WCHAR* pTypeName, ICorDebugType** ppType)
+HRESULT ExpressionNode::FindTypeByName(ICorDebugAssembly* pAssembly, __in_z const WCHAR* pTypeName, ICorDebugType** ppType)
{
HRESULT Status = S_OK;
ToRelease<ICorDebugModuleEnum> pModuleEnum;
@@ -2043,7 +2043,7 @@ HRESULT ExpressionNode::FindTypeByName(ICorDebugAssembly* pAssembly, __in_z WCHA
}
// Searches a given module for any ICorDebugType that matches the given fully qualified type name
-HRESULT ExpressionNode::FindTypeByName(ICorDebugModule* pModule, __in_z WCHAR* pTypeName, ICorDebugType** ppType)
+HRESULT ExpressionNode::FindTypeByName(ICorDebugModule* pModule, __in_z const WCHAR* pTypeName, ICorDebugType** ppType)
{
HRESULT Status = S_OK;
ToRelease<IUnknown> pMDUnknown;
@@ -2054,7 +2054,7 @@ HRESULT ExpressionNode::FindTypeByName(ICorDebugModule* pModule, __in_z WCHAR* p
// If the name contains a generic argument list, extract the type name from
// before the list
WCHAR rootName[mdNameLen];
- WCHAR* pRootName = NULL;
+ const WCHAR* pRootName = NULL;
int typeNameLen = (int) _wcslen(pTypeName);
int genericParamListStart = (int) _wcscspn(pTypeName, L"<");
if(genericParamListStart != typeNameLen)
@@ -2107,11 +2107,11 @@ HRESULT ExpressionNode::FindTypeByName(ICorDebugModule* pModule, __in_z WCHAR* p
}
typeParams = new ToRelease<ICorDebugType>[countTypeParams];
- WCHAR* pCurName = pTypeName + genericParamListStart+1;
+ const WCHAR* pCurName = pTypeName + genericParamListStart+1;
for(int i = 0; i < countTypeParams; i++)
{
WCHAR typeParamName[mdNameLen];
- WCHAR* pNextComma = _wcschr(pCurName, L',');
+ const WCHAR* pNextComma = _wcschr(pCurName, L',');
int len = (pNextComma != NULL) ? (int)(pNextComma - pCurName) : (int)_wcslen(pCurName)-1;
if(len > mdNameLen)
return E_FAIL;
diff --git a/src/ToolBox/SOS/Strike/ExpressionNode.h b/src/ToolBox/SOS/Strike/ExpressionNode.h
index 507a8a53d3..48cc036729 100644
--- a/src/ToolBox/SOS/Strike/ExpressionNode.h
+++ b/src/ToolBox/SOS/Strike/ExpressionNode.h
@@ -134,13 +134,13 @@ private:
};
// Creates a new expression with a given debuggee value and frame
- ExpressionNode(__in_z WCHAR* pExpression, ICorDebugValue* pValue, ICorDebugILFrame* pFrame);
+ ExpressionNode(__in_z const WCHAR* pExpression, ICorDebugValue* pValue, ICorDebugILFrame* pFrame);
// Creates a new expression that has an error and no value
- ExpressionNode(__in_z WCHAR* pExpression, __in_z WCHAR* pErrorMessage);
+ ExpressionNode(__in_z const WCHAR* pExpression, __in_z const WCHAR* pErrorMessage);
// Creates a new child expression
- ExpressionNode(__in_z WCHAR* pParentExpression, ChildKind ck, __in_z WCHAR* pRelativeExpression, ICorDebugValue* pValue, ICorDebugType* pType, ICorDebugILFrame* pFrame, UVCP_CONSTANT pDefaultValue = NULL, ULONG cchDefaultValue = 0);
+ ExpressionNode(__in_z const WCHAR* pParentExpression, ChildKind ck, __in_z const WCHAR* pRelativeExpression, ICorDebugValue* pValue, ICorDebugType* pType, ICorDebugILFrame* pFrame, UVCP_CONSTANT pDefaultValue = NULL, ULONG cchDefaultValue = 0);
// Common member initialization for the constructors
VOID Init(ICorDebugValue* pValue, ICorDebugType* pTypeCast, ICorDebugILFrame* pFrame);
@@ -288,17 +288,17 @@ private:
// Searches the debuggee for any ICorDebugType that matches the given fully qualified name
// This will search across all AppDomains and Assemblies
- static HRESULT FindTypeByName(__in_z WCHAR* pTypeName, ICorDebugType** ppType);
+ static HRESULT FindTypeByName(__in_z const WCHAR* pTypeName, ICorDebugType** ppType);
// Searches the debuggee for any ICorDebugType that matches the given fully qualified name
// This will search across all Assemblies in the given AppDomain
- static HRESULT FindTypeByName(ICorDebugAppDomain* pAppDomain, __in_z WCHAR* pTypeName, ICorDebugType** ppType);
+ static HRESULT FindTypeByName(ICorDebugAppDomain* pAppDomain, __in_z const WCHAR* pTypeName, ICorDebugType** ppType);
// Searches the assembly for any ICorDebugType that matches the given fully qualified name
- static HRESULT FindTypeByName(ICorDebugAssembly* pAssembly, __in_z WCHAR* pTypeName, ICorDebugType** ppType);
+ static HRESULT FindTypeByName(ICorDebugAssembly* pAssembly, __in_z const WCHAR* pTypeName, ICorDebugType** ppType);
// Searches a given module for any ICorDebugType that matches the given fully qualified type name
- static HRESULT FindTypeByName(ICorDebugModule* pModule, __in_z WCHAR* pTypeName, ICorDebugType** ppType);
+ static HRESULT FindTypeByName(ICorDebugModule* pModule, __in_z const WCHAR* pTypeName, ICorDebugType** ppType);
// Checks whether the given token is or refers to type System.ValueType or System.Enum
static HRESULT IsTokenValueTypeOrEnum(mdToken token, IMetaDataImport* pMetadata, BOOL* pResult);
diff --git a/src/ToolBox/SOS/Strike/datatarget.cpp b/src/ToolBox/SOS/Strike/datatarget.cpp
index 8f24b7d841..fe90f0e825 100644
--- a/src/ToolBox/SOS/Strike/datatarget.cpp
+++ b/src/ToolBox/SOS/Strike/datatarget.cpp
@@ -83,9 +83,9 @@ DataTarget::GetPointerSize(
{
#if defined(SOS_TARGET_AMD64) || defined(SOS_TARGET_ARM64)
*size = 8;
-#elif defined(SOS_TARGET_ARM)
+#elif defined(SOS_TARGET_ARM) || defined(SOS_TARGET_X86)
*size = 4;
-#elif
+#else
#error Unsupported architecture
#endif
diff --git a/src/ToolBox/SOS/Strike/sildasm.cpp b/src/ToolBox/SOS/Strike/sildasm.cpp
index 6bd3bb4801..911ff091e5 100644
--- a/src/ToolBox/SOS/Strike/sildasm.cpp
+++ b/src/ToolBox/SOS/Strike/sildasm.cpp
@@ -789,7 +789,7 @@ PCCOR_SIGNATURE PrettyPrintType(
{
//if (sizes[i] != 0 || lowerBounds[i] != 0)
{
- if (lowerBounds[i] == 0 && i < numSizes)
+ if (i < numSizes && lowerBounds[i] == 0)
appendStrNum(out, sizes[i]);
else
{
diff --git a/src/ToolBox/SOS/Strike/sos_stacktrace.h b/src/ToolBox/SOS/Strike/sos_stacktrace.h
index 4aba4ea52c..0af241ca3b 100644
--- a/src/ToolBox/SOS/Strike/sos_stacktrace.h
+++ b/src/ToolBox/SOS/Strike/sos_stacktrace.h
@@ -119,7 +119,7 @@ HRESULT CALLBACK _EFN_StackTrace(
// cbString - number of characters available in the string buffer.
//
// The output will be truncated of cbString is not long enough for the full stack trace.
-HRESULT _EFN_GetManagedExcepStack(
+HRESULT CALLBACK _EFN_GetManagedExcepStack(
PDEBUG_CLIENT client,
ULONG64 StackObjAddr,
__out_ecount(cbString) PSTR szStackString,
@@ -128,7 +128,7 @@ HRESULT _EFN_GetManagedExcepStack(
// _EFN_GetManagedExcepStackW - same as _EFN_GetManagedExcepStack, but returns
// the stack as a wide string.
-HRESULT _EFN_GetManagedExcepStackW(
+HRESULT CALLBACK _EFN_GetManagedExcepStackW(
PDEBUG_CLIENT client,
ULONG64 StackObjAddr,
__out_ecount(cchString) PWSTR wszStackString,
@@ -141,7 +141,7 @@ HRESULT _EFN_GetManagedExcepStackW(
// szName - a buffer to be filled with the full type name
// cbName - the number of characters available in the buffer
//
-HRESULT _EFN_GetManagedObjectName(
+HRESULT CALLBACK _EFN_GetManagedObjectName(
PDEBUG_CLIENT client,
ULONG64 objAddr,
__out_ecount(cbName) PSTR szName,
@@ -158,7 +158,7 @@ HRESULT _EFN_GetManagedObjectName(
// pOffset - the offset from objAddr to the field. This parameter can be NULL.
//
// At least one of pValue and pOffset must be non-NULL.
-HRESULT _EFN_GetManagedObjectFieldInfo(
+HRESULT CALLBACK _EFN_GetManagedObjectFieldInfo(
PDEBUG_CLIENT client,
ULONG64 objAddr,
__out_ecount (mdNameLen) PSTR szFieldName,
diff --git a/src/ToolBox/SOS/Strike/sosdocsunix.txt b/src/ToolBox/SOS/Strike/sosdocsunix.txt
index 52ec86dc4e..5ab2b311cc 100644
--- a/src/ToolBox/SOS/Strike/sosdocsunix.txt
+++ b/src/ToolBox/SOS/Strike/sosdocsunix.txt
@@ -844,6 +844,7 @@ corruption bug caused by invalid GCEncoding for a particular method.
COMMAND: bpmd.
bpmd [-nofuturemodule] <module name> <method name> [<il offset>]
+bpmd <source file name>:<line number>
bpmd -md <MethodDesc>
bpmd -list
bpmd -clear <pending breakpoint number>
diff --git a/src/ToolBox/SOS/Strike/stressLogDump.cpp b/src/ToolBox/SOS/Strike/stressLogDump.cpp
index f277f92434..9dfbe1ed5e 100644
--- a/src/ToolBox/SOS/Strike/stressLogDump.cpp
+++ b/src/ToolBox/SOS/Strike/stressLogDump.cpp
@@ -34,7 +34,7 @@ static const WCHAR* getTime(const FILETIME* time, __out_ecount (buffLen) WCHAR*
return badTime;
#ifdef FEATURE_PAL
- int length = _snwprintf(buff, buffLen, W("%02d:%02d:%02d"), systemTime.wHour, systemTime.wMinute, systemTime.wSecond);
+ int length = _snwprintf_s(buff, buffLen, _TRUNCATE, W("%02d:%02d:%02d"), systemTime.wHour, systemTime.wMinute, systemTime.wSecond);
if (length <= 0)
return badTime;
#else // FEATURE_PAL
diff --git a/src/ToolBox/SOS/Strike/strike.cpp b/src/ToolBox/SOS/Strike/strike.cpp
index 731e2f505d..3bb3f50200 100644
--- a/src/ToolBox/SOS/Strike/strike.cpp
+++ b/src/ToolBox/SOS/Strike/strike.cpp
@@ -4361,8 +4361,10 @@ DECLARE_API(VerifyObj)
ExtOut("Unable to build snapshot of the garbage collector state\n");
goto Exit;
}
- DacpGcHeapDetails *pheapDetails = g_snapshot.GetHeap(taddrObj);
- bValid = VerifyObject(*pheapDetails, taddrObj, taddrMT, objSize, TRUE);
+ {
+ DacpGcHeapDetails *pheapDetails = g_snapshot.GetHeap(taddrObj);
+ bValid = VerifyObject(*pheapDetails, taddrObj, taddrMT, objSize, TRUE);
+ }
Exit:
if (bValid)
@@ -5888,6 +5890,56 @@ HRESULT PrintSpecialThreads()
}
#endif //FEATURE_PAL
+HRESULT SwitchToExceptionThread()
+{
+ HRESULT Status;
+
+ DacpThreadStoreData ThreadStore;
+ if ((Status = ThreadStore.Request(g_sos)) != S_OK)
+ {
+ Print("Failed to request ThreadStore\n");
+ return Status;
+ }
+
+ DacpThreadData Thread;
+ CLRDATA_ADDRESS CurThread = ThreadStore.firstThread;
+ while (CurThread)
+ {
+ if (IsInterrupt())
+ break;
+
+ if ((Status = Thread.Request(g_sos, CurThread)) != S_OK)
+ {
+ PrintLn("Failed to request Thread at ", Pointer(CurThread));
+ return Status;
+ }
+
+ TADDR taLTOH;
+ if (Thread.lastThrownObjectHandle != NULL)
+ {
+ if (SafeReadMemory(TO_TADDR(Thread.lastThrownObjectHandle), &taLTOH, sizeof(taLTOH), NULL))
+ {
+ if (taLTOH != NULL)
+ {
+ ULONG id;
+ if (g_ExtSystem->GetThreadIdBySystemId(Thread.osThreadId, &id) == S_OK)
+ {
+ if (g_ExtSystem->SetCurrentThreadId(id) == S_OK)
+ {
+ PrintLn("Found managed exception on thread ", ThreadID(Thread.osThreadId));
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ CurThread = Thread.nextThread;
+ }
+
+ return Status;
+}
+
struct ThreadStateTable
{
unsigned int State;
@@ -5961,12 +6013,14 @@ DECLARE_API(Threads)
BOOL bPrintSpecialThreads = FALSE;
BOOL bPrintLiveThreadsOnly = FALSE;
+ BOOL bSwitchToManagedExceptionThread = FALSE;
BOOL dml = FALSE;
CMDOption option[] =
{ // name, vptr, type, hasValue
{"-special", &bPrintSpecialThreads, COBOOL, FALSE},
{"-live", &bPrintLiveThreadsOnly, COBOOL, FALSE},
+ {"-managedexception", &bSwitchToManagedExceptionThread, COBOOL, FALSE},
#ifndef FEATURE_PAL
{"/d", &dml, COBOOL, FALSE},
#endif
@@ -5975,6 +6029,11 @@ DECLARE_API(Threads)
{
return Status;
}
+
+ if (bSwitchToManagedExceptionThread)
+ {
+ return SwitchToExceptionThread();
+ }
// We need to support minidumps for this command.
BOOL bMiniDump = IsMiniDumpFile();
@@ -9119,7 +9178,7 @@ DECLARE_API (ProcInfo)
if (pFntGetProcessTimes && pFntGetProcessTimes (hProcess,&CreationTime,&ExitTime,&KernelTime,&UserTime)) {
ExtOut("---------------------------------------\n");
ExtOut("Process Times\n");
- static char *Month[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep",
+ static const char *Month[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep",
"Oct", "Nov", "Dec"};
SYSTEMTIME SystemTime;
FILETIME LocalFileTime;
diff --git a/src/ToolBox/SOS/Strike/util.cpp b/src/ToolBox/SOS/Strike/util.cpp
index 9eec76e42c..b6336fb143 100644
--- a/src/ToolBox/SOS/Strike/util.cpp
+++ b/src/ToolBox/SOS/Strike/util.cpp
@@ -254,47 +254,49 @@ HRESULT CreateInstanceCustomImpl(
typedef HRESULT (__stdcall IDebugSymbols3::*GetPathFunc)(LPWSTR , ULONG, ULONG*);
- // Handle both the image path and the symbol path
- GetPathFunc rgGetPathFuncs[] =
- { &IDebugSymbols3::GetImagePathWide, &IDebugSymbols3::GetSymbolPathWide };
-
- for (int i = 0; i < _countof(rgGetPathFuncs); ++i)
{
- ULONG pathSize = 0;
+ // Handle both the image path and the symbol path
+ GetPathFunc rgGetPathFuncs[] =
+ { &IDebugSymbols3::GetImagePathWide, &IDebugSymbols3::GetSymbolPathWide };
- // get the path buffer size
- if ((spSym3.GetPtr()->*rgGetPathFuncs[i])(NULL, 0, &pathSize) != S_OK)
+ for (int i = 0; i < _countof(rgGetPathFuncs); ++i)
{
- continue;
- }
+ ULONG pathSize = 0;
- ArrayHolder<WCHAR> imgPath = new WCHAR[pathSize+MAX_LONGPATH+1];
- if (imgPath == NULL)
- {
- continue;
- }
+ // get the path buffer size
+ if ((spSym3.GetPtr()->*rgGetPathFuncs[i])(NULL, 0, &pathSize) != S_OK)
+ {
+ continue;
+ }
- // actually get the path
- if ((spSym3.GetPtr()->*rgGetPathFuncs[i])(imgPath, pathSize, NULL) != S_OK)
- {
- continue;
- }
+ ArrayHolder<WCHAR> imgPath = new WCHAR[pathSize+MAX_LONGPATH+1];
+ if (imgPath == NULL)
+ {
+ continue;
+ }
- LPWSTR ctx;
- LPCWSTR pathElem = wcstok_s(imgPath, W(";"), &ctx);
- while (pathElem != NULL)
- {
- WCHAR fullName[MAX_LONGPATH];
- wcscpy_s(fullName, _countof(fullName), pathElem);
- if (wcscat_s(fullName, W("\\")) == 0 && wcscat_s(fullName, dllName) == 0)
+ // actually get the path
+ if ((spSym3.GetPtr()->*rgGetPathFuncs[i])(imgPath, pathSize, NULL) != S_OK)
+ {
+ continue;
+ }
+
+ LPWSTR ctx;
+ LPCWSTR pathElem = wcstok_s(imgPath, W(";"), &ctx);
+ while (pathElem != NULL)
{
- if (SUCCEEDED(CreateInstanceFromPath(clsid, iid, fullName, ppItf)))
+ WCHAR fullName[MAX_LONGPATH];
+ wcscpy_s(fullName, _countof(fullName), pathElem);
+ if (wcscat_s(fullName, W("\\")) == 0 && wcscat_s(fullName, dllName) == 0)
{
- return S_OK;
+ if (SUCCEEDED(CreateInstanceFromPath(clsid, iid, fullName, ppItf)))
+ {
+ return S_OK;
+ }
}
- }
- pathElem = wcstok_s(NULL, W(";"), &ctx);
+ pathElem = wcstok_s(NULL, W(";"), &ctx);
+ }
}
}
@@ -6132,7 +6134,7 @@ HRESULT SymbolReader::LoadSymbolsForWindowsPDB(___in IMetaDataImport* pMD, ___in
int ReadMemoryForSymbols(ULONG64 address, char *buffer, int cb)
{
ULONG read;
- if (SafeReadMemory(address, (PVOID)buffer, cb, &read))
+ if (SafeReadMemory(TO_TADDR(address), (PVOID)buffer, cb, &read))
{
return read;
}
diff --git a/src/ToolBox/SOS/Strike/util.h b/src/ToolBox/SOS/Strike/util.h
index f444c9fcb2..4612acc299 100644
--- a/src/ToolBox/SOS/Strike/util.h
+++ b/src/ToolBox/SOS/Strike/util.h
@@ -2258,13 +2258,9 @@ void GetMethodName(mdMethodDef methodDef, IMetaDataImport * pImport, CQuickBytes
#ifndef _TARGET_WIN64_
#define itoa_s_ptr _itoa_s
#define itow_s_ptr _itow_s
-#define itoa_ptr _itoa
-#define itow_ptr _itow
#else
#define itoa_s_ptr _i64toa_s
#define itow_s_ptr _i64tow_s
-#define itoa_ptr _i64toa
-#define itow_ptr _i64tow
#endif
#ifdef FEATURE_PAL
@@ -2359,11 +2355,11 @@ static const char *SymbolReaderDllName = "SOS.NETCore";
static const char *SymbolReaderClassName = "SOS.SymbolReader";
typedef int (*ReadMemoryDelegate)(ULONG64, char *, int);
-typedef ULONG64 (*LoadSymbolsForModuleDelegate)(const char*, BOOL, ULONG64, int, ULONG64, int, ReadMemoryDelegate);
-typedef void (*DisposeDelegate)(ULONG64);
-typedef BOOL (*ResolveSequencePointDelegate)(ULONG64, const char*, unsigned int, unsigned int*, unsigned int*);
-typedef BOOL (*GetLocalVariableName)(ULONG64, int, int, BSTR*);
-typedef BOOL (*GetLineByILOffsetDelegate)(ULONG64, mdMethodDef, ULONG64, ULONG *, BSTR*);
+typedef PVOID (*LoadSymbolsForModuleDelegate)(const char*, BOOL, ULONG64, int, ULONG64, int, ReadMemoryDelegate);
+typedef void (*DisposeDelegate)(PVOID);
+typedef BOOL (*ResolveSequencePointDelegate)(PVOID, const char*, unsigned int, unsigned int*, unsigned int*);
+typedef BOOL (*GetLocalVariableName)(PVOID, int, int, BSTR*);
+typedef BOOL (*GetLineByILOffsetDelegate)(PVOID, mdMethodDef, ULONG64, ULONG *, BSTR*);
class SymbolReader
{
@@ -2371,7 +2367,7 @@ private:
#ifndef FEATURE_PAL
ISymUnmanagedReader* m_pSymReader;
#endif
- ULONG64 m_symbolReaderHandle;
+ PVOID m_symbolReaderHandle;
static LoadSymbolsForModuleDelegate loadSymbolsForModuleDelegate;
static DisposeDelegate disposeDelegate;
diff --git a/src/ToolBox/SOS/Strike/vm.cpp b/src/ToolBox/SOS/Strike/vm.cpp
index e7e5701fc6..70e9210dbd 100644
--- a/src/ToolBox/SOS/Strike/vm.cpp
+++ b/src/ToolBox/SOS/Strike/vm.cpp
@@ -82,7 +82,7 @@ typedef struct _VM_STATS
typedef struct PROTECT_MASK
{
DWORD Bit;
- PSTR Name;
+ PCSTR Name;
} PROTECT_MASK, *PPROTECT_MASK;
@@ -324,7 +324,7 @@ PrintVmStatsHeader(
VOID
PrintIndividualStat(
- ___in __in_z IN PSTR Name,
+ ___in __in_z IN PCSTR Name,
IN PINDIVIDUAL_STAT Stat
)
{
@@ -379,7 +379,7 @@ PrintIndividualStat(
VOID
PrintVmStats(
- ___in __in_z IN PSTR Name,
+ ___in __in_z IN PCSTR Name,
IN PVM_STATS Stats
)
{
@@ -443,7 +443,7 @@ VmStateToString(
size_t capacity_Buffer
)
{
- PSTR result;
+ PCSTR result;
CHAR invalidStr[sizeof("12345678")];
switch( State )
@@ -478,7 +478,7 @@ VmTypeToString(
size_t capacity_Buffer
)
{
- PSTR result;
+ PCSTR result;
CHAR invalidStr[sizeof("12345678")];
switch( Type )