Author: jmolenda
Date: Mon Jan 27 16:23:20 2014
New Revision: 200253

URL: http://llvm.org/viewvc/llvm-project?rev=200253&view=rev
Log:
Change DecodeProcessInfoResponse to set the ProcessInfo's architecture 
if the remote stub provided enough information to identify it in the
qProcessInfo packet response.  (e.g. for an Apple device where we know 
it is Mach-O, the cpu type & cpu sub type).
<rdar://problem/15847901> 

Modified:
    
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=200253&r1=200252&r2=200253&view=diff
==============================================================================
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
Mon Jan 27 16:23:20 2014
@@ -2054,6 +2054,11 @@ GDBRemoteCommunicationClient::DecodeProc
         std::string name;
         std::string value;
         StringExtractor extractor;
+
+        uint32_t cpu = LLDB_INVALID_CPUTYPE;
+        uint32_t sub = 0;
+        std::string vendor;
+        std::string os_type;
         
         while (response.GetNameColonValue(name, value))
         {
@@ -2099,6 +2104,32 @@ GDBRemoteCommunicationClient::DecodeProc
                 extractor.GetHexByteString (value);
                 process_info.GetExecutableFile().SetFile (value.c_str(), 
false);
             }
+            else if (name.compare("cputype") == 0)
+            {
+                cpu = Args::StringToUInt32 (value.c_str(), 
LLDB_INVALID_CPUTYPE, 16);
+            }
+            else if (name.compare("cpusubtype") == 0)
+            {
+                sub = Args::StringToUInt32 (value.c_str(), 0, 16);
+            }
+            else if (name.compare("vendor") == 0)
+            {
+                vendor = value;
+            }
+            else if (name.compare("ostype") == 0)
+            {
+                os_type = value;
+            }
+        }
+
+        if (cpu != LLDB_INVALID_CPUTYPE && !vendor.empty() && !os_type.empty())
+        {
+            if (vendor == "apple")
+            {
+                process_info.GetArchitecture().SetArchitecture 
(eArchTypeMachO, cpu, sub);
+                process_info.GetArchitecture().GetTriple().setVendorName 
(llvm::StringRef (vendor));
+                process_info.GetArchitecture().GetTriple().setOSName 
(llvm::StringRef (os_type));
+            }
         }
         
         if (process_info.GetProcessID() != LLDB_INVALID_PROCESS_ID)


_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to