Pol  Rev 533
DebugContext Class Reference
+ Inheritance diagram for DebugContext:
+ Collaboration diagram for DebugContext:

List of all members.

Public Types

typedef std::vector< std::string > Results

Public Member Functions

 DebugContext ()
 ~DebugContext ()
bool done () const
bool process (const std::string &cmd, Results &results)
std::string prompt () const

Protected Member Functions

string cmd_attach (unsigned pid)
string cmd_break ()
string cmd_call (const string &rest, Results &results)
string cmd_clrallbp ()
string cmd_clrbp (const string &rest)
string cmd_detach ()
string cmd_filecont (const string &rest, Results &results)
string cmd_fileline (const string &rest)
string cmd_files (Results &results)
string cmd_funclist (const string &rest, Results &results)
string cmd_funcprof (const string &rest, Results &results)
string cmd_getglobalpacked (const string &rest)
string cmd_getlocalpacked (const string &rest)
string cmd_globalvars (Results &results)
string cmd_ins (Results &results)
string cmd_inslist (const string &rest, Results &results)
string cmd_instrace ()
string cmd_kill (unsigned pid)
string cmd_loadsym (unsigned pid)
string cmd_localvar (const string &rest)
string cmd_localvarmembers (const string &rest, Results &results)
string cmd_localvars (Results &results)
string cmd_pc ()
string cmd_pidlist (const string &rest, Results &results)
string cmd_quit ()
string cmd_run ()
string cmd_scriptins (const string &rest, Results &results)
string cmd_scriptlist (const string &rest, Results &results)
string cmd_scriptprofile (const string &rest, Results &results)
string cmd_scriptsrc (const string &rest, Results &results)
string cmd_setbp (const string &rest)
string cmd_setglobalpacked (const string &rest)
string cmd_setlocalpacked (const string &rest)
string cmd_setscript (const string &rest, Results &results)
string cmd_srcprof (const string &rest, Results &results)
string cmd_start (const string &rest)
string cmd_state ()
string cmd_stepinto ()
string cmd_stepover ()

Private Member Functions

 DebugContext (const DebugContext &)
DebugContextoperator= (const DebugContext &)

Private Attributes

bool _authorized
bool _done
ref_ptr< EScriptProgram_script
weak_ptr< UOExecutoruoexec_wptr

Detailed Description

Definition at line 71 of file poldbg.cpp.


Member Typedef Documentation

typedef std::vector<std::string> DebugContext::Results

Definition at line 78 of file poldbg.cpp.


Constructor & Destructor Documentation

Definition at line 202 of file poldbg.cpp.

Definition at line 209 of file poldbg.cpp.

References cmd_detach().

+ Here is the call graph for this function:

DebugContext::DebugContext ( const DebugContext ) [private]

Member Function Documentation

string DebugContext::cmd_attach ( unsigned  pid) [protected]

Definition at line 326 of file poldbg.cpp.

References _script, Executor::attach_debugger(), find_uoexec(), Executor::prog(), EScriptProgram::read_dbg_file(), ref_ptr< T >::set(), tostring(), uoexec_wptr, and UOExecutor::weakptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string DebugContext::cmd_break ( ) [protected]

Definition at line 739 of file poldbg.cpp.

References Executor::dbg_break(), weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_call ( const string &  rest,
Results results 
) [protected]
std::string DebugContext::cmd_clrallbp ( ) [protected]

Definition at line 766 of file poldbg.cpp.

References Executor::dbg_clrallbp(), weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string DebugContext::cmd_clrbp ( const string &  rest) [protected]

Definition at line 758 of file poldbg.cpp.

References Executor::dbg_clrbp(), weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_detach ( ) [protected]

Definition at line 375 of file poldbg.cpp.

References weak_ptr< T >::clear(), Executor::detach_debugger(), weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), OSExecutorModule::in_debugger_holdlist(), UOExecutor::os_module, OSExecutorModule::revive_debugged(), and uoexec_wptr.

Referenced by process(), and ~DebugContext().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string DebugContext::cmd_filecont ( const string &  rest,
Results results 
) [protected]

Definition at line 818 of file poldbg.cpp.

References _script, EScriptProgram::dbg_filenames, EScriptProgram::debug_loaded, weak_ptr< T >::exists(), ref_ptr< T >::get(), weak_ptr< T >::get_weakptr(), ISTRINGSTREAM, Executor::prog(), and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string DebugContext::cmd_fileline ( const string &  rest) [protected]

Definition at line 774 of file poldbg.cpp.

References EScriptProgram::dbg_filenum, EScriptProgram::dbg_linenum, EScriptProgram::debug_loaded, decint(), weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), Executor::PC, Executor::prog(), and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string DebugContext::cmd_files ( Results results) [protected]

Definition at line 796 of file poldbg.cpp.

References _script, EScriptProgram::dbg_filenames, EScriptProgram::debug_loaded, decint(), weak_ptr< T >::exists(), ref_ptr< T >::get(), weak_ptr< T >::get_weakptr(), Executor::prog(), and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_funclist ( const string &  rest,
Results results 
) [protected]

