1#ifndef ROSE_BinaryAnalysis_Debugger_GdbResponse_H
2#define ROSE_BinaryAnalysis_Debugger_GdbResponse_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_DEBUGGER_GDB
5#include <Rose/BinaryAnalysis/Debugger/Exception.h>
10namespace BinaryAnalysis {
33 TokenType type_ = TOK_EOF;
39 Token(TokenType,
size_t begin,
size_t end);
41 TokenType type()
const;
51 std::vector<Token> tokens_;
55 : content_(sentence) {}
57 const Token& operator[](
size_t lookahead);
58 void consume(
size_t n = 1);
59 std::string lexeme(
size_t lookahead)
const;
60 const std::string& content()
const;
90 explicit operator bool()
const {
91 return rclass != ResultClass::UNSPECIFIED;
101 explicit operator bool()
const {
102 return aclass != AsyncClass::UNSPECIFIED;
120 static GdbResponse
parse(
const std::string &line);
123 void print(std::ostream&)
const;
127 static Exception syntaxError(std::string mesg, TokenStream&,
size_t);
130 static void parseResultRecord(TokenStream&, GdbResponse&);
131 static std::pair<AsyncClass, Yaml::Node> parseAsyncOutput(TokenStream&);
132 static void parseExecAsyncOutput(TokenStream&, GdbResponse&);
133 static void parseStatusAsyncOutput(TokenStream&, GdbResponse&);
134 static void parseNotifyAsyncOutput(TokenStream&, GdbResponse&);
135 static void parseConsoleStreamOutput(TokenStream&, GdbResponse&);
136 static void parseTargetStreamOutput(TokenStream&, GdbResponse&);
137 static void parseLogStreamOutput(TokenStream&, GdbResponse&);
138 static std::pair<std::string, Yaml::Node> parseResult(TokenStream&);
139 static Yaml::Node parseValue(TokenStream&);
142 static std::string nodeToString(
const Yaml::Node&,
const std::string&);
146std::ostream& operator<<(std::ostream&,
const GdbResponse&);
@ UNSPECIFIED
Stack parameter order is unknown or unspecified.
void parse(SgAsmGenericFile *)
Main function to parse DWARF information.
void print(const StackVariables &, const Partitioner2::PartitionerConstPtr &, std::ostream &out, const std::string &prefix="")
Print info about multiple local variables.
Sawyer::Language::Clexer::TokenStream TokenStream
A stream of tokens from the input file.
Sawyer::Language::Clexer::Token Token
A token parsed from the input file.
void notify(variables_map &)
Transfer map to C++ variables.
@ ERROR
Error messages that indicate an abnormal situation from which the program was able to at least partia...
const char * AsyncClass(int64_t)
Convert Rose::BinaryAnalysis::Debugger::GdbResponse::AsyncClass enum constant to a string.
const char * ResultClass(int64_t)
Convert Rose::BinaryAnalysis::Debugger::Gdb::Response::ResultRecord::ResultClass enum constant to a s...