[Lldb-commits] [lldb] [lldb-dap] Validate utf8 protocol messages. (PR #181261)

John Harrison via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 13 10:27:36 PST 2026


================
@@ -57,6 +57,22 @@ bool fromJSON(const json::Value &Params, MessageType &M, json::Path P) {
   return true;
 }
 
+json::Value toJSON(const String &S) {
+  if (LLVM_LIKELY(llvm::json::isUTF8(std::string(S))))
+    return std::string(S);
+  return llvm::json::fixUTF8(std::string(S));
+}
+
+bool fromJSON(const llvm::json::Value &Param, String &Str,
+              llvm::json::Path Path) {
+  if (auto s = Param.getAsString()) {
+    Str = *s;
----------------
ashgti wrote:

Done.

https://github.com/llvm/llvm-project/pull/181261


More information about the lldb-commits mailing list