summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2018-10-23 23:45:56 +0000
committerJason Molenda <jmolenda@apple.com>2018-10-23 23:45:56 +0000
commitdf9f796fbb91fd9c16fab8eb6535f0f5b937e452 (patch)
tree444dee36bfb35451aaa0844298afd178914e5813 /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
parent5fa1e35bcc99dbdeee4e966e21670f9d537c79f7 (diff)
downloadbcm5719-llvm-df9f796fbb91fd9c16fab8eb6535f0f5b937e452.tar.gz
bcm5719-llvm-df9f796fbb91fd9c16fab8eb6535f0f5b937e452.zip
Support nwere versions of the Segger J-Link jtag board software.
Add support in ProcessGDBRemote::GetGDBServerRegisterInfo for recognizing a generic "arm" architecture that will be used if nothing better is available so that we don't ignore the register definitions if we didn't already have an architecture set. Also in ProcessGDBRemote::DoConnectRemote don't set the target arch unless we have a valid architecture to set it to. Platform::ConnectProcess will try to get the current target's architecture, or the default architecture, when creating the target for the connection to be attempted. If lldb was started with a target binary, we want to create this target with that architecture in case the remote gdb stub doesn't supply a qHostInfo arch. Add logging to Target::MergeArchitecture. <rdar://problem/34916465> llvm-svn: 345106
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index d367b23ce19..05f269a416b 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -688,7 +688,9 @@ Status ProcessGDBRemote::DoConnectRemote(Stream *strm,
if (m_gdb_comm.GetProcessArchitecture().IsValid()) {
target.SetArchitecture(m_gdb_comm.GetProcessArchitecture());
} else {
- target.SetArchitecture(m_gdb_comm.GetHostArchitecture());
+ if (m_gdb_comm.GetHostArchitecture().IsValid()) {
+ target.SetArchitecture(m_gdb_comm.GetHostArchitecture());
+ }
}
}
@@ -4508,12 +4510,19 @@ bool ProcessGDBRemote::GetGDBServerRegisterInfo(ArchSpec &arch_to_use) {
// <architecture>arm</architecture> (seen from Segger JLink on unspecified arm board)
// use that if we don't have anything better.
if (!arch_to_use.IsValid() && !target_info.arch.empty()) {
- if (target_info.arch == "i386:x86-64")
- {
+ if (target_info.arch == "i386:x86-64") {
// We don't have any information about vendor or OS.
arch_to_use.SetTriple("x86_64--");
GetTarget().MergeArchitecture(arch_to_use);
}
+
+ // SEGGER J-Link jtag boards send this very-generic arch name,
+ // we'll need to use this if we have absolutely nothing better
+ // to work with or the register definitions won't be accepted.
+ if (target_info.arch == "arm") {
+ arch_to_use.SetTriple("arm--");
+ GetTarget().MergeArchitecture(arch_to_use);
+ }
}
// Initialize these outside of ParseRegisters, since they should not be
OpenPOWER on IntegriCloud