From e73dd6254e310a799b492127c0f237af0e2236e2 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Wed, 15 Mar 2023 10:26:38 +0000 Subject: [lldb] Fix a 32 bit warning in ScriptedProcessInterface ../llvm-project/lldb/include/lldb/Interpreter/ScriptedProcessInterface.h:61:12: warning: implicit conversion from 'unsigned long long' to 'size_t' (aka 'unsigned int') changes value from 18446744073709551615 to 4294967295 [-Wconstant-conversion] ../llvm-project/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp:275:39: warning: result of comparison of constant 18446744073709551615 with expression of type 'size_t' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare] This happens because size_t on 32 bit is 32 bit, but LLDB_INVALID_OFFSET is UINT64_MAX. Return lldb::offset_t instead, which is 64 bit everywhere. DoWriteMemory still returns size_t but this is because every other Process derived thing does that. As long as the failure check works I think it should be fine. Reviewed By: mib Differential Revision: https://reviews.llvm.org/D146124 --- .../ScriptInterpreter/Python/ScriptedProcessPythonInterface.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.h') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.h index b7b12b9..a96a55d 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.h @@ -50,8 +50,9 @@ public: lldb::DataExtractorSP ReadMemoryAtAddress(lldb::addr_t address, size_t size, Status &error) override; - size_t WriteMemoryAtAddress(lldb::addr_t addr, lldb::DataExtractorSP data_sp, - Status &error) override; + lldb::offset_t WriteMemoryAtAddress(lldb::addr_t addr, + lldb::DataExtractorSP data_sp, + Status &error) override; StructuredData::ArraySP GetLoadedImages() override; -- cgit v1.1