<rdar://problem/12723044> For 'process plugin packet send…', we just send it async...
authorHan Ming Ong <hanming@apple.com>
Mon, 26 Nov 2012 20:42:03 +0000 (20:42 +0000)
committerHan Ming Ong <hanming@apple.com>
Mon, 26 Nov 2012 20:42:03 +0000 (20:42 +0000)
There is no good reason not to use async.

llvm-svn: 168606

lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

index 30c17c9..e538254 100644 (file)
@@ -3150,33 +3150,21 @@ public:
         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;
     }