From de82216dff8fc3339c493cb1a4913eea119d614f Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Mon, 29 Feb 2016 15:29:27 +0100 Subject: WINTERMUTE: Add source functionality in debugger --- engines/wintermute/debugger.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'engines/wintermute/debugger.cpp') diff --git a/engines/wintermute/debugger.cpp b/engines/wintermute/debugger.cpp index 42fba60f9a..760a852c97 100644 --- a/engines/wintermute/debugger.cpp +++ b/engines/wintermute/debugger.cpp @@ -47,6 +47,7 @@ Console::Console(WintermuteEngine *vm) : GUI::Debugger(), _engineRef(vm) { registerCmd(DISABLE_BREAKPOINT_CMD, WRAP_METHOD(Console, Cmd_DisableBreakpoint)); registerCmd(ENABLE_BREAKPOINT_CMD, WRAP_METHOD(Console, Cmd_EnableBreakpoint)); registerCmd(INFO_CMD, WRAP_METHOD(Console, Cmd_Info)); + registerCmd(SET_PATH_CMD, WRAP_METHOD(Console, Cmd_SourcePath)); registerCmd(TOP_CMD, WRAP_METHOD(Console, Cmd_Top)); } @@ -241,6 +242,21 @@ bool Console::Cmd_DumpFile(int argc, const char **argv) { return true; } + +bool Console::Cmd_SourcePath(int argc, const char **argv) { + if (argc != 2) { + debugPrintf("Usage: %s \n", argv[0]); + return true; + } else { + if (CONTROLLER->setSourcePath(Common::String(argv[1])).getErrorCode() == OK) { + debugPrintf("Source path set to '%s'\n", CONTROLLER->getSourcePath().c_str()); + } else { + debugPrintf("Error setting source path. Note that \"\" is illegal."); + } + return true; + } +} + void Console::notifyBreakpoint(const char *filename, int line) { debugPrintf("Breakpoint hit %s: %d\n", filename, line); printSource(0); -- cgit v1.2.3