summaryrefslogtreecommitdiffstats
path: root/lldb/include/lldb/Utility/StreamGDBRemote.h
blob: dfc4a39de791238a86726f7f79934cd8ad1945af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//===-- StreamGDBRemote.h ----------------------------------------*- C++-*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef liblldb_StreamGDBRemote_h_
#define liblldb_StreamGDBRemote_h_

#include "lldb/Utility/StreamString.h"
#include "lldb/lldb-enumerations.h"

#include <stddef.h>
#include <stdint.h>

namespace lldb_private {

class StreamGDBRemote : public StreamString {
public:
  StreamGDBRemote();

  StreamGDBRemote(uint32_t flags, uint32_t addr_size,
                  lldb::ByteOrder byte_order);

  ~StreamGDBRemote() override;

  //------------------------------------------------------------------
  /// Output a block of data to the stream performing GDB-remote escaping.
  ///
  /// @param[in] s
  ///     A block of data.
  ///
  /// @param[in] src_len
  ///     The amount of data to write.
  ///
  /// @return
  ///     Number of bytes written.
  //------------------------------------------------------------------
  // TODO: Convert this function to take ArrayRef<uint8_t>
  int PutEscapedBytes(const void *s, size_t src_len);
};

} // namespace lldb_private

#endif // liblldb_StreamGDBRemote_h_
OpenPOWER on IntegriCloud