#include <YCPDebugger.h>
Classes | |
struct | Breakpoint |
struct | Position |
struct | Settings |
Public Types | |
enum | EntryPoint { Interpreter, Block } |
Public Member Functions | |
YCPDebugger (bool) | |
~YCPDebugger () | |
void | debug (EntryPoint, const YCPElement &) |
Private Member Functions | |
void | add_breakpoint (const string &, int) |
bool | delete_breakpoint (const string &, int) |
bool | check_breakpoints (const string &, int) |
void | list_breakpoints () |
void | list_source (const char *) |
void | create_socket () |
void | check_socket (bool) |
string | read_line (bool) const |
void | write_line (const char *,...) const __attribute__((format(printf |
void void | write_prompt () const |
bool | handle_command (const string &, const YCPElement &elem) |
bool | print_variable (const string &) |
void | print_scope () |
bool | ignore (EntryPoint, const YCPElement &) |
Private Attributes | |
string | last_command |
bool | wait_for_frontend |
vector< Breakpoint > | breakpoints |
int | sock |
int | fd |
bool | single_mode |
int | hold_level |
Position | leave_position |
bool | close_request |
Settings | settings |
YCPDebugger::YCPDebugger | ( | bool | ) |
Constructor for debugger. The parameter determines whether to block (in the first debug call) until the frontend connects or not.
YCPDebugger::~YCPDebugger | ( | ) |
Destructor for debugger.
void YCPDebugger::add_breakpoint | ( | const string & | , | |
int | ||||
) | [private] |
Adds a breakpoint to the list of breakpoints.
bool YCPDebugger::check_breakpoints | ( | const string & | , | |
int | ||||
) | [private] |
Checks if the given position does matches a breakpoint and returns true if so.
void YCPDebugger::check_socket | ( | bool | ) | [private] |
Checks if data arrived on our socket. The parameter determines whether to block until data arrives or not.
void YCPDebugger::create_socket | ( | ) | [private] |
Creates the socket we are listening on.
void YCPDebugger::debug | ( | EntryPoint | , | |
const YCPElement & | ||||
) |
Main debug function. It is called in YCode::evaluate and YBlock::evaluate.
bool YCPDebugger::delete_breakpoint | ( | const string & | , | |
int | ||||
) | [private] |
Deletes a breakpoint from the list of breakpoints. Return false if no matching breakpoint was found.
bool YCPDebugger::handle_command | ( | const string & | , | |
const YCPElement & | elem | |||
) | [private] |
Handles a command from the frontend. The return value specifies whether the execution should continue or not.
bool YCPDebugger::ignore | ( | EntryPoint | , | |
const YCPElement & | ||||
) | [private] |
Used to ignore the calls to "_fullname", which the user does not want to debug and most important the filename is wrong during these calls.
void YCPDebugger::list_breakpoints | ( | ) | [private] |
Prints a list of all breakpoints.
void YCPDebugger::list_source | ( | const char * | ) | [private] |
Prints the current source file.
void YCPDebugger::print_scope | ( | ) | [private] |
Prints the entire variable scope.
bool YCPDebugger::print_variable | ( | const string & | ) | [private] |
Prints a single variable.
string YCPDebugger::read_line | ( | bool | ) | const [private] |
Reads a line from the file descriptor. The parameter determines whether to block or not.
void YCPDebugger::write_line | ( | const char * | , | |
... | ||||
) | const [private] |
Writes a line to the file descriptor.
void void YCPDebugger::write_prompt | ( | ) | const [private] |
Writes the prompt to the file descriptor.
vector<Breakpoint> YCPDebugger::breakpoints [private] |
List of breakpoints.
bool YCPDebugger::close_request [private] |
The frontend wants to detach from the debugger.
int YCPDebugger::fd [private] |
The file descriptor we are communication on. Note: We only allow one debugger to be connected.
int YCPDebugger::hold_level [private] |
Stop execution if the level is smaller than or equal to the hold_level.
string YCPDebugger::last_command [private] |
The command received last.
Position YCPDebugger::leave_position [private] |
Stop execution if execution leaves this position.
Settings YCPDebugger::settings [private] |
The user settings.
bool YCPDebugger::single_mode [private] |
Stop execution at the next possible point.
int YCPDebugger::sock [private] |
The socket we are listening on.
bool YCPDebugger::wait_for_frontend [private] |
Block (in the first debug call) until the frontend connects.