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
diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp
index 07f1e47..6c005fe 100644
--- a/lldb/source/Target/Platform.cpp
+++ b/lldb/source/Target/Platform.cpp
@@ -1820,9 +1820,19 @@
error.Clear();
if (!target) {
+ ArchSpec arch;
+ if (target && target->GetArchitecture().IsValid())
+ arch = target->GetArchitecture();
+ else
+ arch = Target::GetDefaultArchitecture();
+
+ const char *triple = "";
+ if (arch.IsValid())
+ triple = arch.GetTriple().getTriple().c_str();
+
TargetSP new_target_sp;
error = debugger.GetTargetList().CreateTarget(
- debugger, "", "", eLoadDependentsNo, nullptr, new_target_sp);
+ debugger, "", triple, eLoadDependentsNo, nullptr, new_target_sp);
target = new_target_sp.get();
}