From ed621e76a9889e25a9cbed47e0b96a7a6fdbdb80 Mon Sep 17 00:00:00 2001 From: Walter Erquinigo Date: Tue, 22 Sep 2020 14:49:16 -0700 Subject: [PATCH] [trace] avoid using Easy fix based on the feedback by maskray on https://reviews.llvm.org/D85705. --- .../Trace/intel-pt/TraceIntelPTSettingsParser.cpp | 16 ++++++++-------- lldb/source/Target/TraceSettingsParser.cpp | 8 +------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSettingsParser.cpp b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSettingsParser.cpp index c8f90c9..2430f77 100644 --- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSettingsParser.cpp +++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSettingsParser.cpp @@ -14,14 +14,14 @@ using namespace llvm; StringRef TraceIntelPTSettingsParser::GetPluginSchema() { return R"({ - "type": "intel-pt", - "pt_cpu": { - "vendor": "intel" | "unknown", - "family": integer, - "model": integer, - "stepping": integer - } -})"; + "type": "intel-pt", + "pt_cpu": { + "vendor": "intel" | "unknown", + "family": integer, + "model": integer, + "stepping": integer + } + })"; } llvm::Error TraceIntelPTSettingsParser::ParsePTCPU(const json::Object &trace) { diff --git a/lldb/source/Target/TraceSettingsParser.cpp b/lldb/source/Target/TraceSettingsParser.cpp index 2c0f337..9021d93 100644 --- a/lldb/source/Target/TraceSettingsParser.cpp +++ b/lldb/source/Target/TraceSettingsParser.cpp @@ -8,7 +8,6 @@ #include "lldb/Target/TraceSettingsParser.h" -#include #include #include "Plugins/Process/Utility/HistoryThread.h" @@ -123,12 +122,7 @@ StringRef TraceSettingsParser::GetSchema() { if (schema.empty()) { std::ostringstream schema_builder; schema_builder << "{\n \"trace\": "; - - // We need to add spaces to indent correctly the plugin schema - std::string plugin_schema(GetPluginSchema()); - plugin_schema = std::regex_replace(plugin_schema, std::regex("\n"), "\n "); - schema_builder << plugin_schema << ",\n"; - + schema_builder << GetPluginSchema().str() << ",\n"; schema_builder << R"( "processes": [ { "pid": integer, -- 2.7.4