[Lldb-commits] [PATCH] D122882: Add JSONGenerator::DumpBinaryEscaped method in debugserver, update most callers to use this, skip escaping step

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 1 08:52:28 PDT 2022


JDevlieghere added inline comments.


================
Comment at: lldb/tools/debugserver/source/JSONGenerator.h:233-247
+      std::string quoted;
+      const size_t strsize = m_value.size();
+      for (size_t i = 0; i < strsize; ++i) {
+        char ch = m_value[i];
+        if (ch == '"')
+          quoted.push_back('\\');
+        // gdb remote serial protocol binary escaping
----------------
Can we avoid the quoted string and write directly to the stream?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122882/new/

https://reviews.llvm.org/D122882



More information about the lldb-commits mailing list