ScummVM API documentation
GUI::Debugger Class Reference
Inheritance diagram for GUI::Debugger:
Access::Debugger Adl::Console Agi::Console Agi::MickeyConsole Agi::WinnieConsole AGOS::Debugger AGS::AGSConsole Asylum::Console Avalanche::AvalancheConsole BladeRunner::Debugger Buried::BuriedConsole CGE2::CGE2Console CGE::CGEConsole Chewy::Console Cine::CineConsole Composer::Console Crab::Console Cruise::Debugger Cryo::Debugger Director::Debugger DM::Console Draci::DraciConsole Drascula::Console DreamWeb::DreamWebConsole Gnap::Debugger Gob::GobConsole Griffon::Console Grim::Debugger Groovie::Debugger Hopkins::Debugger Hugo::HugoConsole Kingdom::Console Kyra::Debugger Lab::Console LastExpress::Debugger Lilliput::LilliputConsole Lure::Debugger M4::Console MacVenture::Console Made::MadeConsole MADS::Debugger MM::MM1::Console MM::Xeen::Debugger Mohawk::LivingBooksConsole Mortevielle::Debugger MutationOfJB::Console Myst3::Console Nancy::NancyConsole Neverhood::Console NGI::Console Parallaction::Debugger Pegasus::PegasusConsole Petka::Console Pink::Console Plumbers::Console Prince::Debugger Queen::Debugger Saga2::Console Saga::Console Sci::Console Scumm::ScummDebugger Sherlock::Debugger Sky::Debugger Stark::Console StarTrek::Console Supernova::Console Sword1::SwordConsole Sword25::Sword25Console Sword2::Debugger TeenAgent::Console Tinsel::Console Titanic::Debugger Toltecs::Console Toon::ToonConsole Touche::ToucheConsole Trecision::Console TsAGE::Debugger Tucker::TuckerConsole TwinE::TwinEConsole Twp::Console Ultima::Shared::Debugger Ultima::Ultima8::Debugger Voyeur::Debugger Wage::Debugger Watchmaker::Console Wintermute::Console ZVision::Console

Classes

struct  Var
 

Public Member Functions

int getCharsPerLine ()
 
int debugPrintf (MSVC_PRINTF const char *format,...) GCC_PRINTF(2
 
int void debugPrintColumns (const Common::StringArray &list)
 
virtual void onFrame ()
 
virtual void attach (const char *entry=nullptr)
 
bool isActive () const
 

Protected Types

enum  VarType {
  DVAR_BYTE, DVAR_INT, DVAR_FLOAT, DVAR_BOOL,
  DVAR_INTARRAY, DVAR_STRING
}
 
typedef Common::Functor1< const char *, bool > defaultCommand
 
typedef Common::Functor2< int, const char **, bool > Debuglet
 

Protected Member Functions

void registerVar (const Common::String &varname, byte *variable)
 
void registerVar (const Common::String &varname, int *variable)
 
void registerVar (const Common::String &varname, float *variable)
 
void registerVar (const Common::String &varname, bool *variable)
 
void registerVar (const Common::String &varname, int32 **variable, int arraySize)
 
void registerVar (const Common::String &varname, Common::String *variable)
 
void registerCmd (const Common::String &cmdname, Debuglet *debuglet)
 
void registerDefaultCmd (defaultCommand *defaultCommandProcessor)
 
void clearVars ()
 
void setPrompt (Common::String prompt)
 
void resetPrompt ()
 
virtual void preEnter ()
 
virtual void postEnter ()
 
virtual bool handleCommand (int argc, const char **argv, bool &keepRunning)
 
void detach ()
 
bool cmdExit (int argc, const char **argv)
 
bool cmdHelp (int argc, const char **argv)
 
bool cmdOpenLog (int argc, const char **argv)
 
bool cmdMd5 (int argc, const char **argv)
 
bool cmdMd5Mac (int argc, const char **argv)
 
bool cmdDebugLevel (int argc, const char **argv)
 
bool cmdDebugFlagsList (int argc, const char **argv)
 
bool cmdDebugFlagEnable (int argc, const char **argv)
 
bool cmdDebugFlagDisable (int argc, const char **argv)
 
bool cmdClearLog (int argc, const char **argv)
 
bool cmdExecFile (int argc, const char **argv)
 

Protected Attributes

PauseToken _debugPauseToken
 
GUI::ConsoleDialog_debuggerDialog
 

Member Function Documentation

◆ onFrame()

virtual void GUI::Debugger::onFrame ( )
virtual

The onFrame() method should be invoked by the engine at regular intervals (usually once per main loop iteration) whenever the debugger is attached. This will open up the console and accept user input if certain preconditions are met, such as the frame countdown having reached zero.

Subclasses can override this to e.g. check for breakpoints being triggered.

Reimplemented in MM::Xeen::Debugger.

◆ attach()

virtual void GUI::Debugger::attach ( const char *  entry = nullptr)
virtual

'Attach' the debugger. This ensures that the next time onFrame() is invoked, the debugger will activate and accept user input.

Reimplemented in Sci::Console.

◆ isActive()

bool GUI::Debugger::isActive ( ) const
inline

Return true if the debugger is currently active (i.e. executing a command or waiting for use input).

◆ registerDefaultCmd()

void GUI::Debugger::registerDefaultCmd ( defaultCommand defaultCommandProcessor)
inlineprotected

Register a default command processor with the debugger. This allows an engine to receive all user input in the debugger.

A defaultCommandProcessor has the following signature: bool func(const char **inputOrig)

To deactivate call with a nullptr.

◆ clearVars()

void GUI::Debugger::clearVars ( )
protected

Remove all vars except default "debug_countdown"

◆ preEnter()

virtual void GUI::Debugger::preEnter ( )
protectedvirtual

Hook for subclasses which is called just before enter() is run. A typical usage example is pausing music and sound effects.

The default implementation invokes Engine::pauseEngine(true).

Reimplemented in TwinE::TwinEConsole.

◆ postEnter()

virtual void GUI::Debugger::postEnter ( )
protectedvirtual

Hook for subclasses which is called just after enter() was run. A typical usage example is resuming music and sound effects.

The default implementation invokes Engine::pauseEngine(false).

Reimplemented in Sherlock::Debugger, TwinE::TwinEConsole, Buried::BuriedConsole, Access::Debugger, and Nancy::NancyConsole.

◆ handleCommand()

virtual bool GUI::Debugger::handleCommand ( int  argc,
const char **  argv,
bool &  keepRunning 
)
protectedvirtual

Process the given command line. Returns true if and only if argv[0] is a known command and was handled, false otherwise.

Reimplemented in Ultima::Ultima4::Debugger.

◆ detach()

void GUI::Debugger::detach ( )
protected

Subclasses should invoke the detach() method in their cmdFOO methods if that command will resume execution of the program (as opposed to executing, say, a "single step through code" command).

This currently only hides the virtual keyboard, if any.


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