[Lldb-commits] [PATCH] Fix fetching the architecture of the target on process launch

Tamas Berghammer tberghammer at google.com
Wed Mar 4 06:17:21 PST 2015


Hi vharron, clayborg,

Fix fetching the architecture of the target on process launch

Previously it was fetched only if the architecture isn't valid, but the architecture can be valid without containing all information about the current target (e.g. missing os).

http://reviews.llvm.org/D8057

Files:
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===================================================================
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -939,11 +939,15 @@
 
             if (m_gdb_comm.SendPacketAndWaitForResponse("?", 1, m_last_stop_packet, false) == GDBRemoteCommunication::PacketResult::Success)
             {
-                if (!m_target.GetArchitecture().IsValid()) 
+                if (m_gdb_comm.GetProcessArchitecture().IsValid())
+                {
+                    m_target.SetArchitecture(m_gdb_comm.GetProcessArchitecture());
+                }
+                else
                 {
-                    if (m_gdb_comm.GetProcessArchitecture().IsValid())
+                    if (m_target.GetArchitecture().IsValid())
                     {
-                        m_target.SetArchitecture(m_gdb_comm.GetProcessArchitecture());
+                        m_target.GetArchitecture().MergeFrom(m_gdb_comm.GetHostArchitecture());
                     }
                     else
                     {

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8057.21195.patch
Type: text/x-patch
Size: 1136 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150304/b0476065/attachment.bin>


More information about the lldb-commits mailing list