aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2023-03-15 10:26:38 +0000
committerDavid Spickett <david.spickett@linaro.org>2023-03-21 15:34:17 +0000
commite73dd6254e310a799b492127c0f237af0e2236e2 (patch)
treed0ba258e4f0352a067e21414bdc99c30a91d635a /lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
parent68685a7f6ad19fcaed317d225ba798119f3ea157 (diff)
downloadllvm-e73dd6254e310a799b492127c0f237af0e2236e2.zip
llvm-e73dd6254e310a799b492127c0f237af0e2236e2.tar.gz
llvm-e73dd6254e310a799b492127c0f237af0e2236e2.tar.bz2
[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
Diffstat (limited to 'lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp')
-rw-r--r--lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
index 9a67027..5e7f88c 100644
--- a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
+++ b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
@@ -269,7 +269,7 @@ size_t ScriptedProcess::DoWriteMemory(lldb::addr_t vm_addr, const void *buf,
if (!data_extractor_sp || !data_extractor_sp->GetByteSize())
return 0;
- size_t bytes_written =
+ lldb::offset_t bytes_written =
GetInterface().WriteMemoryAtAddress(vm_addr, data_extractor_sp, error);
if (!bytes_written || bytes_written == LLDB_INVALID_OFFSET)