Fix missing NEON registers for the 'register read' command with the lldb debugserver which supports the 'qRegisterInfo' packet
that dynamically discovers remote register context information.

o GDBRemoteRegisterContext.h:

Change the prototype of HardcodeARMRegisters() to take a boolean flag, which now becomes

    void
    HardcodeARMRegisters(bool from_scratch);

o GDBRemoteRegisterContext.cpp:

HardcodeARMRegisters() now checks the from_scratch flag and decides whether to add composite registers to the already
existing primordial registers based on a table called g_composites which describes the composite registers.

o ProcessGDBRemote.cpp:

Modify the logic of ProcessGDBRemote::BuildDynamicRegisterInfo() to call m_register_info.HardcodeARMRegisters()
with the newly introduced 'bool from_scrach' flag.

rdar://problem/10652076


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@156773 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 0cad836..91a3af7 100644
--- a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -378,25 +378,28 @@
         }
     }
 
-    if (reg_num == 0)
+    // We didn't get anything if the accumulated reg_num is zero.  See if we are
+    // debugging ARM and fill with a hard coded register set until we can get an
+    // updated debugserver down on the devices.
+    // On the other hand, if the accumulated reg_num is positive, see if we can
+    // add composite registers to the existing primordial ones.
+    bool from_scratch = (reg_num == 0);
+
+    const ArchSpec &target_arch = GetTarget().GetArchitecture();
+    const ArchSpec &remote_arch = m_gdb_comm.GetHostArchitecture();
+    if (!target_arch.IsValid())
     {
-        // We didn't get anything. See if we are debugging ARM and fill with
-        // a hard coded register set until we can get an updated debugserver
-        // down on the devices.
-        const ArchSpec &target_arch = GetTarget().GetArchitecture();
-        const ArchSpec &remote_arch = m_gdb_comm.GetHostArchitecture();
-        if (!target_arch.IsValid())
-        {
-            if (remote_arch.IsValid()
-                && remote_arch.GetMachine() == llvm::Triple::arm
-                && remote_arch.GetTriple().getVendor() == llvm::Triple::Apple)
-                m_register_info.HardcodeARMRegisters();
-        }
-        else if (target_arch.GetMachine() == llvm::Triple::arm)
-        {
-            m_register_info.HardcodeARMRegisters();
-        }
+        if (remote_arch.IsValid()
+              && remote_arch.GetMachine() == llvm::Triple::arm
+              && remote_arch.GetTriple().getVendor() == llvm::Triple::Apple)
+            m_register_info.HardcodeARMRegisters(from_scratch);
     }
+    else if (target_arch.GetMachine() == llvm::Triple::arm)
+    {
+        m_register_info.HardcodeARMRegisters(from_scratch);
+    }
+
+    // At this point, we can finalize our register info.
     m_register_info.Finalize ();
 }