From 20ef6b1820830407b1a08eb6818a1ca83a4ece79 Mon Sep 17 00:00:00 2001 From: Igor Kulaychuk Date: Wed, 12 Jul 2017 23:10:31 +0300 Subject: [PATCH] Remove PrintLocation function --- src/debug/debugger/main.cpp | 39 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/src/debug/debugger/main.cpp b/src/debug/debugger/main.cpp index 944fc72..be6e72d 100644 --- a/src/debug/debugger/main.cpp +++ b/src/debug/debugger/main.cpp @@ -211,26 +211,6 @@ HRESULT PrintFrameLocation(ICorDebugFrame *pFrame, std::string &output) return S_OK; } -HRESULT PrintLocation(ICorDebugThread *pThread, std::string &output) -{ - HRESULT Status; - ToRelease pFrame; - IfFailRet(pThread->GetActiveFrame(&pFrame)); - - ULONG32 ilOffset; - mdMethodDef methodToken; - std::string fullname; - ULONG linenum; - - IfFailRet(GetFrameLocation(pFrame, ilOffset, methodToken, fullname, linenum)); - - std::stringstream ss; - ss << "line=\"" << linenum << "\",fullname=\"" << fullname << "\""; - output = ss.str(); - - return S_OK; -} - HRESULT DisableAllBreakpointsAndSteppersInAppDomain(ICorDebugAppDomain *pAppDomain) { HRESULT Status; @@ -489,7 +469,9 @@ public: FindCurrentBreakpointId(pThread, id); std::string output; - PrintLocation(pThread, output); + ToRelease pFrame; + if (SUCCEEDED(pThread->GetActiveFrame(&pFrame))) + PrintFrameLocation(pFrame, output); DWORD threadId = 0; pThread->GetID(&threadId); @@ -509,7 +491,9 @@ public: /* [in] */ CorDebugStepReason reason) { std::string output; - PrintLocation(pThread, output); + ToRelease pFrame; + if (SUCCEEDED(pThread->GetActiveFrame(&pFrame))) + PrintFrameLocation(pFrame, output); DWORD threadId = 0; pThread->GetID(&threadId); @@ -532,7 +516,9 @@ public: /* [in] */ BOOL unhandled) { std::string output; - PrintLocation(pThread, output); + ToRelease pFrame; + if (SUCCEEDED(pThread->GetActiveFrame(&pFrame))) + PrintFrameLocation(pFrame, output); DWORD threadId = 0; pThread->GetID(&threadId); @@ -540,15 +526,10 @@ public: if (unhandled) { - ToRelease pFrame; - std::string output; - - if (SUCCEEDED(pThread->GetActiveFrame(&pFrame))) - PrintFrameLocation(pFrame, output); - out_printf("*stopped,reason=\"exception-received\",exception-stage=\"%s\",thread-id=\"%i\",stopped-threads=\"all\",%s\n", unhandled ? "unhandled" : "handled", (int)threadId, output.c_str()); } else { + // TODO: Add exception name and module out_printf("=message,text=\"Exception thrown: '%s' in %s\\n\",send-to=\"output-window\",source=\"target-exception\"\n", "", ""); pAppDomain->Continue(0); -- 2.7.4