Definition at line 501 of file poldbg.cpp.

References _script, Instruction::cycles, EScriptProgram::dbg_functions, decint(), EPDbgFunction::firstPC, ref_ptr< T >::get(), EScriptProgram::instr, EPDbgFunction::lastPC, and EPDbgFunction::name.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_funcprof ( const string &  rest,
Results results 
) [protected]

Definition at line 564 of file poldbg.cpp.

References _script, and ref_ptr< T >::get().

+ Here is the call graph for this function:

string DebugContext::cmd_getglobalpacked ( const string &  rest) [protected]

Definition at line 1024 of file poldbg.cpp.

References weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), Executor::Globals2, and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_getlocalpacked ( const string &  rest) [protected]

Definition at line 1012 of file poldbg.cpp.

References weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), Executor::Locals2, and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string DebugContext::cmd_globalvars ( Results results) [protected]

Definition at line 884 of file poldbg.cpp.

References EScriptProgram::debug_loaded, decint(), weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), Executor::Globals2, EScriptProgram::globalvarnames, Executor::prog(), and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_ins ( Results results) [protected]

Definition at line 672 of file poldbg.cpp.

References Executor::dbg_get_instruction(), weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), Executor::nLines, Executor::PC, and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string DebugContext::cmd_inslist ( const string &  rest,
Results results 
) [protected]

Definition at line 978 of file poldbg.cpp.

References EScriptProgram::dbg_filenames, EScriptProgram::dbg_filenum, EScriptProgram::dbg_linenum, EScriptProgram::debug_loaded, decint(), weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), ISTRINGSTREAM, Executor::prog(), and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_instrace ( ) [protected]

Definition at line 688 of file poldbg.cpp.

References Executor::dbg_ins_trace(), weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), OSExecutorModule::in_debugger_holdlist(), UOExecutor::os_module, OSExecutorModule::revive_debugged(), and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_kill ( unsigned  pid) [protected]

Definition at line 361 of file poldbg.cpp.

References find_uoexec(), Executor::seterror(), and tostring().

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_loadsym ( unsigned  pid) [protected]

Definition at line 344 of file poldbg.cpp.

References find_uoexec(), and Executor::prog().

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string DebugContext::cmd_localvar ( const string &  rest) [protected]

Definition at line 904 of file poldbg.cpp.

References weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), Executor::Locals2, and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string DebugContext::cmd_localvarmembers ( const string &  rest,
Results results 
) [protected]
std::string DebugContext::cmd_localvars ( Results results) [protected]

Definition at line 859 of file poldbg.cpp.

References EScriptProgram::blocks, EScriptProgram::dbg_ins_blocks, EScriptProgram::debug_loaded, weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), Executor::Locals2, Executor::PC, Executor::prog(), and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_pc ( ) [protected]

Definition at line 665 of file poldbg.cpp.

References weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), Executor::PC, tostring(), and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_pidlist ( const string &  rest,
Results results 
) [protected]

Definition at line 454 of file poldbg.cpp.

References decint(), match(), pidlist, Executor::scriptname(), and strlower().

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_quit ( ) [protected]

Definition at line 389 of file poldbg.cpp.

References _done.

Referenced by process().

+ Here is the caller graph for this function:

std::string DebugContext::cmd_run ( ) [protected]

Definition at line 727 of file poldbg.cpp.

References Executor::dbg_run(), weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), OSExecutorModule::in_debugger_holdlist(), UOExecutor::os_module, OSExecutorModule::revive_debugged(), and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_scriptins ( const string &  rest,
Results results 
) [protected]

Definition at line 590 of file poldbg.cpp.

References ref_counted::count(), EScriptProgram::dbg_get_instruction(), decint(), ref_ptr< T >::get(), EScriptProgram::instr, EScriptProgram::read_dbg_file(), and scrstore.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_scriptlist ( const string &  rest,
Results results 
) [protected]

Definition at line 471 of file poldbg.cpp.

References EScriptProgram::name, and scrstore.

Referenced by process().

+ Here is the caller graph for this function:

string DebugContext::cmd_scriptprofile ( const string &  rest,
Results results 
) [protected]

Definition at line 572 of file poldbg.cpp.

References ref_counted::count(), Instruction::cycles, decint(), ref_ptr< T >::get(), EScriptProgram::instr, and scrstore.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_scriptsrc ( const string &  rest,
Results results 
) [protected]

Definition at line 627 of file poldbg.cpp.

References ref_counted::count(), EScriptProgram::dbg_filenum, EScriptProgram::dbg_linenum, decint(), ref_ptr< T >::get(), get_fileline(), EScriptProgram::instr, EScriptProgram::read_dbg_file(), and scrstore.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string DebugContext::cmd_setbp ( const string &  rest) [protected]

Definition at line 750 of file poldbg.cpp.

