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

Debugger singleton to keep debugging-related status. More...

#include <Debugger.h>

Classes

struct  stackitem_t
 

Public Types

enum  command_t {
  c_unknown, c_next, c_step, c_continue,
  c_print, c_backtrace, c_breakpoint, c_removebreakpoint,
  c_setvalue
}
 

Public Member Functions

 Debugger ()
 
 ~Debugger ()
 
bool initialize (bool remote)
 
bool initializeRemote ()
 
bool initializeLocal ()
 
bool processInput (command_t &command, std::list< std::string > &arguments)
 Read the input from controlling socket and act accordingly. More...
 
bool sendOutput (std::string output)
 
void stashOutput (std::string output)
 
command_t lastCommand () const
 
void setTracing ()
 
void setTracing (bool enable)
 
void setBreakpoint (std::list< std::string > &arguments)
 
void removeBreakpoint (std::list< std::string > &arguments)
 
void generateBacktrace ()
 
void printVariable (std::string variable_name)
 
void setVariable (std::string arg)
 
void enableTracing (Y2Namespace *block, bool enable)
 
bool tracing (Y2Namespace *block) const
 
bool tracing () const
 
void pushBlock (Y2Namespace *block, bool tracing)
 
void popBlock ()
 

Private Member Functions

SymbolEntryPtr findSymbol (std::string name)
 

Private Attributes

int m_socket
 
int m_ns
 
FILE * m_descriptor
 
command_t m_last_command
 
std::string m_outputstash
 
bool m_tracing
 
std::list< stackitem_tm_blockstack
 
bool m_remote
 

Detailed Description

Debugger singleton to keep debugging-related status.

Member Enumeration Documentation

Enumerator
c_unknown 
c_next 
c_step 
c_continue 
c_print 
c_backtrace 
c_breakpoint 
c_removebreakpoint 
c_setvalue 

Constructor & Destructor Documentation

Debugger::Debugger ( )
Debugger::~Debugger ( )

References ADDRESS, m_remote, and m_socket.

Member Function Documentation

void Debugger::enableTracing ( Y2Namespace block,
bool  enable 
)

References m_blockstack.

SymbolEntryPtr Debugger::findSymbol ( std::string  name)
private
void Debugger::generateBacktrace ( )
bool Debugger::initialize ( bool  remote)

Initialize the socket and reset the communication

References initializeLocal(), initializeRemote(), and m_remote.

Referenced by main().

bool Debugger::initializeLocal ( )
bool Debugger::initializeRemote ( )

References c_step, m_descriptor, m_last_command, m_ns, m_socket, PORT, and y2error.

Referenced by initialize().

command_t Debugger::lastCommand ( ) const
inline

References m_last_command.

Referenced by YBlock::evaluate().

void Debugger::popBlock ( )

References m_blockstack.

Referenced by YBlock::evaluate().

void Debugger::printVariable ( std::string  variable_name)

References findSymbol(), and sendOutput().

Referenced by processInput().

bool Debugger::processInput ( command_t command,
std::list< std::string > &  arguments 
)

Read the input from controlling socket and act accordingly.

For actions needed to be done in context of YCP code being run, return the information to the caller.

References ADDRESS, c_backtrace, c_breakpoint, c_continue, c_next, c_print, c_removebreakpoint, c_setvalue, c_step, c_unknown, YaST::ee, generateBacktrace(), m_descriptor, m_last_command, m_remote, m_socket, stringutil::numstring(), printVariable(), removeBreakpoint(), sendOutput(), setBreakpoint(), setVariable(), YaST::ExecutionEnvironment::statement(), and y2error.

Referenced by YBlock::evaluate().

void Debugger::pushBlock ( Y2Namespace block,
bool  tracing 
)
void Debugger::removeBreakpoint ( std::list< std::string > &  arguments)

References findSymbol(), sendOutput(), and YCode::yiBreakpoint.

Referenced by processInput().

bool Debugger::sendOutput ( std::string  output)
void Debugger::setBreakpoint ( std::list< std::string > &  arguments)
void Debugger::setTracing ( )
void Debugger::setTracing ( bool  enable)

References m_tracing.

void Debugger::setVariable ( std::string  arg)
void Debugger::stashOutput ( std::string  output)

References m_outputstash, and output().

Referenced by YBreakpoint::evaluate().

bool Debugger::tracing ( Y2Namespace block) const

References m_blockstack.

Referenced by YBlock::evaluate().

bool Debugger::tracing ( ) const

References m_tracing.

Referenced by pushBlock().

Member Data Documentation

std::list<stackitem_t> Debugger::m_blockstack
private
FILE* Debugger::m_descriptor
private
command_t Debugger::m_last_command
private
int Debugger::m_ns
private
std::string Debugger::m_outputstash
private

Referenced by sendOutput(), and stashOutput().

bool Debugger::m_remote
private

Referenced by initialize(), processInput(), and ~Debugger().

int Debugger::m_socket
private
bool Debugger::m_tracing
private

Referenced by setTracing(), and tracing().


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

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