summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process
diff options
context:
space:
mode:
authorTodd Fiala <tfiala@google.com>2014-01-18 03:02:39 +0000
committerTodd Fiala <tfiala@google.com>2014-01-18 03:02:39 +0000
commita9ddb0e14fa6ef559efb36654e1cc9e3c9e6c0d9 (patch)
treeee6e54765addf9701ad9f49a6799d037b178eaa7 /lldb/source/Plugins/Process
parented91da719e53e2dd6d665347188e541b45931672 (diff)
downloadbcm5719-llvm-a9ddb0e14fa6ef559efb36654e1cc9e3c9e6c0d9.tar.gz
bcm5719-llvm-a9ddb0e14fa6ef559efb36654e1cc9e3c9e6c0d9.zip
Added distribution info to ArchSpec and qHostInfo message.
ArchSpec now contains an optional distribution_id, with getters and setters. Host::GetArchitecture () sets it on non-Apple platforms using Host::GetDistributionId (). The distribution_id is ignored during ArchSpec comparisons. The gdb remote qHostInfo message transmits it, if set, via the distribution_id={id-value} key/value pair. Updated gdb remote docs to reflect this change. As before, GetDistributionId () returns nothing on non-Linux platforms at this time. On Linux, it is returned only if the lsb_platform command is installed (in /bin or /usr/bin), and only if the distributor id key is returned by 'lsb_platform -i'. This id is lowercased, and whitespace is replaced with underscores. llvm-svn: 199539
Diffstat (limited to 'lldb/source/Plugins/Process')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp12
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp8
2 files changed, 19 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index df313572d60..aae3aaafa33 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -1254,6 +1254,7 @@ GDBRemoteCommunicationClient::GetHostInfo (bool force)
std::string os_name;
std::string vendor_name;
std::string triple;
+ std::string distribution_id;
uint32_t pointer_byte_size = 0;
StringExtractor extractor;
ByteOrder byte_order = eByteOrderInvalid;
@@ -1287,6 +1288,13 @@ GDBRemoteCommunicationClient::GetHostInfo (bool force)
extractor.GetHexByteString (triple);
++num_keys_decoded;
}
+ else if (name.compare ("distribution_id") == 0)
+ {
+ extractor.GetStringRef ().swap (value);
+ extractor.SetFilePos (0);
+ extractor.GetHexByteString (distribution_id);
+ ++num_keys_decoded;
+ }
else if (name.compare("os_build") == 0)
{
extractor.GetStringRef().swap(value);
@@ -1461,7 +1469,9 @@ GDBRemoteCommunicationClient::GetHostInfo (bool force)
{
assert (byte_order == m_host_arch.GetByteOrder());
}
- }
+ }
+ if (!distribution_id.empty ())
+ m_host_arch.SetDistributionId (distribution_id.c_str ());
}
}
}
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
index 9579e7cc2a5..bed8852b7a0 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
@@ -313,6 +313,14 @@ GDBRemoteCommunicationServer::Handle_qHostInfo (StringExtractorGDBRemote &packet
response.PutCStringAsRawHex8(host_triple.getTriple().c_str());
response.Printf (";ptrsize:%u;",host_arch.GetAddressByteSize());
+ const char* distribution_id = host_arch.GetDistributionId ().AsCString ();
+ if (distribution_id)
+ {
+ response.PutCString("distribution_id:");
+ response.PutCStringAsRawHex8(distribution_id);
+ response.PutCString(";");
+ }
+
uint32_t cpu = host_arch.GetMachOCPUType();
uint32_t sub = host_arch.GetMachOCPUSubType();
if (cpu != LLDB_INVALID_CPUTYPE)
OpenPOWER on IntegriCloud