OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2010 The Native Client Authors. All rights reserved. | 2 * Copyright 2010 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can |
4 * be found in the LICENSE file. | 4 * be found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #include <assert.h> | 7 #include <assert.h> |
8 #include <string.h> | 8 #include <string.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
232 if (SendOnly(&out)) { | 232 if (SendOnly(&out)) { |
233 // We are running again | 233 // We are running again |
234 status_ = HS_RUNNING; | 234 status_ = HS_RUNNING; |
235 return true; | 235 return true; |
236 } | 236 } |
237 | 237 |
238 return false; | 238 return false; |
239 } | 239 } |
240 | 240 |
241 // Wait to see if we receive a break | 241 // Wait to see if we receive a break |
242 bool Host::WaitForBreak() { | 242 bool Host::WaitForBreak() { |
noelallen_use_chromium
2010/12/07 23:04:44
Should we kill HS_STOPPING?
mlinck
2010/12/10 21:10:27
A break request results in the "stopping" state. T
| |
243 // We can not wait if we are not running | 243 // We can not wait if we are already stopped |
244 if (HS_RUNNING != status_) return false; | 244 if (HS_RUNNING != status_ |
245 && HS_STOPPING != status_) return false; | |
245 | 246 |
246 Packet rx; | 247 Packet rx; |
247 std::string str; | 248 std::string str; |
248 if (session_->GetPacket(&rx) == false) return false; | 249 if (session_->GetPacket(&rx) == false) return false; |
249 | 250 |
250 rx.GetString(&str); | 251 rx.GetString(&str); |
251 if (ParseStopPacket(str.data())) return Update(); | 252 if (ParseStopPacket(str.data())) return Update(); |
252 return false; | 253 return false; |
253 } | 254 } |
254 | 255 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
515 } | 516 } |
516 | 517 |
517 bool Host::Send(Packet *tx, Packet *rx) { | 518 bool Host::Send(Packet *tx, Packet *rx) { |
518 if (!session_->SendPacket(tx)) return false; | 519 if (!session_->SendPacket(tx)) return false; |
519 return session_->GetPacket(rx); | 520 return session_->GetPacket(rx); |
520 } | 521 } |
521 | 522 |
522 } // namespace gdb_rsp | 523 } // namespace gdb_rsp |
523 | 524 |
524 | 525 |
OLD | NEW |