Make methods SetJustMyCode/IsJustMyCode non-static
authorIgor Kulaychuk <i.kulaychuk@samsung.com>
Tue, 16 Jan 2018 21:30:08 +0000 (00:30 +0300)
committerIgor Kulaychuk <i.kulaychuk@samsung.com>
Tue, 16 Jan 2018 21:30:08 +0000 (00:30 +0300)
src/debug/netcoredbg/commands.cpp
src/debug/netcoredbg/debugger.h
src/debug/netcoredbg/main.cpp

index b4cf4c142f0c6e6a93bb2fa50242060c5d69846d..5062d70bb719247355e579e9641cee97ef65b735 100644 (file)
@@ -179,7 +179,7 @@ HRESULT Debugger::SetupStep(ICorDebugThread *pThread, Debugger::StepType stepTyp
     ToRelease<ICorDebugStepper2> pStepper2;
     IfFailRet(pStepper->QueryInterface(IID_ICorDebugStepper2, (LPVOID *)&pStepper2));
 
-    IfFailRet(pStepper2->SetJMC(Debugger::IsJustMyCode()));
+    IfFailRet(pStepper2->SetJMC(IsJustMyCode()));
 
     if (stepType == STEP_OUT)
     {
@@ -778,7 +778,7 @@ HRESULT MIProtocol::HandleCommand(std::string command,
         {
             if (args.at(0) == "just-my-code")
             {
-                Debugger::SetJustMyCode(args.at(1) == "1");
+                m_debugger->SetJustMyCode(args.at(1) == "1");
             }
         }
         return S_OK;
index 76999f8403800afd8061b3e4be35895a9f3d9dba..7e1bd847eb6ec5cbde3f1fc81a848dd6f8d8c85a 100644 (file)
@@ -24,7 +24,7 @@ private:
     ICorDebug *m_pDebug;
     ICorDebugProcess *m_pProcess;
 
-    static bool m_justMyCode;
+    bool m_justMyCode;
 
     std::mutex m_startupMutex;
     std::condition_variable m_startupCV;
@@ -91,7 +91,7 @@ private:
 
     void Cleanup();
 
-    static HRESULT SetupStep(ICorDebugThread *pThread, StepType stepType);
+    HRESULT SetupStep(ICorDebugThread *pThread, StepType stepType);
 
     HRESULT GetStackVariables(uint64_t frameId, ICorDebugThread *pThread, ICorDebugFrame *pFrame, int start, int count, std::vector<Variable> &variables);
     HRESULT GetChildren(VariableReference &ref, ICorDebugThread *pThread, ICorDebugFrame *pFrame, int start, int count, std::vector<Variable> &variables);
@@ -124,12 +124,12 @@ private:
     HRESULT RunClassConstructor(ICorDebugThread *pThread, ICorDebugValue *pValue);
 
 public:
-    static bool IsJustMyCode() { return m_justMyCode; }
-    static void SetJustMyCode(bool enable) { m_justMyCode = enable; }
-
     Debugger();
     ~Debugger();
 
+    bool IsJustMyCode() { return m_justMyCode; }
+    void SetJustMyCode(bool enable) { m_justMyCode = enable; }
+
     void TryResolveBreakpointsForModule(ICorDebugModule *pModule);
 
     void SetProtocol(Protocol *protocol) { m_protocol = protocol; }
index 2ee4b2e9f3a77a0a4106512838b8aa5d2bb741da..44b5029e5e5d2fcc11a07624f7d31ef1321c1bb0 100644 (file)
@@ -370,9 +370,9 @@ public:
 
             const bool no_source = Status == S_FALSE;
 
-            if (Debugger::IsJustMyCode() && no_source)
+            if (m_debugger->IsJustMyCode() && no_source)
             {
-                Debugger::SetupStep(pThread, Debugger::STEP_OVER);
+                m_debugger->SetupStep(pThread, Debugger::STEP_OVER);
                 pAppDomain->Continue(0);
             }
             else
@@ -676,12 +676,11 @@ public:
             /* [in] */ ICorDebugMDA *pMDA) { HandleEvent(pController, "MDANotification"); return S_OK; }
 };
 
-bool Debugger::m_justMyCode = true;
-
 Debugger::Debugger() :
         m_managedCallback(new ManagedCallback()),
         m_pDebug(nullptr),
         m_pProcess(nullptr),
+        m_justMyCode(true),
         m_startupReady(false),
         m_startupResult(S_OK),
         m_unregisterToken(nullptr),