OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 The Native Client Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 #ifndef DEBUGGER_RSP_RSP_PACKET_UTILS_H_ | |
5 #define DEBUGGER_RSP_RSP_PACKET_UTILS_H_ | |
6 | |
7 #include "debugger/base/debug_blob.h" | |
8 | |
9 namespace rsp { | |
10 /// This class provides ability to add or strip RSP package 'envelope' i.e. | |
11 /// start character, stop character, checksum etc. | |
12 /// | |
13 /// http://sources.redhat.com/gdb/current/onlinedocs/gdb.html#Remote-Protocol | |
14 class PacketUtils { | |
15 public: | |
16 /// Adds RSP envelope. | |
17 /// @param[in] blob_in message that has to go inside envelope | |
18 /// @param[out] blob_out destination for the 'enveloped' message | |
19 static void AddEnvelope(const debug::Blob& blob_in, debug::Blob* blob_out); | |
20 | |
21 /// Removes RSP envelope. | |
22 /// @param[in] blob_in message in envelope | |
23 /// @param[out] blob_out destination for the message | |
24 /// @return true if |blob_in| is valid 'enveloped' RSP packet | |
25 static bool RemoveEnvelope(const debug::Blob& blob_in, debug::Blob* blob_out); | |
26 }; | |
27 } // namespace rsp | |
28 | |
29 #endif // DEBUGGER_RSP_RSP_PACKET_UTILS_H_ | |
30 | |
31 | |
OLD | NEW |