diff options
author | Tobia Tesan | 2016-02-29 15:29:27 +0100 |
---|---|---|
committer | Tobia Tesan | 2016-03-01 20:40:45 +0100 |
commit | de82216dff8fc3339c493cb1a4913eea119d614f (patch) | |
tree | 8209fab51f65149283f2efc286091f39a804d09e /engines/wintermute/debugger | |
parent | 4926cc7cff3be8e63d590d6e1367f371e63655d5 (diff) | |
download | scummvm-rg350-de82216dff8fc3339c493cb1a4913eea119d614f.tar.gz scummvm-rg350-de82216dff8fc3339c493cb1a4913eea119d614f.tar.bz2 scummvm-rg350-de82216dff8fc3339c493cb1a4913eea119d614f.zip |
WINTERMUTE: Add source functionality in debugger
Diffstat (limited to 'engines/wintermute/debugger')
-rw-r--r-- | engines/wintermute/debugger/debugger_controller.cpp | 17 | ||||
-rw-r--r-- | engines/wintermute/debugger/debugger_controller.h | 4 |
2 files changed, 17 insertions, 4 deletions
diff --git a/engines/wintermute/debugger/debugger_controller.cpp b/engines/wintermute/debugger/debugger_controller.cpp index a7f7c2ea4a..c7c88be034 100644 --- a/engines/wintermute/debugger/debugger_controller.cpp +++ b/engines/wintermute/debugger/debugger_controller.cpp @@ -33,17 +33,19 @@ #include "engines/wintermute/debugger/breakpoint.h" #include "engines/wintermute/debugger/debugger_controller.h" #include "engines/wintermute/debugger/listing_providers/blank_listing_provider.h" +#include "engines/wintermute/debugger/listing_providers/cached_source_listing_provider.h" +#include "engines/wintermute/debugger/listing_providers/source_listing.h" #define SCENGINE _engine->_game->_scEngine #define DEBUGGER _engine->_debugger namespace Wintermute { DebuggerController::~DebuggerController() { - delete _listingProvider; + delete _sourceListingProvider; } DebuggerController::DebuggerController(WintermuteEngine *vm) : _engine(vm) { - _listingProvider = new BlankListingProvider(); + _sourceListingProvider = new CachedSourceListingProvider(); clear(); } @@ -162,6 +164,15 @@ uint32 DebuggerController::getLastLine() const { return _lastLine; } +Common::String DebuggerController::getSourcePath() const { + return _sourceListingProvider->getPath(); +} + +Error DebuggerController::setSourcePath(const Common::String &sourcePath) { + ErrorCode err = _sourceListingProvider->setPath(sourcePath); + return Error((err == OK ? SUCCESS : ERROR), err); +} + Listing* DebuggerController::getListing(Error* &error) { delete (error); if (_lastScript == nullptr) { @@ -169,7 +180,7 @@ Listing* DebuggerController::getListing(Error* &error) { return nullptr; } ErrorCode err; - Listing* res = _listingProvider->getListing(SCENGINE->_currentScript->_filename, err); + Listing* res = _sourceListingProvider->getListing(SCENGINE->_currentScript->_filename, err); error = new Error(err == OK ? SUCCESS : ERROR, err); return res; } diff --git a/engines/wintermute/debugger/debugger_controller.h b/engines/wintermute/debugger/debugger_controller.h index b4119b56d3..7af2a039b1 100644 --- a/engines/wintermute/debugger/debugger_controller.h +++ b/engines/wintermute/debugger/debugger_controller.h @@ -51,7 +51,7 @@ struct TopEntry { }; class DebuggerController : public ScriptMonitor { - ListingProvider *_listingProvider; + SourceListingProvider *_sourceListingProvider; const WintermuteEngine *_engine; DebuggableScript *_lastScript; uint32 _lastDepth; @@ -83,6 +83,8 @@ public: * @brief continue execution and don't step until the current activation record is popped */ Error stepFinish(); + Error setSourcePath(const Common::String &sourcePath); + Common::String getSourcePath() const; Listing *getListing(Error* &err); void showFps(bool show); /** |