Made lldb_private::ArchSpec contain much more than just an architecture. It
now, in addition to cpu type/subtype and architecture flavor, contains:
- byte order (big endian, little endian)
- address size in bytes
- llvm::Triple for true target triple support and for more powerful plug-in
selection.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125602 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index cee2d3d..cba0ca1 100644
--- a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -638,7 +638,7 @@
BuildDynamicRegisterInfo (false);
- m_byte_order = m_gdb_comm.GetByteOrder();
+ m_target.GetArchitecture().SetByteOrder (m_gdb_comm.GetByteOrder());
StreamString strm;
@@ -656,33 +656,16 @@
// defacto architecture in this case.
if (gdb_remote_arch == ArchSpec ("arm") &&
- vendor != NULL &&
- strcmp(vendor, "apple") == 0)
+ vendor && ::strcmp(vendor, "apple") == 0)
{
GetTarget().SetArchitecture (gdb_remote_arch);
target_arch = gdb_remote_arch;
}
- if (!target_arch.IsValid())
- target_arch = gdb_remote_arch;
-
- if (target_arch.IsValid())
- {
- if (vendor == NULL)
- vendor = Host::GetVendorString().AsCString("apple");
-
- if (os_type == NULL)
- os_type = Host::GetOSString().AsCString("darwin");
-
- strm.Printf ("%s-%s-%s", target_arch.AsCString(), vendor, os_type);
-
- std::transform (strm.GetString().begin(),
- strm.GetString().end(),
- strm.GetString().begin(),
- ::tolower);
-
- m_target_triple.SetCString(strm.GetString().c_str());
- }
+ if (vendor)
+ m_target.GetArchitecture().GetTriple().setVendorName(vendor);
+ if (os_type)
+ m_target.GetArchitecture().GetTriple().setOSName(os_type);
}
}
@@ -2557,7 +2540,10 @@
}
uint8_t memory_buffer[8];
- DataExtractor data(memory_buffer, sizeof(memory_buffer), GetByteOrder(), GetAddressByteSize());
+ DataExtractor data (memory_buffer,
+ sizeof(memory_buffer),
+ m_target.GetArchitecture().GetByteOrder(),
+ m_target.GetArchitecture().GetAddressByteSize());
// Excerpt from src/queue_private.h
struct dispatch_queue_offsets_s