Skip to content

Commit 4f0a377

Browse files
committed
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
1 parent 881aab4 commit 4f0a377

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lldb/source/Plugins/Process/POSIX/NativeProcessELF.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ NativeProcessELF::ReadSVR4LibraryInfo(lldb::addr_t link_map_addr) {
120120
char name_buffer[PATH_MAX];
121121
error = ReadMemory(link_map.l_name, &name_buffer, sizeof(name_buffer),
122122
bytes_read);
123-
if (!error.Success())
123+
if (bytes_read == 0)
124124
return error.ToError();
125125
name_buffer[PATH_MAX - 1] = '\0';
126126

@@ -176,4 +176,4 @@ NativeProcessELF::GetLoadedSVR4Libraries() {
176176
return library_list;
177177
}
178178

179-
} // namespace lldb_private
179+
} // namespace lldb_private

0 commit comments

Comments
 (0)