yast2-core
|
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_t > | m_blockstack |
bool | m_remote |
Debugger singleton to keep debugging-related status.
enum Debugger::command_t |
Debugger::Debugger | ( | ) |
void Debugger::enableTracing | ( | Y2Namespace * | block, |
bool | enable | ||
) |
References m_blockstack.
Referenced by lastCommand().
|
private |
References YaST::ExecutionEnvironment::callstack(), YaST::ee, Y2ComponentBroker::getNamespaceComponent(), Y2Component::import(), Y2Namespace::lookupSymbol(), m_blockstack, name, Y2Component::name(), and stringutil::split().
Referenced by lastCommand(), printVariable(), removeBreakpoint(), setBreakpoint(), and setVariable().
void Debugger::generateBacktrace | ( | ) |
References YaST::ExecutionEnvironment::callstack(), YaST::ee, stringutil::numstring(), result(), and sendOutput().
Referenced by lastCommand(), and processInput().
bool Debugger::initialize | ( | bool | remote | ) |
Initialize the socket and reset the communication
References initializeLocal(), initializeRemote(), and m_remote.
Referenced by main().
bool Debugger::initializeLocal | ( | ) |
References ADDRESS, c_step, m_descriptor, m_last_command, m_ns, m_socket, y2error, and y2security.
Referenced by initialize().
bool Debugger::initializeRemote | ( | ) |
References c_step, m_descriptor, m_last_command, m_ns, m_socket, PORT, and y2error.
Referenced by initialize().
|
inline |
References enableTracing(), findSymbol(), generateBacktrace(), m_last_command, name, popBlock(), printVariable(), pushBlock(), removeBreakpoint(), setBreakpoint(), setTracing(), setVariable(), and tracing().
Referenced by YBlock::evaluate().
void Debugger::popBlock | ( | ) |
References m_blockstack.
Referenced by YBlock::evaluate(), and lastCommand().
void Debugger::printVariable | ( | std::string | variable_name | ) |
References findSymbol(), and sendOutput().
Referenced by lastCommand(), and 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 | ||
) |
References m_blockstack, Debugger::stackitem_t::ns, Debugger::stackitem_t::tracing, and tracing().
Referenced by YBlock::evaluate(), and lastCommand().
void Debugger::removeBreakpoint | ( | std::list< std::string > & | arguments | ) |
References findSymbol(), sendOutput(), and YCode::yiBreakpoint.
Referenced by lastCommand(), and processInput().
bool Debugger::sendOutput | ( | std::string | output | ) |
References m_ns, m_outputstash, output(), and y2debug.
Referenced by generateBacktrace(), printVariable(), processInput(), removeBreakpoint(), setBreakpoint(), and setVariable().
void Debugger::setBreakpoint | ( | std::list< std::string > & | arguments | ) |
References findSymbol(), result(), sendOutput(), and YCode::yiBreakpoint.
Referenced by lastCommand(), and processInput().
void Debugger::setTracing | ( | ) |
References c_step, m_last_command, and m_tracing.
Referenced by YBreakpoint::evaluate(), YBlock::evaluate(), and lastCommand().
void Debugger::setTracing | ( | bool | enable | ) |
References m_tracing.
void Debugger::setVariable | ( | std::string | arg | ) |
References findSymbol(), Parser::parse(), parser, sendOutput(), and stringutil::split().
Referenced by lastCommand(), and processInput().
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 lastCommand(), and pushBlock().
|
private |
Referenced by enableTracing(), findSymbol(), popBlock(), pushBlock(), and tracing().
|
private |
Referenced by initializeLocal(), initializeRemote(), and processInput().
|
private |
Referenced by initializeLocal(), initializeRemote(), lastCommand(), processInput(), and setTracing().
|
private |
Referenced by initializeLocal(), initializeRemote(), and sendOutput().
|
private |
Referenced by sendOutput(), and stashOutput().
|
private |
Referenced by initialize(), processInput(), and ~Debugger().
|
private |
Referenced by initializeLocal(), initializeRemote(), processInput(), and ~Debugger().
|
private |
Referenced by setTracing(), and tracing().