[PATCH] D16004: Increase use of svr4 packets to improve performance on POSIX remotes

Tamas Berghammer via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 07:25:14 PST 2016


tberghammer added inline comments.

================
Comment at: source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp:198
@@ -193,1 +197,3 @@
 bool
+DYLDRendezvous::UpdateSOEntriesFromRemote()
+{
----------------
This function have a lot of common code with UpdateSUEntries(). It would be good to merge the 2 in some way especially if we consider that they have some platform specific hacks inside what we don't want to diverge between the 2 implementation. 

================
Comment at: source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp:262-268
@@ +261,9 @@
+
+    // On Android L (5.0, 5.1) the load address of the "/system/bin/linker" isn't filled in
+    // correctly. To get the correct load address we fetch the load address of the file from the
+    // proc file system.
+    const ArchSpec &arch = m_process->GetTarget().GetArchitecture();
+    if (arch.GetTriple().getEnvironment() == llvm::Triple::Android && entry.base_addr == 0 &&
+        (name == "/system/bin/linker" || name == "/system/bin/linker64"))
+    {
+        addr_t load_addr = LLDB_INVALID_ADDRESS;
----------------
Please use the isLoadBiasIncorrect function instead

================
Comment at: source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp:262-274
@@ +261,15 @@
+
+    // On Android L (5.0, 5.1) the load address of the "/system/bin/linker" isn't filled in
+    // correctly. To get the correct load address we fetch the load address of the file from the
+    // proc file system.
+    const ArchSpec &arch = m_process->GetTarget().GetArchitecture();
+    if (arch.GetTriple().getEnvironment() == llvm::Triple::Android && entry.base_addr == 0 &&
+        (name == "/system/bin/linker" || name == "/system/bin/linker64"))
+    {
+        addr_t load_addr = LLDB_INVALID_ADDRESS;
+        bool is_loaded = false;
+        Error error = m_process->GetFileLoadAddress(entry.file_spec, is_loaded, load_addr);
+        if (error.Success() && is_loaded)
+            entry.base_addr = load_addr;
+    }
+
----------------
tberghammer wrote:
> Please use the isLoadBiasIncorrect function instead
Please move this into a new function and also use the new function from ReadSOEntryFromMemory. We don't want to duplicate these hacks.


http://reviews.llvm.org/D16004





More information about the llvm-commits mailing list