jaydeep created this revision.
jaydeep added a reviewer: clayborg.
jaydeep added subscribers: lldb-commits, bhushan, sagar, mohit.bhakkad, 
nitesh.jain.
jaydeep set the repository for this revision to rL LLVM.

Refer to <http://lists.llvm.org/pipermail/lldb-dev/2015-August/008024.html> for 
discussion on this topic.

Bare-iron target like YAMON gdb-stub does not support qProcessInfo, qC, 
qfThreadInfo, Hg and Hc packets. Reply from ‘?’ packet is as simple as ‘S05’. 
There is no packet which gives us process or threads information. In such 
cases, assume pid=tid=1.



Repository:
  rL LLVM

http://reviews.llvm.org/D12876

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

Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===================================================================
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -3396,6 +3396,17 @@
             m_curr_tid = tid;
             return true;
         }
+
+        /*
+         * Connected bare-iron target (like YAMON gdb-stub) may not have 
support for Hg packet.
+         * The reply from '?' packet could be as simple as 'S05'. There is no 
packet which can
+         * give us pid and/or tid. Assume pid=tid=1 in such cases.
+        */
+        if (!response.IsNormalResponse() && IsConnected())
+        {
+            m_curr_tid = 1;
+            return true;
+        }
     }
     return false;
 }
@@ -3422,6 +3433,17 @@
             m_curr_tid_run = tid;
             return true;
         }
+
+        /*
+         * Connected bare-iron target (like YAMON gdb-stub) may not have 
support for Hc packet.
+         * The reply from '?' packet could be as simple as 'S05'. There is no 
packet which can
+         * give us pid and/or tid. Assume pid=tid=1 in such cases.
+        */
+        if (!response.IsNormalResponse() && IsConnected())
+        {
+            m_curr_tid_run = 1;
+            return true;
+        }
     }
     return false;
 }
@@ -3547,6 +3569,17 @@
                 } while (ch == ',');            // Make sure we got a comma 
separator
             }
         }
+
+        /*
+         * Connected bare-iron target (like YAMON gdb-stub) may not have 
support for
+         * qProcessInfo, qC and qfThreadInfo packets. The reply from '?' 
packet could
+         * be as simple as 'S05'. There is no packet which can give us pid 
and/or tid.
+         * Assume pid=tid=1 in such cases.
+        */
+        if (!response.IsNormalResponse() && thread_ids.size() == 0 && 
IsConnected())
+        {
+            thread_ids.push_back (1);
+        }
     }
     else
     {


Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===================================================================
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -3396,6 +3396,17 @@
             m_curr_tid = tid;
             return true;
         }
+
+        /*
+         * Connected bare-iron target (like YAMON gdb-stub) may not have support for Hg packet.
+         * The reply from '?' packet could be as simple as 'S05'. There is no packet which can
+         * give us pid and/or tid. Assume pid=tid=1 in such cases.
+        */
+        if (!response.IsNormalResponse() && IsConnected())
+        {
+            m_curr_tid = 1;
+            return true;
+        }
     }
     return false;
 }
@@ -3422,6 +3433,17 @@
             m_curr_tid_run = tid;
             return true;
         }
+
+        /*
+         * Connected bare-iron target (like YAMON gdb-stub) may not have support for Hc packet.
+         * The reply from '?' packet could be as simple as 'S05'. There is no packet which can
+         * give us pid and/or tid. Assume pid=tid=1 in such cases.
+        */
+        if (!response.IsNormalResponse() && IsConnected())
+        {
+            m_curr_tid_run = 1;
+            return true;
+        }
     }
     return false;
 }
@@ -3547,6 +3569,17 @@
                 } while (ch == ',');            // Make sure we got a comma separator
             }
         }
+
+        /*
+         * Connected bare-iron target (like YAMON gdb-stub) may not have support for
+         * qProcessInfo, qC and qfThreadInfo packets. The reply from '?' packet could
+         * be as simple as 'S05'. There is no packet which can give us pid and/or tid.
+         * Assume pid=tid=1 in such cases.
+        */
+        if (!response.IsNormalResponse() && thread_ids.size() == 0 && IsConnected())
+        {
+            thread_ids.push_back (1);
+        }
     }
     else
     {
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to