yast2-core
|
#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 | wait_for_frontend | ) |
Constructor for debugger. The parameter determines whether to block (in the first debug call) until the frontend connects or not.
References create_socket(), fd, sock, and y2debug.
YCPDebugger::~YCPDebugger | ( | ) |
Destructor for debugger.
References fd, sock, write_line(), and y2debug.
|
private |
Adds a breakpoint to the list of breakpoints.
References breakpoints, YCPDebugger::Position::setpos(), and YCPDebugger::Breakpoint::tmpinactive.
Referenced by handle_command().
|
private |
Checks if the given position does matches a breakpoint and returns true if so.
References breakpoints.
Referenced by debug().
|
private |
|
private |
void YCPDebugger::debug | ( | EntryPoint | , |
const YCPElement & | |||
) |
Main debug function. It is called in YCode::evaluate and YBlock::evaluate.
References breakpoints, check_breakpoints(), check_socket(), close_request, fd, YCPDebugger::Position::file, handle_command(), hold_level, ignore(), YCPDebugger::Settings::ignorescr, Interpreter, last_command, leave_position, YCPDebugger::Position::line, YCPDebugger::Settings::printtoken, read_line(), YCPDebugger::Settings::reset(), YCPDebugger::Position::setpos(), settings, single_mode, wait_for_frontend, write_line(), write_prompt(), and y2debug.
|
private |
Deletes a breakpoint from the list of breakpoints. Return false if no matching breakpoint was found.
References breakpoints.
Referenced by handle_command().
|
private |
Handles a command from the frontend. The return value specifies whether the execution should continue or not.
References add_breakpoint(), close_request, delete_breakpoint(), hold_level, YCPDebugger::Settings::ignorescr, Interpreter, leave_position, list_breakpoints(), list_source(), print_scope(), print_variable(), YCPDebugger::Settings::printtoken, YCPDebugger::Position::setpos(), settings, single_mode, split(), and write_line().
Referenced by debug().
|
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.
References Block, and Interpreter.
Referenced by debug().
|
private |
Prints a list of all breakpoints.
References breakpoints, and write_line().
Referenced by handle_command().
|
private |
Prints the current source file.
References write_line(), and y2debug.
Referenced by handle_command().
|
private |
Prints the entire variable scope.
References toString(), and write_line().
Referenced by handle_command().
|
private |
Prints a single variable.
References YCPElement::isNull(), and write_line().
Referenced by handle_command().
|
private |
|
private |
Writes a line to the file descriptor.
Referenced by check_socket(), debug(), handle_command(), list_breakpoints(), list_source(), print_scope(), print_variable(), and ~YCPDebugger().
|
private |
|
private |
List of breakpoints.
Referenced by add_breakpoint(), check_breakpoints(), debug(), delete_breakpoint(), and list_breakpoints().
|
private |
The frontend wants to detach from the debugger.
Referenced by debug(), and handle_command().
|
private |
The file descriptor we are communication on. Note: We only allow one debugger to be connected.
Referenced by check_socket(), debug(), read_line(), write_line(), write_prompt(), YCPDebugger(), and ~YCPDebugger().
|
private |
Stop execution if the level is smaller than or equal to the hold_level.
Referenced by debug(), and handle_command().
|
private |
The command received last.
Referenced by debug().
|
private |
Stop execution if execution leaves this position.
Referenced by debug(), and handle_command().
|
private |
The user settings.
Referenced by debug(), and handle_command().
|
private |
Stop execution at the next possible point.
Referenced by debug(), and handle_command().
|
private |
The socket we are listening on.
Referenced by check_socket(), create_socket(), YCPDebugger(), and ~YCPDebugger().
|
private |
Block (in the first debug call) until the frontend connects.
Referenced by debug().