diff options
author | Tamas Berghammer <tberghammer@google.com> | 2015-03-13 11:16:08 +0000 |
---|---|---|
committer | Tamas Berghammer <tberghammer@google.com> | 2015-03-13 11:16:08 +0000 |
commit | dad4db713de4e2d7e783cde6fc3191624c7bac29 (patch) | |
tree | 7ea263fe3ec08502ba1301058b0836a4aa7aee64 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp | |
parent | 0cbf0b13e74a1334cd318517789f4c692faf524a (diff) | |
download | bcm5719-llvm-dad4db713de4e2d7e783cde6fc3191624c7bac29.tar.gz bcm5719-llvm-dad4db713de4e2d7e783cde6fc3191624c7bac29.zip |
Add filepath to qModuleInfo packet
The file path is currently required on android because the executables
only contain the name of the system libraries without their path. This
CL add an extra field to the qModuleInfo packet to return the full path
of a modul and add logic to locate a shared module on android.
Differential revision: http://reviews.llvm.org/D8221
llvm-svn: 232156
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp index 0a2385f6f2c..31202fca2bf 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp @@ -39,6 +39,10 @@ #include "ProcessGDBRemoteLog.h" #include "Utility/StringExtractorGDBRemote.h" +#ifdef __ANDROID__ +#include "lldb/Host/android/HostInfoAndroid.h" +#endif + using namespace lldb; using namespace lldb_private; @@ -1131,14 +1135,21 @@ GDBRemoteCommunicationServerCommon::Handle_qModuleInfo (StringExtractorGDBRemote packet.GetHexByteStringTerminatedBy(module_path, ';'); if (module_path.empty()) return SendErrorResponse (1); - const FileSpec module_path_spec(module_path.c_str(), true); if (packet.GetChar() != ';') return SendErrorResponse (2); std::string triple; packet.GetHexByteString(triple); - const ModuleSpec module_spec(module_path_spec, ArchSpec(triple.c_str())); + ArchSpec arch(triple.c_str()); + +#ifdef __ANDROID__ + const FileSpec module_path_spec = HostInfoAndroid::ResolveLibraryPath(module_path, arch); +#else + const FileSpec module_path_spec(module_path.c_str(), true); +#endif + + const ModuleSpec module_spec(module_path_spec, arch); ModuleSpecList module_specs; if (!ObjectFile::GetModuleSpecifications(module_path_spec, 0, 0, module_specs)) @@ -1173,6 +1184,9 @@ GDBRemoteCommunicationServerCommon::Handle_qModuleInfo (StringExtractorGDBRemote response.PutCStringAsRawHex8( module_arch.GetTriple().getTriple().c_str()); response.PutChar(';'); + response.PutCString("file_path:"); + response.PutCStringAsRawHex8(module_path_spec.GetPath().c_str()); + response.PutChar(';'); response.PutCString("file_offset:"); response.PutHex64(file_offset); response.PutChar(';'); |