blob: 36fd0344a092982896406543a04f4f31e2672473 [file] [log] [blame]
Chris Lattner24943d22010-06-08 16:52:24 +00001//===-- StringExtractorGDBRemote.h ------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef utility_StringExtractorGDBRemote_h_
11#define utility_StringExtractorGDBRemote_h_
12
13// C Includes
14// C++ Includes
15#include <string>
16// Other libraries and framework includes
17// Project includes
Greg Clayton54e7afa2010-07-09 20:39:50 +000018#include "Utility/StringExtractor.h"
Chris Lattner24943d22010-06-08 16:52:24 +000019
20class StringExtractorGDBRemote : public StringExtractor
21{
22public:
23
24 StringExtractorGDBRemote() :
25 StringExtractor ()
26 {
27 }
28
29 StringExtractorGDBRemote(const char *cstr) :
30 StringExtractor (cstr)
31 {
32 }
33 StringExtractorGDBRemote(const StringExtractorGDBRemote& rhs) :
34 StringExtractor (rhs)
35 {
36 }
37
38 virtual ~StringExtractorGDBRemote()
39 {
40 }
41
Greg Clayton61d043b2011-03-22 04:00:09 +000042 enum ServerPacketType
43 {
44 eServerPacketType_nack = 0,
45 eServerPacketType_ack,
46 eServerPacketType_invalid,
47 eServerPacketType_unimplemented,
Greg Claytoncb8977d2011-03-23 00:09:55 +000048 eServerPacketType_interrupt, // CTRL+c packet or "\x03"
Greg Clayton58e26e02011-03-24 04:28:38 +000049 eServerPacketType_qHostInfo,
Greg Clayton24bc5d92011-03-30 18:16:51 +000050 eServerPacketType_qProcessInfoPID,
51 eServerPacketType_qfProcessInfo,
52 eServerPacketType_qsProcessInfo,
53 eServerPacketType_qUserName,
54 eServerPacketType_qGroupName,
Greg Clayton06d7cc82011-04-04 18:18:57 +000055 eServerPacketType_qSpeedTest,
Greg Clayton58e26e02011-03-24 04:28:38 +000056 eServerPacketType_QStartNoAckMode
Greg Clayton61d043b2011-03-22 04:00:09 +000057 };
58
59 ServerPacketType
60 GetServerPacketType () const;
61
62 enum ResponseType
Chris Lattner24943d22010-06-08 16:52:24 +000063 {
64 eUnsupported = 0,
65 eAck,
66 eNack,
67 eError,
68 eOK,
Stephen Wilson4b274e82011-03-23 02:02:29 +000069 eResponse
Chris Lattner24943d22010-06-08 16:52:24 +000070 };
71
Greg Clayton61d043b2011-03-22 04:00:09 +000072 ResponseType
73 GetResponseType () const;
Chris Lattner24943d22010-06-08 16:52:24 +000074
75 bool
Greg Clayton61d043b2011-03-22 04:00:09 +000076 IsOKResponse() const;
Chris Lattner24943d22010-06-08 16:52:24 +000077
78 bool
Greg Clayton61d043b2011-03-22 04:00:09 +000079 IsUnsupportedResponse() const;
Chris Lattner24943d22010-06-08 16:52:24 +000080
81 bool
Greg Clayton61d043b2011-03-22 04:00:09 +000082 IsNormalResponse () const;
Chris Lattner24943d22010-06-08 16:52:24 +000083
84 bool
Greg Clayton61d043b2011-03-22 04:00:09 +000085 IsErrorResponse() const;
Chris Lattner24943d22010-06-08 16:52:24 +000086
87 // Returns zero if the packet isn't a EXX packet where XX are two hex
88 // digits. Otherwise the error encoded in XX is returned.
89 uint8_t
90 GetError();
91};
92
93#endif // utility_StringExtractorGDBRemote_h_