yast2-core
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
YCPDebugger Class Reference

#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< Breakpointbreakpoints
 
int sock
 
int fd
 
bool single_mode
 
int hold_level
 
Position leave_position
 
bool close_request
 
Settings settings
 

Member Enumeration Documentation

Enum of entrypoints for the function debug.

Enumerator
Interpreter 
Block 

Constructor & Destructor Documentation

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.

Member Function Documentation

void YCPDebugger::add_breakpoint ( const string &  add_file,
int  add_line 
)
private

Adds a breakpoint to the list of breakpoints.

References breakpoints, YCPDebugger::Position::setpos(), and YCPDebugger::Breakpoint::tmpinactive.

Referenced by handle_command().

bool YCPDebugger::check_breakpoints ( const string &  check_file,
int  check_line 
)
private

Checks if the given position does matches a breakpoint and returns true if so.

References breakpoints.

Referenced by debug().

void YCPDebugger::check_socket ( bool  block)
private

Checks if data arrived on our socket. The parameter determines whether to block until data arrives or not.

References fd, sock, write_line(), y2debug, and y2error.

Referenced by debug().

void YCPDebugger::create_socket ( )
private

Creates the socket we are listening on.

References sock, and y2error.

Referenced by YCPDebugger().

void YCPDebugger::debug ( EntryPoint  ,
const YCPElement  
)
bool YCPDebugger::delete_breakpoint ( const string &  delete_file,
int  delete_line 
)
private

Deletes a breakpoint from the list of breakpoints. Return false if no matching breakpoint was found.

References breakpoints.

Referenced by handle_command().

bool YCPDebugger::handle_command ( const string &  ,
const YCPElement elem 
)
private
bool YCPDebugger::ignore ( EntryPoint  entrypoint,
const YCPElement element 
)
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().

void YCPDebugger::list_breakpoints ( )
private

Prints a list of all breakpoints.

References breakpoints, and write_line().

Referenced by handle_command().

void YCPDebugger::list_source ( const char *  filename)
private

Prints the current source file.

References write_line(), and y2debug.

Referenced by handle_command().

void YCPDebugger::print_scope ( )
private

Prints the entire variable scope.

References toString(), and write_line().

Referenced by handle_command().

bool YCPDebugger::print_variable ( const string &  )
private

Prints a single variable.

References YCPElement::isNull(), and write_line().

Referenced by handle_command().

string YCPDebugger::read_line ( bool  block) const
private

Reads a line from the file descriptor. The parameter determines whether to block or not.

References fd, and y2error.

Referenced by debug().

void YCPDebugger::write_line ( const char *  format,
  ... 
) const
private

Writes a line to the file descriptor.

References fd, and y2error.

Referenced by check_socket(), debug(), handle_command(), list_breakpoints(), list_source(), print_scope(), print_variable(), and ~YCPDebugger().

void YCPDebugger::write_prompt ( ) const
private

Writes the prompt to the file descriptor.

References fd, and y2error.

Referenced by debug().

Member Data Documentation

vector<Breakpoint> YCPDebugger::breakpoints
private
bool YCPDebugger::close_request
private

The frontend wants to detach from the debugger.

Referenced by debug(), and handle_command().

int YCPDebugger::fd
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().

int YCPDebugger::hold_level
private

Stop execution if the level is smaller than or equal to the hold_level.

Referenced by debug(), and handle_command().

string YCPDebugger::last_command
private

The command received last.

Referenced by debug().

Position YCPDebugger::leave_position
private

Stop execution if execution leaves this position.

Referenced by debug(), and handle_command().

Settings YCPDebugger::settings
private

The user settings.

Referenced by debug(), and handle_command().

bool YCPDebugger::single_mode
private

Stop execution at the next possible point.

Referenced by debug(), and handle_command().

int YCPDebugger::sock
private

The socket we are listening on.

Referenced by check_socket(), create_socket(), YCPDebugger(), and ~YCPDebugger().

bool YCPDebugger::wait_for_frontend
private

Block (in the first debug call) until the frontend connects.

Referenced by debug().


The documentation for this class was generated from the following files:

Generated on a sunny day for yast2-core by doxygen 1.8.8