github-actions[bot] wrote: <!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning: <details> <summary> You can test this locally with the following command: </summary> ``````````bash git-clang-format --diff 98e95a0055a4712fbd18495512c928bf2bd1adcc 4cfef945c2d77ec95cde3b0b13e832ee2dff19a1 -- lldb/include/lldb/Core/Debugger.h lldb/include/lldb/Core/DebuggerEvents.h lldb/include/lldb/Core/Progress.h lldb/source/Core/Debugger.cpp lldb/source/Core/DebuggerEvents.cpp lldb/source/Core/Progress.cpp lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/source/Symbol/LocateSymbolFile.cpp `````````` </details> <details> <summary> View the diff from clang-format here. </summary> ``````````diff diff --git a/lldb/include/lldb/Core/Debugger.h b/lldb/include/lldb/Core/Debugger.h index 462c033e88a..f538c40bfb4 100644 --- a/lldb/include/lldb/Core/Debugger.h +++ b/lldb/include/lldb/Core/Debugger.h @@ -417,55 +417,55 @@ public: /// hand, use INTERRUPT_REQUESTED so this gets done consistently. /// /// \param[in] formatv - /// A formatv string for the interrupt message. If the elements of the + /// A formatv string for the interrupt message. If the elements of the /// message are expensive to compute, you can use the no-argument form of - /// InterruptRequested, then make up the report using REPORT_INTERRUPTION. - /// + /// InterruptRequested, then make up the report using REPORT_INTERRUPTION. + /// /// \return /// A boolean value, if \b true an interruptible operation should interrupt /// itself. template <typename... Args> - bool InterruptRequested(const char *cur_func, - const char *formatv, Args &&... args) { + bool InterruptRequested(const char *cur_func, const char *formatv, + Args &&...args) { bool ret_val = InterruptRequested(); if (ret_val) { if (!formatv) formatv = "Unknown message"; if (!cur_func) cur_func = "<UNKNOWN>"; - ReportInterruption(InterruptionReport(cur_func, - llvm::formatv(formatv, - std::forward<Args>(args)...))); + ReportInterruption(InterruptionReport( + cur_func, llvm::formatv(formatv, std::forward<Args>(args)...))); } return ret_val; } - - + /// This handy define will keep you from having to generate a report for the /// interruption by hand. Use this except in the case where the arguments to /// the message description are expensive to compute. -#define INTERRUPT_REQUESTED(debugger, ...) \ - (debugger).InterruptRequested(__func__, __VA_ARGS__) +#define INTERRUPT_REQUESTED(debugger, ...) \ + (debugger).InterruptRequested(__func__, __VA_ARGS__) // This form just queries for whether to interrupt, and does no reporting: bool InterruptRequested(); - + // FIXME: Do we want to capture a backtrace at the interruption point? class InterruptionReport { public: - InterruptionReport(std::string function_name, std::string description) : - m_function_name(std::move(function_name)), - m_description(std::move(description)), - m_interrupt_time(std::chrono::system_clock::now()), - m_thread_id(llvm::get_threadid()) {} - - InterruptionReport(std::string function_name, - const llvm::formatv_object_base &payload); - - template <typename... Args> - InterruptionReport(std::string function_name, - const char *format, Args &&... args) : - InterruptionReport(function_name, llvm::formatv(format, std::forward<Args>(args)...)) {} + InterruptionReport(std::string function_name, std::string description) + : m_function_name(std::move(function_name)), + m_description(std::move(description)), + m_interrupt_time(std::chrono::system_clock::now()), + m_thread_id(llvm::get_threadid()) {} + + InterruptionReport(std::string function_name, + const llvm::formatv_object_base &payload); + + template <typename... Args> + InterruptionReport(std::string function_name, const char *format, + Args &&...args) + : InterruptionReport( + function_name, + llvm::formatv(format, std::forward<Args>(args)...)) {} std::string m_function_name; std::string m_description; @@ -473,14 +473,13 @@ public: const uint64_t m_thread_id; }; void ReportInterruption(const InterruptionReport &report); -#define REPORT_INTERRUPTION(debugger, ...) \ - (debugger).ReportInterruption(Debugger::InterruptionReport(__func__, \ - __VA_ARGS__)) +#define REPORT_INTERRUPTION(debugger, ...) \ + (debugger).ReportInterruption( \ + Debugger::InterruptionReport(__func__, __VA_ARGS__)) static DebuggerList DebuggersRequestingInterruption(); public: - // This is for use in the command interpreter, when you either want the // selected target, or if no target is present you want to prime the dummy // target with entities that will be copied over to new targets. diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index b247ebbcaf3..159e870a398 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -436,7 +436,7 @@ llvm::StringRef Debugger::GetAutosuggestionAnsiSuffix() const { } bool Debugger::GetShowDontUsePoHint() const { - const uint32_t idx = ePropertyShowDontUsePoHint; + const uint32_t idx = ePropertyShowDontUsePoHint; return GetPropertyAtIndexAs<bool>( idx, g_debugger_properties[idx].default_uint_value != 0); } @@ -1273,17 +1273,17 @@ bool Debugger::InterruptRequested() { return GetCommandInterpreter().WasInterrupted(); } -Debugger::InterruptionReport::InterruptionReport(std::string function_name, - const llvm::formatv_object_base &payload) : - m_function_name(std::move(function_name)), - m_interrupt_time(std::chrono::system_clock::now()), - m_thread_id(llvm::get_threadid()) { +Debugger::InterruptionReport::InterruptionReport( + std::string function_name, const llvm::formatv_object_base &payload) + : m_function_name(std::move(function_name)), + m_interrupt_time(std::chrono::system_clock::now()), + m_thread_id(llvm::get_threadid()) { llvm::raw_string_ostream desc(m_description); desc << payload << "\n"; } void Debugger::ReportInterruption(const InterruptionReport &report) { - // For now, just log the description: + // For now, just log the description: Log *log = GetLog(LLDBLog::Host); LLDB_LOG(log, "Interruption: {0}", report.m_description); } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 9397792605e..b3d95fcee96 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -1734,8 +1734,8 @@ SymbolFileDWARF::GetDwoSymbolFileForCompileUnit( FileSpec dwo_file(dwo_name); FileSystem::Instance().Resolve(dwo_file); if (dwo_file.IsRelative()) { - comp_dir = cu_die.GetAttributeValueAsString(dwarf_cu, DW_AT_comp_dir, - nullptr); + comp_dir = + cu_die.GetAttributeValueAsString(dwarf_cu, DW_AT_comp_dir, nullptr); if (!comp_dir) { unit.SetDwoError(Status::createWithFormat( "unable to locate relative .dwo debug file \"{0}\" for " `````````` </details> https://github.com/llvm/llvm-project/pull/69516 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits