[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
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
index 9dfb47d..7c46c21 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
@@ -1262,13 +1262,12 @@
// 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());
}
}