Set the architecture from the remote executable when it's not set so the register info can be loaded properly (and thus the callstacks work)

llvm-svn: 192571
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 31b430c..ad06724 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -564,6 +564,11 @@
         GetThreadList();
         if (m_gdb_comm.SendPacketAndWaitForResponse("?", 1, m_last_stop_packet, false))
         {
+            if (!m_target.GetArchitecture().IsValid()) { // Make sure we have an architecture
+               m_target.SetArchitecture(m_gdb_comm.GetProcessArchitecture());
+            }
+
+
             const StateType state = SetThreadStopInfo (m_last_stop_packet);
             if (state == eStateStopped)
             {
@@ -762,6 +767,10 @@
 
             if (m_gdb_comm.SendPacketAndWaitForResponse("?", 1, m_last_stop_packet, false))
             {
+                if (!m_target.GetArchitecture().IsValid()) { // Make sure we have an architecture
+                   m_target.SetArchitecture(m_gdb_comm.GetProcessArchitecture());
+                }
+
                 SetPrivateState (SetThreadStopInfo (m_last_stop_packet));
                 
                 if (!disable_stdio)