Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 1 | //===-- 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 Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 18 | #include "Utility/StringExtractor.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 19 | |
| 20 | class StringExtractorGDBRemote : public StringExtractor |
| 21 | { |
| 22 | public: |
| 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 | |
| 42 | enum Type |
| 43 | { |
| 44 | eUnsupported = 0, |
| 45 | eAck, |
| 46 | eNack, |
| 47 | eError, |
| 48 | eOK, |
| 49 | eResponse |
| 50 | }; |
| 51 | |
| 52 | StringExtractorGDBRemote::Type |
| 53 | GetType () const; |
| 54 | |
| 55 | bool |
| 56 | IsOKPacket() const; |
| 57 | |
| 58 | bool |
| 59 | IsUnsupportedPacket() const; |
| 60 | |
| 61 | bool |
| 62 | IsNormalPacket () const; |
| 63 | |
| 64 | bool |
| 65 | IsErrorPacket() const; |
| 66 | |
| 67 | // Returns zero if the packet isn't a EXX packet where XX are two hex |
| 68 | // digits. Otherwise the error encoded in XX is returned. |
| 69 | uint8_t |
| 70 | GetError(); |
| 71 | }; |
| 72 | |
| 73 | #endif // utility_StringExtractorGDBRemote_h_ |