Fix declaration shadows warnings.
authorMikhail Kurinnoi <m.kurinnoi@samsung.com>
Mon, 8 Jun 2020 11:40:37 +0000 (14:40 +0300)
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>
Mon, 29 Jun 2020 23:26:07 +0000 (08:26 +0900)
src/debug/netcoredbg/breakpoints.cpp
src/debug/netcoredbg/expr.cpp
src/debug/netcoredbg/frames.cpp
src/debug/netcoredbg/manageddebugger.cpp
src/debug/netcoredbg/manageddebugger.h
src/debug/netcoredbg/typeprinter.cpp
src/debug/netcoredbg/valuewalk.cpp

index c9e26a042b0658c263f2885e3f5dc684ebc852c9..dc1562b7a7b5809e01b88009ddf112358f8a94d7 100644 (file)
@@ -56,13 +56,13 @@ static HRESULT IsSameFunctionBreakpoint(
 }
 
 Breakpoints::ManagedBreakpoint::ManagedBreakpoint() :
-    id(0), modAddress(0), methodToken(0), ilOffset(0), linenum(0), breakpoint(nullptr), enabled(true), times(0)
+    id(0), modAddress(0), methodToken(0), ilOffset(0), linenum(0), iCorBreakpoint(nullptr), enabled(true), times(0)
 {}
 
 Breakpoints::ManagedBreakpoint::~ManagedBreakpoint()
 {
-    if (breakpoint)
-        breakpoint->Activate(0);
+    if (iCorBreakpoint)
+        iCorBreakpoint->Activate(0);
 }
 
 void Breakpoints::ManagedBreakpoint::ToBreakpoint(Breakpoint &breakpoint)
@@ -309,7 +309,7 @@ HRESULT Breakpoints::ResolveBreakpointInModule(ICorDebugModule *pModule, Managed
     bp.methodToken = methodToken;
     bp.ilOffset = ilOffset;
     bp.fullname = fullname;
-    bp.breakpoint = pBreakpoint.Detach();
+    bp.iCorBreakpoint = pBreakpoint.Detach();
 
     return S_OK;
 }
@@ -477,7 +477,7 @@ HRESULT Breakpoints::ResolveBreakpoint(ManagedBreakpoint &bp)
     bp.methodToken = methodToken;
     bp.ilOffset = ilOffset;
     bp.fullname = fullname;
-    bp.breakpoint = pBreakpoint.Detach();
+    bp.iCorBreakpoint = pBreakpoint.Detach();
 
     return S_OK;
 }
index ba388de396c7ab2aff78d8e8c195f87863dd906a..51da0fa5942e896d972b6498f63e82cdebd91332 100644 (file)
@@ -600,7 +600,7 @@ HRESULT Evaluator::FollowNested(ICorDebugThread *pThread,
     while (!classParts.empty())
     {
         ToRelease<ICorDebugType> pEnclosingType(std::move(pType));
-        int nextClassPart = 0;
+        nextClassPart = 0;
         if (FAILED(FindType(classParts, nextClassPart, pThread, pModule, &pType)))
             break;
 
index 7e29417c436cdf3e8cfcb2ae10e7975b8350593b..e6980b94ef8ff50709cf7161513f30d1c7123433 100644 (file)
@@ -206,6 +206,7 @@ HRESULT WalkFrames(ICorDebugThread *pThread, WalkFramesCallback cb)
     IfFailRet(pThread3->CreateStackWalk(&pStackWalk));
 
     std::vector< ToRelease<ICorDebugFrame> > iFrameCache;
+    std::vector<NativeFrame> nFrames;
 
     static const ULONG32 ctxFlags = CONTEXT_CONTROL | CONTEXT_INTEGER;
     CONTEXT ctxUnmanagedChain;
@@ -280,7 +281,6 @@ HRESULT WalkFrames(ICorDebugThread *pThread, WalkFramesCallback cb)
         }
 
         // Check if we have native frames to unwind
-        std::vector<NativeFrame> nFrames;
         if (ctxUnmanagedChainValid)
             IfFailRet(UnwindNativeFrames(pThread, GetSP(&ctxUnmanagedChain), pEndVal, nFrames));
         IfFailRet(StitchInternalFrames(pThread, iFrameCache, nFrames, cb));
@@ -312,16 +312,15 @@ HRESULT WalkFrames(ICorDebugThread *pThread, WalkFramesCallback cb)
         // If the first frame is either internal or native then we might be in a call to unmanaged code
         if (level == 0)
         {
-            std::vector<NativeFrame> nFrames;
             IfFailRet(UnwindNativeFrames(pThread, 0, GetFrameAddr(pFrame), nFrames));
             IfFailRet(StitchInternalFrames(pThread, {}, nFrames, cb));
+            nFrames.clear();
         }
         IfFailRet(cb(frameType, pFrame, nullptr, nullptr));
     }
 
     // We may have native frames at the end of the stack
     uint64_t pEndVal = std::numeric_limits<uint64_t>::max();
