Use only output string stream instead of the input-output one
authorAndrey Okoshkin <a.okoshkin@samsung.com>
Wed, 28 Mar 2018 16:53:25 +0000 (19:53 +0300)
committerAndrey Okoshkin <a.okoshkin@samsung.com>
Wed, 28 Mar 2018 16:53:25 +0000 (19:53 +0300)
src/debug/netcoredbg/frames.cpp
src/debug/netcoredbg/miprotocol.cpp
src/debug/netcoredbg/modules.cpp
src/debug/netcoredbg/typeprinter.cpp
src/debug/netcoredbg/valueprint.cpp
src/debug/netcoredbg/valuewalk.cpp
src/debug/netcoredbg/vscodeprotocol.cpp

index 7e756fcb9ac59448a5f355c56387ad4a22fa93d6..04807956515c37afe6f7e8ea8ec2a3d60bb198c2 100644 (file)
@@ -384,7 +384,6 @@ static const char *GetInternalTypeName(CorDebugInternalFrameType frameType)
 HRESULT ManagedDebugger::GetStackTrace(ICorDebugThread *pThread, int startFrame, int levels, std::vector<StackFrame> &stackFrames, int &totalFrames)
 {
     HRESULT Status;
-    std::stringstream ss;
 
     DWORD threadId = 0;
     pThread->GetID(&threadId);
index eaac1df35a4ab5d019833295eb1534b77736f75d..2a654dd205e2fa9cee6937cd3b16c55fa42ee471 100644 (file)
@@ -121,7 +121,7 @@ static HRESULT PrintBreakpoint(const Breakpoint &b, std::string &output)
 {
     HRESULT Status;
 
-    std::stringstream ss;
+    std::ostringstream ss;
 
     if (b.verified)
     {
@@ -168,7 +168,7 @@ HRESULT MIProtocol::StepCommand(const std::vector<std::string> &args,
 
 static std::string AddrToString(uint64_t addr)
 {
-    std::stringstream ss;
+    std::ostringstream ss;
     ss << "0x" << std::setw(2 * sizeof(void*)) << std::setfill('0') << std::hex << addr;
     return ss.str();
 }
@@ -177,7 +177,7 @@ HRESULT MIProtocol::PrintFrameLocation(const StackFrame &stackFrame, std::string
 {
     HRESULT Status;
 
-    std::stringstream ss;
+    std::ostringstream ss;
 
     if (!stackFrame.source.IsNull())
     {
@@ -210,7 +210,7 @@ HRESULT MIProtocol::PrintFrameLocation(const StackFrame &stackFrame, std::string
 HRESULT MIProtocol::PrintFrames(int threadId, std::string &output, int lowFrame, int highFrame)
 {
     HRESULT Status;
-    std::stringstream ss;
+    std::ostringstream ss;
 
     int totalFrames = 0;
     std::vector<StackFrame> stackFrames;
@@ -250,7 +250,7 @@ HRESULT MIProtocol::PrintVariables(const std::vector<Variable> &variables, std::
 
     HRESULT Status;
 
-    std::stringstream ss;
+    std::ostringstream ss;
     ss << "variables=[";
     const char *sep = "";
 
@@ -271,7 +271,7 @@ HRESULT MIProtocol::PrintVariables(const std::vector<Variable> &variables, std::
 
 static void PrintVar(const std::string &varobjName, Variable &v, int threadId, int print_values, std::string &output)
 {
-    std::stringstream ss;
+    std::ostringstream ss;
 
     std::string editable = "noneditable";
 
@@ -331,7 +331,7 @@ void MIProtocol::Cleanup()
 
 void MIProtocol::PrintChildren(std::vector<Variable> &children, int threadId, int print_values, bool has_more, std::string &output)
 {
-    std::stringstream ss;
+    std::ostringstream ss;
     ss << "numchild=\"" << children.size() << "\"";
 
     if (children.empty())
@@ -505,7 +505,7 @@ void MIProtocol::EmitModuleEvent(ModuleEvent event)
     {
         case ModuleNew:
         {
-            std::stringstream ss;
+            std::ostringstream ss;
             ss << "id=\"{" << event.module.id << "}\","
                << "target-name=\"" << MIProtocol::EscapeMIValue(event.module.path) << "\","
                << "host-name=\"" << MIProtocol::EscapeMIValue(event.module.path) << "\","
@@ -542,7 +542,7 @@ HRESULT MIProtocol::HandleCommand(std::string command,
         std::vector<Thread> threads;
         IfFailRet(m_debugger->GetThreads(threads));
 
-        std::stringstream ss;
+        std::ostringstream ss;
 
         ss << "threads=[";
 
@@ -780,7 +780,7 @@ HRESULT MIProtocol::HandleCommand(std::string command,
         if (args.at(0) == "--mda")
             i = 2;
 
-        std::stringstream ss;
+        std::ostringstream ss;
         const char *sep = "";
         ss << "bkpt=[";
         for (; i < args.size(); i++)
index 96ec5c474e3322fa16c16f1a59e70d71cf5b691a..4cb7e700a6935d40f1a70ba4ce3cfebef57aa19a 100644 (file)
@@ -238,7 +238,7 @@ HRESULT Modules::GetModuleId(ICorDebugModule *pModule, std::string &id)
 
     IfFailRet(pMDImport->GetScopeProps(nullptr, 0, nullptr, &mvid));
 
-    std::stringstream ss;
+    std::ostringstream ss;
     ss << std::hex
     << std::setfill('0') << std::setw(8) << mvid.Data1 << "-"
     << std::setfill('0') << std::setw(4) << mvid.Data2 << "-"
index 1e261c9000d3ffe1a82a1d8d292a38a373ef17c4..6ca17fd50592abc61526d74cd8645c918d4bd7d8 100644 (file)
@@ -48,7 +48,7 @@ static std::string ConsumeGenericArgs(const std::string &name, std::list<std::st
         return name;
     }
 
-    std::stringstream ss;
+    std::ostringstream ss;
     ss << name.substr(0, offset);
     ss << "<";
     const char *sep = "";
@@ -364,7 +364,7 @@ HRESULT TypePrinter::GetTypeOfValue(ICorDebugType *pType, std::string &elementTy
     //ELEMENT_TYPE_R8_HFA         = 0x07 | ELEMENT_TYPE_MODIFIER, // used only internally for R8 HFA types
     default:
         {
-            std::stringstream ss;
+            std::ostringstream ss;
             ss << "(Unhandled CorElementType: 0x" << std::hex << corElemType << ")";
             elementType = ss.str();
         }
@@ -373,7 +373,7 @@ HRESULT TypePrinter::GetTypeOfValue(ICorDebugType *pType, std::string &elementTy
     case ELEMENT_TYPE_VALUETYPE:
     case ELEMENT_TYPE_CLASS:
         {
-            std::stringstream ss;
+            std::ostringstream ss;
             //Defaults in case we fail...
             elementType = (corElemType == ELEMENT_TYPE_VALUETYPE) ? "struct" : "class";
 
@@ -476,7 +476,7 @@ HRESULT TypePrinter::GetTypeOfValue(ICorDebugType *pType, std::string &elementTy
                 return S_OK;
             case ELEMENT_TYPE_ARRAY:
                 {
-                    std::stringstream ss;
+                    std::ostringstream ss;
                     ULONG32 rank = 0;
                     pType->GetRank(&rank);
                     ss << "[";
@@ -796,7 +796,7 @@ HRESULT TypePrinter::GetTypeAndMethod(ICorDebugFrame *pFrame, std::string &typeN
 
     if (methodGenericsCount > 0)
     {
-        std::stringstream ss;
+        std::ostringstream ss;
         ss << funcName << '`' << methodGenericsCount;
         funcName = ss.str();
     }
@@ -822,7 +822,7 @@ HRESULT TypePrinter::GetMethodName(ICorDebugFrame *pFrame, std::string &output)
     std::string typeName;
     std::string methodName;
 
-    std::stringstream ss;
+    std::ostringstream ss;
     IfFailRet(GetTypeAndMethod(pFrame, typeName, methodName));
     if (!typeName.empty())
         ss << typeName << ".";
index ec534ad2e3efe3fddf286780762bd477d0fb023c..457db3de6d8c443b2bcbae828c5d8392c91fdd10 100644 (file)
@@ -121,7 +121,7 @@ static HRESULT PrintEnumValue(ICorDebugValue* pInputValue, BYTE* enumValue, std:
     }
     pMD->CloseEnum(fEnum);
 
-    std::stringstream ss;
+    std::ostringstream ss;
     const char *sep = "";
 
     //Now that we know the underlying enum type, let's decode the enum variable into OR-ed, human readable enum contants
@@ -408,7 +408,7 @@ static HRESULT PrintArrayValue(ICorDebugValue *pValue,
     ULONG32 cElements;
     IfFailRet(pArrayValue->GetCount(&cElements));
 
-    std::stringstream ss;
+    std::ostringstream ss;
     ss << "{";
 
     std::string elementType;
@@ -549,7 +549,7 @@ HRESULT PrintValue(ICorDebugValue *pInputValue, std::string &output, bool escape
 
         EscapeString(raw_str, '"');
 
-        std::stringstream ss;
+        std::ostringstream ss;
         ss << "\"" << raw_str << "\"";
         output = ss.str();
         return S_OK;
@@ -569,7 +569,7 @@ HRESULT PrintValue(ICorDebugValue *pInputValue, std::string &output, bool escape
         return PrintEnumValue(pValue, rgbValue, output);
     }
 
-    std::stringstream ss;
+    std::ostringstream ss;
 
     switch (corElemType)
     {
index ce53da181697334dd93d1afc3c86fa5c26d40bb2..f88ccf68ad13df43cb927d63f4fcb4492b0155ba 100644 (file)
@@ -315,7 +315,7 @@ static std::string IndiciesToStr(const std::vector<ULONG32> &ind, const std::vec
     if (ind_size < 1 || base.size() != ind_size)
         return std::string();
 
-    std::stringstream ss;
+    std::ostringstream ss;
     const char *sep = "";
     for (size_t i = 0; i < ind_size; ++i)
     {
@@ -853,7 +853,7 @@ HRESULT Evaluator::WalkStackVars(ICorDebugFrame *pFrame, WalkStackVarsCallback c
             }
             if(paramName.empty())
             {
-                std::stringstream ss;
+                std::ostringstream ss;
                 ss << "param_" << i;
                 paramName = ss.str();
             }
index b4969e2352b061cd946c046f018b54c43b81bf3f..3ba5e76a0144d4aa5a02361bea35b6999bf21aeb 100644 (file)
@@ -494,7 +494,7 @@ void VSCodeProtocol::CommandLoop()
             }
             else
             {
-                std::stringstream ss;
+                std::ostringstream ss;
                 ss << "Failed command '" << command << "' : "
                    << "0x" << std::setw(8) << std::setfill('0') << std::hex << Status;
                 response["success"] = false;