gdb-remote: Add jModulesInfo packet
authorPavel Labath <labath@google.com>
Thu, 8 Sep 2016 10:07:04 +0000 (10:07 +0000)
committerPavel Labath <labath@google.com>
Thu, 8 Sep 2016 10:07:04 +0000 (10:07 +0000)
commit2f1fbaebe25a4637cf75ec9ab1877c64584ede24
treecca4e3ae0fd9afec5fbeeccd59b2b964262b3b88
parent2b7ed1339cea63180bc3203ac57b4c5b12219589
gdb-remote: Add jModulesInfo packet

Summary:
This adds the jModulesInfo packet, which is the equivalent of qModulesInfo, but it enables us to
query multiple modules at once. This makes a significant speed improvement in case the
application has many (over a hundred) modules, and the communication link has a non-negligible
latency. This functionality is accessed by ProcessGdbRemote::PrefetchModuleSpecs(), which does
the caching. GetModuleSpecs() is modified to first consult the cache before asking the remote
stub. PrefetchModuleSpecs is currently only called from POSIX-DYLD dynamic loader plugin, after
it reads the list of modules from the inferior memory, but other uses are possible.

This decreases the attach time to an android application by about 40%.

Reviewers: clayborg

Subscribers: tberghammer, lldb-commits, danalbert

Differential Revision: https://reviews.llvm.org/D24236

llvm-svn: 280919
13 files changed:
lldb/docs/lldb-gdb-remote.txt
lldb/include/lldb/Target/Process.h
lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteModuleInfo.py [new file with mode: 0644]
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
lldb/source/Utility/StringExtractorGDBRemote.cpp
lldb/source/Utility/StringExtractorGDBRemote.h
lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp