summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/POSIX/NativeProcessELF.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-07-01 12:00:25 +0000
committerPavel Labath <pavel@labath.sk>2019-07-01 12:00:25 +0000
commit4f0a37728052d999a9bbac4cd5d81b1f264567cd (patch)
treedec51efdd16b0debe3d537ccd47c2b5092e94852 /lldb/source/Plugins/Process/POSIX/NativeProcessELF.cpp
parent881aab4dc3dfbf8109f55b67f0db86b3a36a9bc7 (diff)
downloadbcm5719-llvm-4f0a37728052d999a9bbac4cd5d81b1f264567cd.tar.gz
bcm5719-llvm-4f0a37728052d999a9bbac4cd5d81b1f264567cd.zip
Fix TestGdbRemoteLibrariesSvr4Support
D62502 had a bug (visible only with D62503 reverted), where it would error out if attempting to read a string from memory and the memory page after the string happened to be unmapped. This fixes the problem by checking for whether ReadMemory read *any* bytes, instead of checking whether it returned an error. A greater question is whether ReadMemory should even return an error if it read at least one byte, but I'm leaving that for a separate patch. llvm-svn: 364748
Diffstat (limited to 'lldb/source/Plugins/Process/POSIX/NativeProcessELF.cpp')
-rw-r--r--lldb/source/Plugins/Process/POSIX/NativeProcessELF.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/POSIX/NativeProcessELF.cpp b/lldb/source/Plugins/Process/POSIX/NativeProcessELF.cpp
index 3e08eccb9df..50b2d05df3e 100644
--- a/lldb/source/Plugins/Process/POSIX/NativeProcessELF.cpp
+++ b/lldb/source/Plugins/Process/POSIX/NativeProcessELF.cpp
@@ -120,7 +120,7 @@ NativeProcessELF::ReadSVR4LibraryInfo(lldb::addr_t link_map_addr) {
char name_buffer[PATH_MAX];
error = ReadMemory(link_map.l_name, &name_buffer, sizeof(name_buffer),
bytes_read);
- if (!error.Success())
+ if (bytes_read == 0)
return error.ToError();
name_buffer[PATH_MAX - 1] = '\0';
@@ -176,4 +176,4 @@ NativeProcessELF::GetLoadedSVR4Libraries() {
return library_list;
}
-} // namespace lldb_private \ No newline at end of file
+} // namespace lldb_private
OpenPOWER on IntegriCloud