[Lldb-commits] [lldb] r168606 - /lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Han Ming Ong hanming at apple.com
Mon Nov 26 12:42:03 PST 2012


Author: hanming
Date: Mon Nov 26 14:42:03 2012
New Revision: 168606

URL: http://llvm.org/viewvc/llvm-project?rev=168606&view=rev
Log:
<rdar://problem/12723044> For 'process plugin packet send…', we just send it async by default

There is no good reason not to use async.

Modified:
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=168606&r1=168605&r2=168606&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Mon Nov 26 14:42:03 2012
@@ -3150,33 +3150,21 @@
         ProcessGDBRemote *process = (ProcessGDBRemote *)m_interpreter.GetExecutionContext().GetProcessPtr();
         if (process)
         {
-            const StateType state = process->GetState();
-
-            if (StateIsStoppedState (state, true))
-            {
-                for (size_t i=0; i<argc; ++ i)
-                {
-                    const char *packet_cstr = command.GetArgumentAtIndex(0);
-                    bool send_async = false;
-                    StringExtractorGDBRemote response;
-                    process->GetGDBRemote().SendPacketAndWaitForResponse(packet_cstr, response, send_async);
-                    result.SetStatus (eReturnStatusSuccessFinishResult);
-                    Stream &output_strm = result.GetOutputStream();
-                    output_strm.Printf ("  packet: %s\n", packet_cstr);
-                    const std::string &response_str = response.GetStringRef();
-                    if (response_str.empty())
-                        output_strm.PutCString ("response: \nerror: UNIMPLEMENTED\n");
-                    else
-                        output_strm.Printf ("response: %s\n", response.GetStringRef().c_str());
-                }
-            }
-            else
+            for (size_t i=0; i<argc; ++ i)
             {
-                result.AppendErrorWithFormat ("process must be stopped in order to send GDB remote packets, state is %s", StateAsCString (state));
-                result.SetStatus (eReturnStatusFailed);
-                return false;
+                const char *packet_cstr = command.GetArgumentAtIndex(0);
+                bool send_async = true;
+                StringExtractorGDBRemote response;
+                process->GetGDBRemote().SendPacketAndWaitForResponse(packet_cstr, response, send_async);
+                result.SetStatus (eReturnStatusSuccessFinishResult);
+                Stream &output_strm = result.GetOutputStream();
+                output_strm.Printf ("  packet: %s\n", packet_cstr);
+                const std::string &response_str = response.GetStringRef();
+                if (response_str.empty())
+                    output_strm.PutCString ("response: \nerror: UNIMPLEMENTED\n");
+                else
+                    output_strm.Printf ("response: %s\n", response.GetStringRef().c_str());
             }
-
         }
         return true;
     }





More information about the lldb-commits mailing list