summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote
diff options
context:
space:
mode:
authorNitesh Jain <nitesh.jain@imgtec.com>2016-10-12 10:21:09 +0000
committerNitesh Jain <nitesh.jain@imgtec.com>2016-10-12 10:21:09 +0000
commit8999edf2f69029246971265f4e0128e0a4d6d725 (patch)
tree83a572e99b810c43db6e633bff646bcb7a750daa /lldb/source/Plugins/Process/gdb-remote
parentfd0d7b21e0b974dcb8ee6257ae4ef4fa7398e80b (diff)
downloadbcm5719-llvm-8999edf2f69029246971265f4e0128e0a4d6d725.tar.gz
bcm5719-llvm-8999edf2f69029246971265f4e0128e0a4d6d725.zip
[LLDB][MIPS] Fix qProcessInfo to return correct pointer size based on ELF ABI
Reviewers: clayborg, labath Subscribers: jaydeep, bhushan, slthakur, lldb-commits Differential Revision: https://reviews.llvm.org/D25021 llvm-svn: 284001
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp5
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp13
2 files changed, 11 insertions, 7 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index a34dedf9102..1bca7ec4a6a 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -1849,6 +1849,7 @@ bool GDBRemoteCommunicationClient::GetCurrentProcessInfo(bool allow_lazy) {
std::string os_name;
std::string vendor_name;
std::string triple;
+ std::string elf_abi;
uint32_t pointer_byte_size = 0;
StringExtractor extractor;
ByteOrder byte_order = eByteOrderInvalid;
@@ -1885,6 +1886,9 @@ bool GDBRemoteCommunicationClient::GetCurrentProcessInfo(bool allow_lazy) {
} else if (name.equals("pid")) {
if (!value.getAsInteger(16, pid))
++num_keys_decoded;
+ } else if (name.equals("elf_abi")) {
+ elf_abi = value;
+ ++num_keys_decoded;
}
}
if (num_keys_decoded > 0)
@@ -1897,6 +1901,7 @@ bool GDBRemoteCommunicationClient::GetCurrentProcessInfo(bool allow_lazy) {
// Set the ArchSpec from the triple if we have it.
if (!triple.empty()) {
m_process_arch.SetTriple(triple.c_str());
+ m_process_arch.SetFlags(elf_abi);
if (pointer_byte_size) {
assert(pointer_byte_size == m_process_arch.GetAddressByteSize());
}
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
index 9dfb47d1a76..7c46c21261d 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
@@ -1262,13 +1262,12 @@ void GDBRemoteCommunicationServerCommon::
// Nothing.
break;
}
-
- if (proc_triple.isArch64Bit())
- response.PutCString("ptrsize:8;");
- else if (proc_triple.isArch32Bit())
- response.PutCString("ptrsize:4;");
- else if (proc_triple.isArch16Bit())
- response.PutCString("ptrsize:2;");
+ // In case of MIPS64, pointer size is depend on ELF ABI
+ // For N32 the pointer size is 4 and for N64 it is 8
+ std::string abi = proc_arch.GetTargetABI();
+ if (!abi.empty())
+ response.Printf("elf_abi:%s;", abi.c_str());
+ response.Printf("ptrsize:%d;", proc_arch.GetAddressByteSize());
}
}
OpenPOWER on IntegriCloud