From: Sinan Kaya Date: Fri, 12 Apr 2019 05:57:37 +0000 (+0000) Subject: Conversion issues X-Git-Tag: submit/tizen/20210909.063632~11030^2~1800^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0163624a21472a4344bd516e87589435cb2303dc;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Conversion issues Commit migrated from https://github.com/dotnet/coreclr/commit/034c81b00c101ab1654b9592274ce0a0a9ee312b --- diff --git a/src/coreclr/src/ToolBox/SOS/lldbplugin/services.cpp b/src/coreclr/src/ToolBox/SOS/lldbplugin/services.cpp index f5ec14d..aeca020 100644 --- a/src/coreclr/src/ToolBox/SOS/lldbplugin/services.cpp +++ b/src/coreclr/src/ToolBox/SOS/lldbplugin/services.cpp @@ -10,8 +10,8 @@ #define CONVERT_FROM_SIGN_EXTENDED(offset) ((ULONG_PTR)(offset)) -ULONG g_currentThreadIndex = -1; -ULONG g_currentThreadSystemId = -1; +ULONG g_currentThreadIndex = (ULONG)-1; +ULONG g_currentThreadSystemId = (ULONG)-1; char *g_coreclrDirectory; LLDBServices::LLDBServices(lldb::SBDebugger &debugger, lldb::SBCommandReturnObject &returnObject, lldb::SBProcess *process, lldb::SBThread *thread) : @@ -587,7 +587,7 @@ LLDBServices::Disassemble( size = instruction.GetByteSize(); data = instruction.GetData(target); - for (int i = 0; i < size && bufferSize > 0; i++) + for (ULONG i = 0; i < size && bufferSize > 0; i++) { byte = data.GetUnsignedInt8(error, i); if (error.Fail()) @@ -689,7 +689,7 @@ LLDBServices::GetContextStackTrace( } frame = thread.GetFrameAtIndex(0); - for (int i = 0; i < thread.GetNumFrames(); i++) + for (uint32_t i = 0; i < thread.GetNumFrames(); i++) { if (!frame.IsValid() || (cFrames > framesSize) || ((char *)currentContext > ((char *)frameContexts + frameContextsSize))) { @@ -1367,7 +1367,7 @@ LLDBServices::GetCurrentThreadId( // This is allow the a valid current TID to be returned to // workaround a bug in lldb on core dumps. - if (g_currentThreadIndex != -1) + if (g_currentThreadIndex != (ULONG)-1) { *id = g_currentThreadIndex; return S_OK; @@ -1413,7 +1413,7 @@ LLDBServices::GetCurrentThreadSystemId( // This is allow the a valid current TID to be returned to // workaround a bug in lldb on core dumps. - if (g_currentThreadSystemId != -1) + if (g_currentThreadSystemId != (ULONG)-1) { *sysId = g_currentThreadSystemId; return S_OK; @@ -1447,7 +1447,7 @@ LLDBServices::GetThreadIdBySystemId( // If we have a "fake" thread OS (system) id and a fake thread index, // we need to return fake thread index. - if (g_currentThreadSystemId == sysId && g_currentThreadIndex != -1) + if (g_currentThreadSystemId == sysId && g_currentThreadIndex != (ULONG)-1) { id = g_currentThreadIndex; } @@ -1495,7 +1495,7 @@ LLDBServices::GetThreadContextById( // If we have a "fake" thread OS (system) id and a fake thread index, // use the fake thread index to get the context. - if (g_currentThreadSystemId == threadID && g_currentThreadIndex != -1) + if (g_currentThreadSystemId == threadID && g_currentThreadIndex != (ULONG)-1) { thread = process.GetThreadByIndexID(g_currentThreadIndex); } diff --git a/src/coreclr/src/ToolBox/SOS/lldbplugin/setsostidcommand.cpp b/src/coreclr/src/ToolBox/SOS/lldbplugin/setsostidcommand.cpp index c7d6a1b..67911e4 100644 --- a/src/coreclr/src/ToolBox/SOS/lldbplugin/setsostidcommand.cpp +++ b/src/coreclr/src/ToolBox/SOS/lldbplugin/setsostidcommand.cpp @@ -23,7 +23,7 @@ public: { if (arguments[0] == NULL) { - if (g_currentThreadSystemId == -1 || g_currentThreadIndex == -1) + if (g_currentThreadSystemId == (ULONG)-1 || g_currentThreadIndex == (ULONG)-1) { result.Printf("sos OS tid not mapped\n"); } @@ -33,8 +33,8 @@ public: } } else if (strcmp(arguments[0], "-clear") == 0) { - g_currentThreadIndex = -1; - g_currentThreadSystemId = -1; + g_currentThreadIndex = (ULONG)-1; + g_currentThreadSystemId = (ULONG)-1; result.Printf("Cleared sos OS tid/index\n"); } else if (arguments[1] == NULL)