[Lldb-commits] [PATCH] D54241: Fix bug in printing ValueObjects and in PE/COFF Plugin
Leonard Mosescu via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Nov 7 17:17:58 PST 2018
lemo added a comment.
Shouldn't we also handle the general case where raw size < virtual size? (which would naturally subsume this fix)
================
Comment at: lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp:1073
+
+ if (section_offset >= section->GetByteSize())
+ return 0;
----------------
shouldn't this be a hard error instead of returning 0?
================
Comment at: lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp:1077
+ size_t bytes_avail = section->GetByteSize() - section_offset;
+ size_t read_size = std::min(dst_len, bytes_avail);
+ ::memset(dst, 0, read_size);
----------------
do we really need to return the available "bytes" if the full read size can't be fullfiled? (ie. shouldn't that be a hard error instead?)
https://reviews.llvm.org/D54241
More information about the lldb-commits
mailing list