References Executor::dbg_setbp(), weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_setglobalpacked ( const string &  rest) [protected]

Definition at line 1066 of file poldbg.cpp.

References weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), Executor::Globals2, ISTRINGSTREAM, BObject::setimp(), BObjectImp::unpack(), and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_setlocalpacked ( const string &  rest) [protected]

Definition at line 1036 of file poldbg.cpp.

References weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), ISTRINGSTREAM, Executor::Locals2, BObject::setimp(), BObjectImp::unpack(), and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_setscript ( const string &  rest,
Results results 
) [protected]

Definition at line 483 of file poldbg.cpp.

References _script, ref_ptr< T >::clear(), ref_ptr< T >::get(), EScriptProgram::read_dbg_file(), and scrstore.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_srcprof ( const string &  rest,
Results results 
) [protected]

Definition at line 529 of file poldbg.cpp.

References _script, ref_counted::count(), Instruction::cycles, EScriptProgram::dbg_filenum, EScriptProgram::dbg_linenum, decint(), ref_ptr< T >::get(), and EScriptProgram::instr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_start ( const string &  rest) [protected]

Definition at line 395 of file poldbg.cpp.

References ScriptDef::config_nodie(), ExecutorModule::exec, ScriptDef::exists(), ScriptDef::name(), UOExecutor::os_module, OSExecutorModule::pid(), start_script(), and tostring().

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_state ( ) [protected]

Definition at line 658 of file poldbg.cpp.

References weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), UOExecutor::state(), and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_stepinto ( ) [protected]

Definition at line 701 of file poldbg.cpp.

References Executor::dbg_step_into(), weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), OSExecutorModule::in_debugger_holdlist(), UOExecutor::os_module, OSExecutorModule::revive_debugged(), and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::cmd_stepover ( ) [protected]

Definition at line 714 of file poldbg.cpp.

References Executor::dbg_step_over(), weak_ptr< T >::exists(), weak_ptr< T >::get_weakptr(), OSExecutorModule::in_debugger_holdlist(), UOExecutor::os_module, OSExecutorModule::revive_debugged(), and uoexec_wptr.

Referenced by process().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool DebugContext::done ( ) const [inline]

Definition at line 80 of file poldbg.cpp.

References _done.

Referenced by DebugClientThread::run().

+ Here is the caller graph for this function:

DebugContext& DebugContext::operator= ( const DebugContext ) [private]
bool DebugContext::process ( const std::string &  cmdline,
Results results 
)

[1] Debugger Commands: password [pwd] Authorize with password quit exit debugger start [eclfile] Start a script call [eclfile] [params:packed array] call a script attach [pid] Attach to a running script kill [pid] Kill a running script detach Detach from attached script state State of attached script ins Show instructions near execution point instrace Execute next instruction only stepinto Trace to next statement, into functions if necessary stepover Trace to next statement, skipping called functions run Run script full speed (until breakpoint hit if any) break Break into running script setbp [ins] Set breakpoint at instruction clrbp [ins] Clear breakpoint at instruction clrallbp Clear all breakpoints fileline {ins} File # and Line # associated with an instruction files list the source files used by this script filecont [file] {firstline} {lastline} get file contents localvars list local variable names inslist [file] [line] Return list of instructions assoc with a file/line pidlist [str] list PIDs and scriptnames matching *str* loadsym [pid] load symbols for a script scriptlist scriptprofile scriptins [filename]

Definition at line 251 of file poldbg.cpp.

References _authorized, cmd_attach(), cmd_break(), cmd_call(), cmd_clrallbp(), cmd_clrbp(), cmd_detach(), cmd_filecont(), cmd_fileline(), cmd_files(), cmd_funclist(), cmd_getglobalpacked(), cmd_getlocalpacked(), cmd_globalvars(), cmd_ins(), cmd_inslist(), cmd_instrace(), cmd_kill(), cmd_loadsym(), cmd_localvar(), cmd_localvarmembers(), cmd_localvars(), cmd_pc(), cmd_pidlist(), cmd_quit(), cmd_run(), cmd_scriptins(), cmd_scriptlist(), cmd_scriptprofile(), cmd_scriptsrc(), cmd_setbp(), cmd_setglobalpacked(), cmd_setlocalpacked(), cmd_setscript(), cmd_srcprof(), cmd_start(), cmd_state(), cmd_stepinto(), cmd_stepover(), config, PolConfig::debug_password, and splitnamevalue().

Referenced by create_debug_context(), and DebugClientThread::run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string DebugContext::prompt ( ) const

Definition at line 214 of file poldbg.cpp.

References _authorized.

Referenced by DebugClientThread::run().

+ Here is the caller graph for this function:


Member Data Documentation

bool DebugContext::_authorized [private]

Definition at line 123 of file poldbg.cpp.

Referenced by process(), and prompt().

bool DebugContext::_done [private]

Definition at line 124 of file poldbg.cpp.

Referenced by cmd_quit(), and done().


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