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 25cd249355b0f3192ca5b0c69514ad68a1cb8897 739b26b03fd3661d1c22b975e241cbbe60ca6531 -- lldb/include/lldb/Target/UnwindWasm.h lldb/source/Plugins/Process/wasm/ProcessWasm.cpp lldb/source/Plugins/Process/wasm/ProcessWasm.h lldb/source/Plugins/Process/wasm/ThreadWasm.cpp lldb/source/Plugins/Process/wasm/ThreadWasm.h lldb/source/Plugins/Process/wasm/UnwindWasm.cpp lldb/source/Plugins/Process/wasm/UnwindWasm.h lldb/source/Plugins/Process/wasm/wasmRegisterContext.cpp lldb/source/Plugins/Process/wasm/wasmRegisterContext.h lldb/include/lldb/Target/Process.h lldb/source/Core/Value.cpp lldb/source/Expression/DWARFExpression.cpp lldb/source/Interpreter/CommandInterpreter.cpp lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h lldb/source/Target/Platform.cpp `````````` </details> <details> <summary> View the diff from clang-format here. </summary> ``````````diff diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp index 1693e390c2..8e8ea610b8 100644 --- a/lldb/source/Expression/DWARFExpression.cpp +++ b/lldb/source/Expression/DWARFExpression.cpp @@ -350,8 +350,7 @@ static offset_t GetOpcodeDataSize(const DataExtractor &data, uint8_t wasm_op = data.GetU8(&offset); if (wasm_op == 3) { data.GetU32(&offset); - } - else { + } else { data.GetULEB128(&offset); } return offset - data_offset; @@ -2612,13 +2611,13 @@ bool DWARFExpression::Evaluate( /* LLDB doesn't have an address space to represents WebAssembly Locals, * GLobals and operand stacks. - * We encode these elements into virtual registers: + * We encode these elements into virtual registers: * | tag: 2 bits | index: 30 bits | * where tag is: * 0: Not a WebAssembly location * 1: Local * 2: Global - * 3: Operand stack value + * 3: Operand stack value */ if (wasm_op == 3) { index = opcodes.GetU32(&offset); diff --git a/lldb/source/Plugins/Process/wasm/ProcessWasm.cpp b/lldb/source/Plugins/Process/wasm/ProcessWasm.cpp index 1c1f9885b6..275248a1ef 100644 --- a/lldb/source/Plugins/Process/wasm/ProcessWasm.cpp +++ b/lldb/source/Plugins/Process/wasm/ProcessWasm.cpp @@ -73,7 +73,7 @@ lldb::ProcessSP ProcessWasm::CreateInstance(lldb::TargetSP target_sp, } bool ProcessWasm::CanDebug(lldb::TargetSP target_sp, - bool plugin_specified_by_name) { + bool plugin_specified_by_name) { if (plugin_specified_by_name) return true; @@ -144,7 +144,7 @@ size_t ProcessWasm::ReadMemory(lldb::addr_t vm_addr, void *buf, size_t size, } size_t ProcessWasm::WasmReadMemory(uint32_t wasm_module_id, lldb::addr_t addr, - void *buf, size_t buffer_size) { + void *buf, size_t buffer_size) { char packet[64]; int packet_len = ::snprintf(packet, sizeof(packet), "qWasmMem:%d;%" PRIx64 ";%" PRIx64, @@ -153,7 +153,8 @@ size_t ProcessWasm::WasmReadMemory(uint32_t wasm_module_id, lldb::addr_t addr, assert(packet_len + 1 < (int)sizeof(packet)); UNUSED_IF_ASSERT_DISABLED(packet_len); StringExtractorGDBRemote response; - if (m_gdb_comm.SendPacketAndWaitForResponse(packet, response, GetInterruptTimeout()) == + if (m_gdb_comm.SendPacketAndWaitForResponse(packet, response, + GetInterruptTimeout()) == GDBRemoteCommunication::PacketResult::Success) { if (response.IsNormalResponse()) { return response.GetHexBytes(llvm::MutableArrayRef<uint8_t>( @@ -165,7 +166,7 @@ size_t ProcessWasm::WasmReadMemory(uint32_t wasm_module_id, lldb::addr_t addr, } size_t ProcessWasm::WasmReadData(uint32_t wasm_module_id, lldb::addr_t addr, - void *buf, size_t buffer_size) { + void *buf, size_t buffer_size) { char packet[64]; int packet_len = ::snprintf(packet, sizeof(packet), "qWasmData:%d;%" PRIx64 ";%" PRIx64, @@ -174,7 +175,8 @@ size_t ProcessWasm::WasmReadData(uint32_t wasm_module_id, lldb::addr_t addr, assert(packet_len + 1 < (int)sizeof(packet)); UNUSED_IF_ASSERT_DISABLED(packet_len); StringExtractorGDBRemote response; - if (m_gdb_comm.SendPacketAndWaitForResponse(packet, response, GetInterruptTimeout()) == + if (m_gdb_comm.SendPacketAndWaitForResponse(packet, response, + GetInterruptTimeout()) == GDBRemoteCommunication::PacketResult::Success) { if (response.IsNormalResponse()) { return response.GetHexBytes(llvm::MutableArrayRef<uint8_t>( diff --git a/lldb/source/Plugins/Process/wasm/ProcessWasm.h b/lldb/source/Plugins/Process/wasm/ProcessWasm.h index c4579390da..0d57934b9e 100644 --- a/lldb/source/Plugins/Process/wasm/ProcessWasm.h +++ b/lldb/source/Plugins/Process/wasm/ProcessWasm.h @@ -26,11 +26,7 @@ namespace wasm { // // Struct wasm_addr_t provides this encoding using bitfields // -enum WasmAddressType { - Memory = 0x00, - Object = 0x01, - Invalid = 0x03 -}; +enum WasmAddressType { Memory = 0x00, Object = 0x01, Invalid = 0x03 }; struct wasm_addr_t { uint64_t offset : 32; uint64_t module_id : 30; @@ -96,11 +92,11 @@ public: /// Read from the WebAssembly Memory space. size_t WasmReadMemory(uint32_t wasm_module_id, lldb::addr_t addr, void *buf, - size_t buffer_size); + size_t buffer_size); /// Read from the WebAssembly Data space. size_t WasmReadData(uint32_t wasm_module_id, lldb::addr_t addr, void *buf, - size_t buffer_size); + size_t buffer_size); /// Retrieve the current call stack from the WebAssembly remote process. bool GetWasmCallStack(lldb::tid_t tid, diff --git a/lldb/source/Plugins/Process/wasm/ThreadWasm.cpp b/lldb/source/Plugins/Process/wasm/ThreadWasm.cpp index d9715dd23b..adcfba7400 100644 --- a/lldb/source/Plugins/Process/wasm/ThreadWasm.cpp +++ b/lldb/source/Plugins/Process/wasm/ThreadWasm.cpp @@ -49,7 +49,8 @@ ThreadWasm::CreateRegisterContextForFrame(StackFrame *frame) { concrete_frame_idx = frame->GetConcreteFrameIndex(); if (concrete_frame_idx == 0) { - reg_ctx_sp = std::make_shared<WasmRegisterContext>(*this, concrete_frame_idx, wasm_process->GetRegisterInfo()); + reg_ctx_sp = std::make_shared<WasmRegisterContext>( + *this, concrete_frame_idx, wasm_process->GetRegisterInfo()); } else { reg_ctx_sp = GetUnwinder().CreateRegisterContextForFrame(frame); } diff --git a/lldb/source/Plugins/Process/wasm/wasmRegisterContext.cpp b/lldb/source/Plugins/Process/wasm/wasmRegisterContext.cpp index 2f8e24df14..0e7382043a 100644 --- a/lldb/source/Plugins/Process/wasm/wasmRegisterContext.cpp +++ b/lldb/source/Plugins/Process/wasm/wasmRegisterContext.cpp @@ -8,9 +8,9 @@ #include "wasmRegisterContext.h" #include "Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h" -#include "lldb/Utility/RegisterValue.h" #include "ProcessWasm.h" #include "ThreadWasm.h" +#include "lldb/Utility/RegisterValue.h" #include <memory> using namespace lldb; @@ -27,9 +27,8 @@ WasmRegisterContext::WasmRegisterContext( WasmRegisterContext::~WasmRegisterContext() = default; uint32_t WasmRegisterContext::ConvertRegisterKindToRegisterNumber( - lldb::RegisterKind kind, uint32_t num) -{ - return num; + lldb::RegisterKind kind, uint32_t num) { + return num; } size_t WasmRegisterContext::GetRegisterCount() { return 0; } @@ -40,7 +39,8 @@ const RegisterInfo *WasmRegisterContext::GetRegisterInfoAtIndex(size_t reg) { return m_reg_info_sp->GetRegisterInfoAtIndex(reg); } - WasmVirtualRegisterKinds kind = static_cast<WasmVirtualRegisterKinds>(tag - 1); + WasmVirtualRegisterKinds kind = + static_cast<WasmVirtualRegisterKinds>(tag - 1); return new WasmVirtualRegisterInfo(kind, reg & 0x3fffffff); } @@ -61,7 +61,8 @@ bool WasmRegisterContext::ReadRegister(const RegisterInfo *reg_info, if (!thread) return false; -//uint32_t frame_index = thread->GetSelectedFrameIndex(SelectMostRelevantFrame); + // uint32_t frame_index = + // thread->GetSelectedFrameIndex(SelectMostRelevantFrame); uint32_t frame_index = m_concrete_frame_idx; WasmVirtualRegisterInfo *wasm_reg_info = static_cast<WasmVirtualRegisterInfo *>( diff --git a/lldb/source/Plugins/Process/wasm/wasmRegisterContext.h b/lldb/source/Plugins/Process/wasm/wasmRegisterContext.h index 61fb95cef6..16a89a2408 100644 --- a/lldb/source/Plugins/Process/wasm/wasmRegisterContext.h +++ b/lldb/source/Plugins/Process/wasm/wasmRegisterContext.h @@ -21,7 +21,7 @@ class WasmRegisterContext; typedef std::shared_ptr<WasmRegisterContext> WasmRegisterContextSP; enum WasmVirtualRegisterKinds { - eLocal = 0, ///< wasm local + eLocal = 0, ///< wasm local eGlobal, ///< wasm global eOperandStack, ///< wasm operand stack kNumWasmVirtualRegisterKinds @@ -45,7 +45,7 @@ public: ~WasmRegisterContext() override; uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, - uint32_t num) override; + uint32_t num) override; void InvalidateAllRegisters() override; `````````` </details> https://github.com/llvm/llvm-project/pull/76683 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits