<rdar://problem/14972424>

- Made the dynamic register context for the GDB remote plug-in inherit from the generic DynamicRegisterInfo to avoid code duplication
- Finished up the target definition python setting stuff.
- Added a new "slice" key/value pair that can specify that a register is part of another register:
    { 'name':'eax', 'set':0, 'bitsize':32, 'encoding':eEncodingUint, 'format':eFormatHex, 'slice': 'rax[31:0]' },
- Added a new "composite" key/value pair that can specify that a register is made up of two or more registers:
    { 'name':'d0', 'set':0, 'bitsize':64 , 'encoding':eEncodingIEEE754, 'format':eFormatFloat, 'composite': ['s1', 's0'] },
- Added a new "invalidate-regs" key/value pair for when a register is modified, it can invalidate other registers:
    { 'name':'cpsr', 'set':0, 'bitsize':32 , 'encoding':eEncodingUint, 'format':eFormatHex, 'invalidate-regs': ['r8', 'r9', 'r10', 'r11', 'r12', 'r13', 'r14', 'r15']},
    
This now completes the feature that allows a GDB remote target to completely describe itself.

llvm-svn: 192858
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index e44d7a3..1b8791c 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -334,7 +334,18 @@
 
         if (target_dict)
         {
-            if (m_register_info.SetRegisterInfo (target_dict) > 0)
+            PythonDictionary host_info_dict (target_dict.GetItemForKey("host-info"));
+            if (host_info_dict)
+            {
+                ArchSpec host_arch (host_info_dict.GetItemForKeyAsString(PythonString("triple")));
+                
+                if (!host_arch.IsCompatibleMatch(GetTarget().GetArchitecture()))
+                {
+                    GetTarget().SetArchitecture(host_arch);
+                }
+                    
+            }
+            if (m_register_info.SetRegisterInfo (target_dict, GetTarget().GetArchitecture().GetByteOrder()) > 0)
             {
                 return true;
             }
@@ -522,12 +533,12 @@
     if (reg_num == 0)
     {
         FileSpec target_definition_fspec = GetGlobalPluginProperties()->GetTargetDefinitionFile ();
-
-        // See if we can get register definitions from a python file
-        if (ParsePythonTargetDefinition (target_definition_fspec))
+        
+        if (target_definition_fspec)
         {
-            m_register_info.Finalize ();
-            return;
+            // See if we can get register definitions from a python file
+            if (ParsePythonTargetDefinition (target_definition_fspec))
+                return;
         }
     }