summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHan Ming Ong <hanming@apple.com>2012-11-26 20:42:03 +0000
committerHan Ming Ong <hanming@apple.com>2012-11-26 20:42:03 +0000
commit84145857b4b3df87f801f5ff7762dcec7ecd2525 (patch)
treefc554672b43d3a9586fe0b629505acac71c8479d
parentefe2393113223b342478022c23a269e7c420bf5c (diff)
downloadbcm5719-llvm-84145857b4b3df87f801f5ff7762dcec7ecd2525.tar.gz
bcm5719-llvm-84145857b4b3df87f801f5ff7762dcec7ecd2525.zip
<rdar://problem/12723044> For 'process plugin packet send…', we just send it async by default
There is no good reason not to use async. llvm-svn: 168606
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp38
1 files changed, 13 insertions, 25 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 30c17c9e98a..e538254739d 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -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;
}
OpenPOWER on IntegriCloud