SCI: Added OnStartup debug flag to start the debugger at the start of the game.

svn-id: r47663
This commit is contained in:
Walter van Niftrik 2010-01-29 01:31:05 +00:00
parent 5ffba8631d
commit 52ef12547f
3 changed files with 7 additions and 1 deletions

View file

@ -1941,6 +1941,10 @@ static void _init_stack_base_with_selector(EngineState *s, Selector selector) {
static EngineState *_game_run(EngineState *&s, int restoring) {
EngineState *successor = NULL;
int game_is_finished = 0;
if (Common::isDebugChannelEnabled(kDebugLevelOnStartup))
((Sci::SciEngine*)g_engine)->getSciDebugger()->attach();
do {
s->_executionStackPosChanged = false;
run_vm(s, (successor || restoring) ? 1 : 0);

View file

@ -74,6 +74,7 @@ SciEngine::SciEngine(OSystem *syst, const ADGameDescription *desc)
Common::addDebugChannel(kDebugLevelScripts, "Scripts", "Notifies when scripts are unloaded");
Common::addDebugChannel(kDebugLevelGC, "GC", "Garbage Collector debugging");
Common::addDebugChannel(kDebugLevelSci0Pic, "Sci0Pic", "SCI0 pic drawing debugging");
Common::addDebugChannel(kDebugLevelOnStartup, "OnStartup", "Enter debugger at start of game");
_gamestate = 0;

View file

@ -77,7 +77,8 @@ enum kDebugLevels {
kDebugLevelScripts = 1 << 19,
kDebugLevelGC = 1 << 20,
kDebugLevelSci0Pic = 1 << 21,
kDebugLevelResMan = 1 << 22
kDebugLevelResMan = 1 << 22,
kDebugLevelOnStartup = 1 << 23
};
extern const char *versionNames[];