diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2022-07-04 19:20:19 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2023-02-08 19:02:26 +0000 |
commit | 81ad626541db97eb356e2c1d4a20eb2a26a766ab (patch) | |
tree | 311b6a8987c32b1e1dcbab65c54cfac3fdb56175 /contrib/llvm-project/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp | |
parent | 5fff09660e06a66bed6482da9c70df328e16bbb6 (diff) | |
parent | 145449b1e420787bb99721a429341fa6be3adfb6 (diff) |
Diffstat (limited to 'contrib/llvm-project/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp')
-rw-r--r-- | contrib/llvm-project/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/contrib/llvm-project/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp b/contrib/llvm-project/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp index 7445f8311c50..905e9637493b 100644 --- a/contrib/llvm-project/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp +++ b/contrib/llvm-project/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp @@ -15,6 +15,7 @@ #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" #include "lldb/Utility/DataBufferHeap.h" +#include "lldb/Utility/LLDBLog.h" #include "lldb/Utility/Log.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" @@ -42,7 +43,7 @@ static bool ValidateModuleHeader(const DataBufferSP &data_sp) { llvm::file_magic::wasm_object) return false; - uint8_t *Ptr = data_sp->GetBytes() + sizeof(llvm::wasm::WasmMagic); + const uint8_t *Ptr = data_sp->GetBytes() + sizeof(llvm::wasm::WasmMagic); uint32_t version = llvm::support::endian::read32le(Ptr); return version == llvm::wasm::WasmVersion; @@ -87,10 +88,10 @@ void ObjectFileWasm::Terminate() { } ObjectFile * -ObjectFileWasm::CreateInstance(const ModuleSP &module_sp, DataBufferSP &data_sp, +ObjectFileWasm::CreateInstance(const ModuleSP &module_sp, DataBufferSP data_sp, offset_t data_offset, const FileSpec *file, offset_t file_offset, offset_t length) { - Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_OBJECT)); + Log *log = GetLog(LLDBLog::Object); if (!data_sp) { data_sp = MapFileData(*file, length, file_offset); @@ -140,7 +141,7 @@ ObjectFileWasm::CreateInstance(const ModuleSP &module_sp, DataBufferSP &data_sp, } ObjectFile *ObjectFileWasm::CreateMemoryInstance(const ModuleSP &module_sp, - DataBufferSP &data_sp, + WritableDataBufferSP data_sp, const ProcessSP &process_sp, addr_t header_addr) { if (!ValidateModuleHeader(data_sp)) @@ -191,7 +192,7 @@ bool ObjectFileWasm::DecodeNextSection(lldb::offset_t *offset_ptr) { m_sect_infos.push_back(section_info{*offset_ptr + c.tell(), section_length, section_id, *sect_name}); *offset_ptr += (c.tell() + section_length); - } else if (section_id <= llvm::wasm::WASM_SEC_TAG) { + } else if (section_id <= llvm::wasm::WASM_SEC_LAST_KNOWN) { m_sect_infos.push_back(section_info{*offset_ptr + c.tell(), static_cast<uint32_t>(payload_len), section_id, ConstString()}); @@ -226,7 +227,7 @@ size_t ObjectFileWasm::GetModuleSpecifications( return 1; } -ObjectFileWasm::ObjectFileWasm(const ModuleSP &module_sp, DataBufferSP &data_sp, +ObjectFileWasm::ObjectFileWasm(const ModuleSP &module_sp, DataBufferSP data_sp, offset_t data_offset, const FileSpec *file, offset_t offset, offset_t length) : ObjectFile(module_sp, file, offset, length, data_sp, data_offset), @@ -235,7 +236,7 @@ ObjectFileWasm::ObjectFileWasm(const ModuleSP &module_sp, DataBufferSP &data_sp, } ObjectFileWasm::ObjectFileWasm(const lldb::ModuleSP &module_sp, - lldb::DataBufferSP &header_data_sp, + lldb::WritableDataBufferSP header_data_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr) : ObjectFile(module_sp, process_sp, header_addr, header_data_sp), |