[Lldb-commits] [PATCH] D11519: [MIPS] Use qfThreadID if qC packet is not supported by target

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 11 09:52:06 PDT 2015


clayborg added a comment.

Lets just not send the OS then since it is very unreliable when the target if first attaching or launching and just always back up to using qfThreadID if first qProcessInfo and then qC are not implemented. We need some way to get the pid, so lets just do it.


================
Comment at: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp:1101
@@ -1100,3 +1100,3 @@
                             {
-                                lldb::pid_t pid = GetCurrentProcessID ();
+                                lldb::pid_t pid = GetCurrentProcessID (true, process->GetTarget().GetArchitecture().GetTriple().getOS());
                                 if (pid != LLDB_INVALID_PROCESS_ID)
----------------
Revert this and don't send the OS, see main comment below.

================
Comment at: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp:1428
@@ -1427,3 +1427,3 @@
 lldb::pid_t
-GDBRemoteCommunicationClient::GetCurrentProcessID (bool allow_lazy)
+GDBRemoteCommunicationClient::GetCurrentProcessID (bool allow_lazy, llvm::Triple::OSType ostype)
 {
----------------
Revert this and don't send the OS, see main comment below.

================
Comment at: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp:1464
@@ +1463,3 @@
+        // If we don't get a response for $qC, check if $qfThreadID gives us a result.
+        if (m_curr_pid == LLDB_INVALID_PROCESS_ID && ostype == llvm::Triple::UnknownOS)
+        {
----------------
remove the ostype check, see main comment below.

================
Comment at: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h:112
@@ -111,3 +111,3 @@
     lldb::pid_t
-    GetCurrentProcessID (bool allow_lazy = true);
+    GetCurrentProcessID (bool allow_lazy = true, llvm::Triple::OSType ostype = llvm::Triple::OSType::UnknownOS);
 
----------------
Revert this and don't send the OS, see main comment below.

================
Comment at: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:761-762
@@ -760,3 +760,4 @@
 
-    lldb::pid_t pid = m_gdb_comm.GetCurrentProcessID ();
+    const ArchSpec &target_arch = GetTarget().GetArchitecture();
+    lldb::pid_t pid = m_gdb_comm.GetCurrentProcessID (true, target_arch.GetTriple().getOS());
     if (pid == LLDB_INVALID_PROCESS_ID)
----------------
Revert this and don't send the OS, see main comment below.

================
Comment at: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:1016-1017
@@ -1014,3 +1015,4 @@
                     {
-                        SetID (m_gdb_comm.GetCurrentProcessID ());
+                        const ArchSpec &target_arch = GetTarget().GetArchitecture();
+                        SetID (m_gdb_comm.GetCurrentProcessID (true, target_arch.GetTriple().getOS()));
                     }
----------------
Revert this and don't send the OS, see main comment below.

================
Comment at: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:2323-2324
@@ -2320,3 +2322,4 @@
                 {
-                    lldb::pid_t pid = m_gdb_comm.GetCurrentProcessID ();
+                    const ArchSpec &target_arch = GetTarget().GetArchitecture();
+                    lldb::pid_t pid = m_gdb_comm.GetCurrentProcessID (true, target_arch.GetTriple().getOS());
                     if (pid != LLDB_INVALID_PROCESS_ID)
----------------
Revert this and don't send the OS, see main comment below.


Repository:
  rL LLVM

http://reviews.llvm.org/D11519





More information about the lldb-commits mailing list