-    std::vector<NativeFrame> nFrames;
     if (ctxUnmanagedChainValid)
         IfFailRet(UnwindNativeFrames(pThread, GetSP(&ctxUnmanagedChain), pEndVal, nFrames));
     IfFailRet(StitchInternalFrames(pThread, iFrameCache, nFrames, cb));
@@ -432,10 +431,10 @@ HRESULT ManagedDebugger::GetStackTrace(ICorDebugThread *pThread, int startFrame,
                 {
                     ToRelease<ICorDebugInternalFrame> pInternalFrame;
                     IfFailRet(pFrame->QueryInterface(IID_ICorDebugInternalFrame, (LPVOID*) &pInternalFrame));
-                    CorDebugInternalFrameType frameType;
-                    IfFailRet(pInternalFrame->GetFrameType(&frameType));
+                    CorDebugInternalFrameType corFrameType;
+                    IfFailRet(pInternalFrame->GetFrameType(&corFrameType));
                     std::string name = "[";
-                    name += GetInternalTypeName(frameType);
+                    name += GetInternalTypeName(corFrameType);
                     name += "]";
                     stackFrames.emplace_back(threadId, currentFrame, name);
                     stackFrames.back().addr = GetFrameAddr(pFrame);
index 727ea6a38adc84330b2db2c8958c1b1dd2e5ea89..105a410f057d0ebac2ef5c4471e64dec34d29d11 100644 (file)
@@ -479,7 +479,7 @@ public:
                 if (evalThreadId == currentThreadId) {
                     m_debugger.m_evaluator.pop_eval_queue();
 
-                    DWORD evalThreadId = m_debugger.m_evaluator.front_eval_queue();
+                    evalThreadId = m_debugger.m_evaluator.front_eval_queue();
                     ToRelease<ICorDebugThread> pThreadEval;
                     IfFailRet(m_debugger.m_pProcess->GetThread(evalThreadId, &pThreadEval));
                     IfFailRet(pAppDomain->SetAllThreadsDebugState(THREAD_SUSPEND, nullptr));
@@ -526,7 +526,7 @@ public:
                 if (evalThreadId == currentThreadId) {
                     m_debugger.m_evaluator.pop_eval_queue();
 
-                    DWORD evalThreadId = m_debugger.m_evaluator.front_eval_queue();
+                    evalThreadId = m_debugger.m_evaluator.front_eval_queue();
                     ToRelease<ICorDebugThread> pThreadEval;
                     IfFailRet(m_debugger.m_pProcess->GetThread(evalThreadId, &pThreadEval));
                     IfFailRet(pAppDomain->SetAllThreadsDebugState(THREAD_SUSPEND, nullptr));
index fabd091650a88924df947c518fa1e0779d5835a2..f3afddd3826ad33c71f684e884291cf20d6fca99 100644 (file)
@@ -238,7 +238,7 @@ class Breakpoints
         ULONG32 ilOffset;
         std::string fullname;
         int linenum;
-        ToRelease<ICorDebugBreakpoint> breakpoint;
+        ToRelease<ICorDebugBreakpoint> iCorBreakpoint;
         bool enabled;
         ULONG32 times;
         std::string condition;
index 7c910b3b346efcca6fd6db04351a9f40e01bdd86..417b0fef26cd3f24e94a3a0d0e7f5abdd544c2dc 100644 (file)
@@ -647,7 +647,6 @@ PCCOR_SIGNATURE TypePrinter::NameForTypeSig(
         case ELEMENT_TYPE_GENERICINST :
             {
                 //typePtr = NameForTypeSig(typePtr, args, pImport, out, appendix);
-                mdTypeDef tk;
                 CorElementType underlyingType;
                 typePtr += CorSigUncompressElementType(typePtr, &underlyingType);
                 typePtr += CorSigUncompressToken(typePtr, &tk);
index 2151a1c1565b91d4441172c78c88ff6503c44806..6fa5abd3b24bb0d4ca3448ceaf43afd9870c7f8e 100644 (file)
@@ -343,11 +343,11 @@ static HRESULT FindMethod(ICorDebugType *pType, const WCHAR *methodName, ICorDeb
     IfFailRet(pMDUnknown->QueryInterface(IID_IMetaDataImport, (LPVOID*) &pMD));
 
     ULONG numMethods = 0;
-    HCORENUM fEnum = NULL;
+    HCORENUM hEnum = NULL;
     mdMethodDef methodDef = mdMethodDefNil;
 
-    pMD->EnumMethodsWithName(&fEnum, currentTypeDef, methodName, &methodDef, 1, &numMethods);
-    pMD->CloseEnum(fEnum);
+    pMD->EnumMethodsWithName(&hEnum, currentTypeDef, methodName, &methodDef, 1, &numMethods);
+    pMD->CloseEnum(hEnum);
 
     if (numMethods == 1)
         return pModule->GetFunctionFromToken(methodDef, ppFunc);
@@ -670,9 +670,9 @@ HRESULT Evaluator::WalkMembers(
     std::unordered_set<string> backedProperties;
 
     ULONG numFields = 0;
-    HCORENUM fEnum = NULL;
+    HCORENUM hEnum = NULL;
     mdFieldDef fieldDef;
-    while(SUCCEEDED(pMD->EnumFields(&fEnum, currentTypeDef, &fieldDef, 1, &numFields)) && numFields != 0)
+    while(SUCCEEDED(pMD->EnumFields(&hEnum, currentTypeDef, &fieldDef, 1, &numFields)) && numFields != 0)
     {
         ULONG nameLen = 0;
         DWORD fieldAttr = 0;
@@ -701,8 +701,12 @@ HRESULT Evaluator::WalkMembers(
 
             if(fieldAttr & fdLiteral)
             {
-                IfFailRet(GetLiteralValue(
-                    pThread, pType, pModule, pSignatureBlob, sigBlobLength, pRawValue, rawValueLength, &pFieldVal));
+                Status = GetLiteralValue(pThread, pType, pModule, pSignatureBlob, sigBlobLength, pRawValue, rawValueLength, &pFieldVal);
+                if (FAILED(Status))
+                {
+                    pMD->CloseEnum(hEnum);
+                    return Status;
+                }
             }
             else if (fieldAttr & fdStatic)
             {
@@ -734,10 +738,15 @@ HRESULT Evaluator::WalkMembers(
 
             if (isNull && !is_static)
                 continue;
-            IfFailRet(cb(mdMethodDefNil, pModule, pType, pFieldVal, is_static, name));
+            Status = cb(mdMethodDefNil, pModule, pType, pFieldVal, is_static, name);
+            if (FAILED(Status))
+            {
+                pMD->CloseEnum(hEnum);
+                return Status;
+            }
         }
     }
-    pMD->CloseEnum(fEnum);
+    pMD->CloseEnum(hEnum);
 
     mdProperty propertyDef;
     ULONG numProperties = 0;
@@ -796,9 +805,9 @@ HRESULT Evaluator::WalkMembers(
             bool debuggerBrowsableState_Never = false;
 
             ULONG numAttributes = 0;
-            HCORENUM fEnum = NULL;
+            hEnum = NULL;
             mdCustomAttribute attr;
-            while(SUCCEEDED(pMD->EnumCustomAttributes(&fEnum, propertyDef, 0, &attr, 1, &numAttributes)) && numAttributes != 0)
+            while(SUCCEEDED(pMD->EnumCustomAttributes(&hEnum, propertyDef, 0, &attr, 1, &numAttributes)) && numAttributes != 0)
             {
                 mdToken ptkObj = mdTokenNil;
                 mdToken ptkType = mdTokenNil;
@@ -825,7 +834,7 @@ HRESULT Evaluator::WalkMembers(
                     break;
                 }
             }
-            pMD->CloseEnum(fEnum);
+            pMD->CloseEnum(hEnum);
 
             if (debuggerBrowsableState_Never)
               continue;