Loading lldb/include/lldb/Breakpoint/BreakpointOptions.h +2 −1 Original line number Diff line number Diff line Loading @@ -88,7 +88,8 @@ public: explicit CommandBaton(std::unique_ptr<CommandData> Data) : TypedBaton(std::move(Data)) {} void GetDescription(Stream *s, lldb::DescriptionLevel level) const override; void GetDescription(llvm::raw_ostream &s, lldb::DescriptionLevel level, unsigned indentation) const override; }; typedef std::shared_ptr<CommandBaton> CommandBatonSP; Loading lldb/include/lldb/Breakpoint/WatchpointOptions.h +2 −1 Original line number Diff line number Diff line Loading @@ -180,7 +180,8 @@ public: CommandBaton(std::unique_ptr<CommandData> Data) : TypedBaton(std::move(Data)) {} void GetDescription(Stream *s, lldb::DescriptionLevel level) const override; void GetDescription(llvm::raw_ostream &s, lldb::DescriptionLevel level, unsigned indentation) const override; }; protected: Loading lldb/include/lldb/Utility/Baton.h +9 −4 Original line number Diff line number Diff line Loading @@ -12,6 +12,8 @@ #include "lldb/lldb-enumerations.h" #include "lldb/lldb-public.h" #include "llvm/Support/raw_ostream.h" #include <memory> namespace lldb_private { Loading @@ -37,8 +39,9 @@ public: virtual void *data() = 0; virtual void GetDescription(Stream *s, lldb::DescriptionLevel level) const = 0; virtual void GetDescription(llvm::raw_ostream &s, lldb::DescriptionLevel level, unsigned indentation) const = 0; }; class UntypedBaton : public Baton { Loading @@ -50,7 +53,8 @@ public: } void *data() override { return m_data; } void GetDescription(Stream *s, lldb::DescriptionLevel level) const override; void GetDescription(llvm::raw_ostream &s, lldb::DescriptionLevel level, unsigned indentation) const override; void *m_data; // Leave baton public for easy access }; Loading @@ -63,7 +67,8 @@ public: const T *getItem() const { return Item.get(); } void *data() override { return Item.get(); } void GetDescription(Stream *s, lldb::DescriptionLevel level) const override {} void GetDescription(llvm::raw_ostream &s, lldb::DescriptionLevel level, unsigned indentation) const override {} protected: std::unique_ptr<T> Item; Loading lldb/source/Breakpoint/BreakpointOptions.cpp +18 −19 Original line number Diff line number Diff line Loading @@ -566,7 +566,8 @@ void BreakpointOptions::GetDescription(Stream *s, if (m_callback_baton_sp.get()) { if (level != eDescriptionLevelBrief) { s->EOL(); m_callback_baton_sp->GetDescription(s, level); m_callback_baton_sp->GetDescription(s->AsRawOstream(), level, s->GetIndentLevel()); } } if (!m_condition_text.empty()) { Loading @@ -578,35 +579,33 @@ void BreakpointOptions::GetDescription(Stream *s, } void BreakpointOptions::CommandBaton::GetDescription( Stream *s, lldb::DescriptionLevel level) const { llvm::raw_ostream &s, lldb::DescriptionLevel level, unsigned indentation) const { const CommandData *data = getItem(); if (level == eDescriptionLevelBrief) { s->Printf(", commands = %s", (data && data->user_source.GetSize() > 0) ? "yes" : "no"); s << ", commands = " << ((data && data->user_source.GetSize() > 0) ? "yes" : "no"); return; } s->IndentMore(); s->Indent("Breakpoint commands"); indentation += 2; s.indent(indentation); s << "Breakpoint commands"; if (data->interpreter != eScriptLanguageNone) s->Printf(" (%s):\n", ScriptInterpreter::LanguageToString(data->interpreter).c_str()); s << llvm::formatv(" ({0}):\n", ScriptInterpreter::LanguageToString(data->interpreter)); else s->PutCString(":\n"); s << ":\n"; s->IndentMore(); indentation += 2; if (data && data->user_source.GetSize() > 0) { const size_t num_strings = data->user_source.GetSize(); for (size_t i = 0; i < num_strings; ++i) { s->Indent(data->user_source.GetStringAtIndex(i)); s->EOL(); } } else { s->PutCString("No commands.\n"); for (llvm::StringRef str : data->user_source) { s.indent(indentation); s << str << "\n"; } s->IndentLess(); s->IndentLess(); } else s << "No commands.\n"; } void BreakpointOptions::SetCommandDataCallback( Loading lldb/source/Breakpoint/WatchpointOptions.cpp +14 −14 Original line number Diff line number Diff line Loading @@ -121,7 +121,8 @@ void WatchpointOptions::GetCallbackDescription( Stream *s, lldb::DescriptionLevel level) const { if (m_callback_baton_sp.get()) { s->EOL(); m_callback_baton_sp->GetDescription(s, level); m_callback_baton_sp->GetDescription(s->AsRawOstream(), level, s->GetIndentLevel()); } } Loading Loading @@ -156,27 +157,26 @@ void WatchpointOptions::GetDescription(Stream *s, } void WatchpointOptions::CommandBaton::GetDescription( Stream *s, lldb::DescriptionLevel level) const { llvm::raw_ostream &s, lldb::DescriptionLevel level, unsigned indentation) const { const CommandData *data = getItem(); if (level == eDescriptionLevelBrief) { s->Printf(", commands = %s", (data && data->user_source.GetSize() > 0) ? "yes" : "no"); s << ", commands = %s" << ((data && data->user_source.GetSize() > 0) ? "yes" : "no"); return; } s->IndentMore(); s->Indent("watchpoint commands:\n"); indentation += 2; s.indent(indentation); s << "watchpoint commands:\n"; s->IndentMore(); indentation += 2; if (data && data->user_source.GetSize() > 0) { for (const std::string &line : data->user_source) { s->Indent(line); s->EOL(); s.indent(indentation); s << line << "\n"; } } else { s->PutCString("No commands.\n"); } s->IndentLess(); s->IndentLess(); } else s << "No commands.\n"; } Loading
lldb/include/lldb/Breakpoint/BreakpointOptions.h +2 −1 Original line number Diff line number Diff line Loading @@ -88,7 +88,8 @@ public: explicit CommandBaton(std::unique_ptr<CommandData> Data) : TypedBaton(std::move(Data)) {} void GetDescription(Stream *s, lldb::DescriptionLevel level) const override; void GetDescription(llvm::raw_ostream &s, lldb::DescriptionLevel level, unsigned indentation) const override; }; typedef std::shared_ptr<CommandBaton> CommandBatonSP; Loading
lldb/include/lldb/Breakpoint/WatchpointOptions.h +2 −1 Original line number Diff line number Diff line Loading @@ -180,7 +180,8 @@ public: CommandBaton(std::unique_ptr<CommandData> Data) : TypedBaton(std::move(Data)) {} void GetDescription(Stream *s, lldb::DescriptionLevel level) const override; void GetDescription(llvm::raw_ostream &s, lldb::DescriptionLevel level, unsigned indentation) const override; }; protected: Loading
lldb/include/lldb/Utility/Baton.h +9 −4 Original line number Diff line number Diff line Loading @@ -12,6 +12,8 @@ #include "lldb/lldb-enumerations.h" #include "lldb/lldb-public.h" #include "llvm/Support/raw_ostream.h" #include <memory> namespace lldb_private { Loading @@ -37,8 +39,9 @@ public: virtual void *data() = 0; virtual void GetDescription(Stream *s, lldb::DescriptionLevel level) const = 0; virtual void GetDescription(llvm::raw_ostream &s, lldb::DescriptionLevel level, unsigned indentation) const = 0; }; class UntypedBaton : public Baton { Loading @@ -50,7 +53,8 @@ public: } void *data() override { return m_data; } void GetDescription(Stream *s, lldb::DescriptionLevel level) const override; void GetDescription(llvm::raw_ostream &s, lldb::DescriptionLevel level, unsigned indentation) const override; void *m_data; // Leave baton public for easy access }; Loading @@ -63,7 +67,8 @@ public: const T *getItem() const { return Item.get(); } void *data() override { return Item.get(); } void GetDescription(Stream *s, lldb::DescriptionLevel level) const override {} void GetDescription(llvm::raw_ostream &s, lldb::DescriptionLevel level, unsigned indentation) const override {} protected: std::unique_ptr<T> Item; Loading
lldb/source/Breakpoint/BreakpointOptions.cpp +18 −19 Original line number Diff line number Diff line Loading @@ -566,7 +566,8 @@ void BreakpointOptions::GetDescription(Stream *s, if (m_callback_baton_sp.get()) { if (level != eDescriptionLevelBrief) { s->EOL(); m_callback_baton_sp->GetDescription(s, level); m_callback_baton_sp->GetDescription(s->AsRawOstream(), level, s->GetIndentLevel()); } } if (!m_condition_text.empty()) { Loading @@ -578,35 +579,33 @@ void BreakpointOptions::GetDescription(Stream *s, } void BreakpointOptions::CommandBaton::GetDescription( Stream *s, lldb::DescriptionLevel level) const { llvm::raw_ostream &s, lldb::DescriptionLevel level, unsigned indentation) const { const CommandData *data = getItem(); if (level == eDescriptionLevelBrief) { s->Printf(", commands = %s", (data && data->user_source.GetSize() > 0) ? "yes" : "no"); s << ", commands = " << ((data && data->user_source.GetSize() > 0) ? "yes" : "no"); return; } s->IndentMore(); s->Indent("Breakpoint commands"); indentation += 2; s.indent(indentation); s << "Breakpoint commands"; if (data->interpreter != eScriptLanguageNone) s->Printf(" (%s):\n", ScriptInterpreter::LanguageToString(data->interpreter).c_str()); s << llvm::formatv(" ({0}):\n", ScriptInterpreter::LanguageToString(data->interpreter)); else s->PutCString(":\n"); s << ":\n"; s->IndentMore(); indentation += 2; if (data && data->user_source.GetSize() > 0) { const size_t num_strings = data->user_source.GetSize(); for (size_t i = 0; i < num_strings; ++i) { s->Indent(data->user_source.GetStringAtIndex(i)); s->EOL(); } } else { s->PutCString("No commands.\n"); for (llvm::StringRef str : data->user_source) { s.indent(indentation); s << str << "\n"; } s->IndentLess(); s->IndentLess(); } else s << "No commands.\n"; } void BreakpointOptions::SetCommandDataCallback( Loading
lldb/source/Breakpoint/WatchpointOptions.cpp +14 −14 Original line number Diff line number Diff line Loading @@ -121,7 +121,8 @@ void WatchpointOptions::GetCallbackDescription( Stream *s, lldb::DescriptionLevel level) const { if (m_callback_baton_sp.get()) { s->EOL(); m_callback_baton_sp->GetDescription(s, level); m_callback_baton_sp->GetDescription(s->AsRawOstream(), level, s->GetIndentLevel()); } } Loading Loading @@ -156,27 +157,26 @@ void WatchpointOptions::GetDescription(Stream *s, } void WatchpointOptions::CommandBaton::GetDescription( Stream *s, lldb::DescriptionLevel level) const { llvm::raw_ostream &s, lldb::DescriptionLevel level, unsigned indentation) const { const CommandData *data = getItem(); if (level == eDescriptionLevelBrief) { s->Printf(", commands = %s", (data && data->user_source.GetSize() > 0) ? "yes" : "no"); s << ", commands = %s" << ((data && data->user_source.GetSize() > 0) ? "yes" : "no"); return; } s->IndentMore(); s->Indent("watchpoint commands:\n"); indentation += 2; s.indent(indentation); s << "watchpoint commands:\n"; s->IndentMore(); indentation += 2; if (data && data->user_source.GetSize() > 0) { for (const std::string &line : data->user_source) { s->Indent(line); s->EOL(); s.indent(indentation); s << line << "\n"; } } else { s->PutCString("No commands.\n"); } s->IndentLess(); s->IndentLess(); } else s << "No commands.\n"; }