aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/source/Plugins/ObjectFile/wasm
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/lldb/source/Plugins/ObjectFile/wasm')
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp15
-rw-r--r--contrib/llvm-project/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.h8
2 files changed, 12 insertions, 11 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),
diff --git a/contrib/llvm-project/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.h b/contrib/llvm-project/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.h
index d7b5bc22caad..5676030f955e 100644
--- a/contrib/llvm-project/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.h
+++ b/contrib/llvm-project/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.h
@@ -30,12 +30,12 @@ public:
}
static ObjectFile *
- CreateInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
+ CreateInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP data_sp,
lldb::offset_t data_offset, const FileSpec *file,
lldb::offset_t file_offset, lldb::offset_t length);
static ObjectFile *CreateMemoryInstance(const lldb::ModuleSP &module_sp,
- lldb::DataBufferSP &data_sp,
+ lldb::WritableDataBufferSP data_sp,
const lldb::ProcessSP &process_sp,
lldb::addr_t header_addr);
@@ -111,11 +111,11 @@ public:
llvm::Optional<FileSpec> GetExternalDebugInfoFileSpec();
private:
- ObjectFileWasm(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
+ ObjectFileWasm(const lldb::ModuleSP &module_sp, lldb::DataBufferSP data_sp,
lldb::offset_t data_offset, const FileSpec *file,
lldb::offset_t offset, lldb::offset_t length);
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);
/// Wasm section decoding routines.