Chromium Code Reviews| 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 | 7 |
| 8 // This module provides interfaces for writing to and reading from a | 8 // This module provides interfaces for writing to and reading from a |
| 9 // GDB RSP connection. The connection uses a generic transport | 9 // GDB RSP connection. The connection uses a generic transport |
| 10 // object for sending packets from one endpoint to another. The session | 10 // object for sending packets from one endpoint to another. The session |
| 11 // is responsible to delievery including generation of checksums and | 11 // is responsible to delievery including generation of checksums and |
| 12 // retransmits and handling timeouts as needed. See: | 12 // retransmits and handling timeouts as needed. See: |
| 13 // http:// ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_node/gdb_129.html#SEC134 | 13 // http:// ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_node/gdb_129.html#SEC134 |
| 14 // | 14 // |
| 15 // All data is read one character at a time through 'GetChar' which will | 15 // All data is read one character at a time through 'GetChar' which will |
| 16 // poll on DataAvail and timeout after one second, allowing the session | 16 // poll on DataAvail and timeout after one second, allowing the session |
| 17 // to handle blocking transports. | 17 // to handle blocking transports. |
| 18 // | 18 // |
| 19 // The session object is not reentrant, and will have unpredictable | 19 // The session object is not reentrant, and will have unpredictable |
| 20 // results if two threads attempt to read from the session at the same | 20 // results if two threads attempt to read from the session at the same |
| 21 // time. | 21 // time. |
| 22 // | 22 // |
| 23 // This module may throw a std::bad_alloc if there is an error while trying | 23 // This module may throw a std::bad_alloc if there is an error while trying |
| 24 // to resize the packet. In addition, the underlying ITransport is free | 24 // to resize the packet. In addition, the underlying ITransport is free |
| 25 // to throw an exception if the connection is lost, which will pass out | 25 // to throw an exception if the connection is lost, which will pass out |
| 26 // of any packet send or receive function. | 26 // of any packet send or receive function. |
| 27 #ifndef NATIVE_CLIENT_GDB_RSP_SESSION_H_ | 27 #ifndef SRC_TRUSTED_GDB_RSP_SESSION_H_ |
|
noelallen_use_chromium
2010/12/07 23:04:44
NATIVE_CLIENT_...
mlinck
2010/12/10 21:10:27
Done.
| |
| 28 #define NATIVE_CLIENT_GDB_RSP_SESSION_H_ 1 | 28 #define SRC_TRUSTED_GDB_RSP_SESSION_H_ 1 |
| 29 | 29 |
| 30 #include <sstream> | 30 #include <sstream> |
| 31 | 31 |
| 32 #include "native_client/src/trusted/port/std_types.h" | 32 #include "native_client/src/trusted/port/std_types.h" |
| 33 #include "native_client/src/trusted/port/mutex.h" | 33 #include "native_client/src/trusted/port/mutex.h" |
| 34 #include "native_client/src/trusted/port/transport.h" | 34 #include "native_client/src/trusted/port/transport.h" |
| 35 | 35 |
| 36 namespace gdb_rsp { | 36 namespace gdb_rsp { |
| 37 | 37 |
| 38 class Packet; | 38 class Packet; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 protected: | 75 protected: |
| 76 port::IMutex *mutex_; // Lock to enforce correct response order. | 76 port::IMutex *mutex_; // Lock to enforce correct response order. |
| 77 port::ITransport *io_; // Transport object not owned by the Session. | 77 port::ITransport *io_; // Transport object not owned by the Session. |
| 78 uint32_t flags_; // Session flags for Sequence/Ack generation. | 78 uint32_t flags_; // Session flags for Sequence/Ack generation. |
| 79 uint8_t seq_; // Next sequence number to use or -1. | 79 uint8_t seq_; // Next sequence number to use or -1. |
| 80 bool connected_; // Is the connection still valid. | 80 bool connected_; // Is the connection still valid. |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 } // namespace gdb_rsp | 83 } // namespace gdb_rsp |
| 84 | 84 |
| 85 #endif // NATIVE_CLIENT_GDB_RSP_SESSION_H_ | 85 #endif // SRC_TRUSTED_GDB_RSP_SESSION_H_ |
| 86 | 86 |
| OLD | NEW |