ScummVM API documentation
debugger_controller.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef WINTERMUTE_DEBUGGER_ADAPTER_H
23#define WINTERMUTE_DEBUGGER_ADAPTER_H
24
25#include "common/str.h"
26#include "engines/wintermute/coll_templ.h"
27#include "engines/wintermute/wintermute.h"
28#include "engines/wintermute/debugger/listing_providers/source_listing_provider.h"
29#include "engines/wintermute/debugger/script_monitor.h"
30#include "error.h"
31#include "engines/wintermute/debugger/listing.h"
32namespace Wintermute {
33
34class ScScript;
35class DebuggableScript;
36class ScValue;
37
39 Common::String _filename;
40 int _line;
41 int _hits;
42 bool _enabled;
43};
44
45struct WatchInfo {
46 Common::String _filename;
47 Common::String _symbol;
48 int _hits;
49 bool _enabled;
50};
51
52struct TopEntry {
53 bool current;
54 Common::String filename;
55 int watches;
56 int breakpointInfo;
57};
58
59#if EXTENDED_DEBUGGER_ENABLED
60
61class DebuggerController : public ScriptMonitor {
62 SourceListingProvider *_sourceListingProvider;
63 const WintermuteEngine *_engine;
64 DebuggableScript *_lastScript;
65 uint32 _lastLine;
66 void clear();
67 bool bytecodeExists(const Common::String &filename);
68public:
69 DebuggerController(WintermuteEngine *vm);
70 ~DebuggerController() override;
71 Common::Array<TopEntry> getTop() const;
75 uint32 getLastLine() const;
76 Error addBreakpoint(const char *filename, int line);
77 Error removeBreakpoint(uint id);
78 Error disableBreakpoint(uint id);
79 Error enableBreakpoint(uint id);
80 Error addWatch(const char *filename, const char *symbol);
81 Error removeWatchpoint(uint id);
82 Error disableWatchpoint(uint id);
83 Error enableWatchpoint(uint id);
84 Common::Array<BreakpointInfo> getBreakpoints() const;
85 Common::Array<WatchInfo> getWatchlist() const;
89 Error step();
93 Error stepContinue();
97 Error stepFinish();
101 Common::String readValue(const Common::String &name, Error **error);
105 Error setValue(const Common::String &name, const Common::String &value, ScValue*&var);
106 Error setSourcePath(const Common::Path &sourcePath);
107 Common::Path getSourcePath() const;
108 Listing *getListing(Error* &err);
109 void showFps(bool show);
113 void onBreakpoint(const Breakpoint *breakpoint, DebuggableScript *script) override;
114 void onWatch(const Watch *watch, DebuggableScript *script) override;
115 void notifyStep(DebuggableScript *script) override;
116};
117
118#endif
119
120}
121
122#endif // WINTERMUTE_DEBUGGER_H
Definition: array.h:52
Definition: path.h:52
Definition: str.h:59
Definition: breakpoint.h:31
Definition: debuggable_script.h:32
Definition: error.h:54
Definition: listing.h:35
Definition: script_value.h:42
Definition: script_monitor.h:31
Definition: source_listing_provider.h:35
Definition: watch.h:34
Definition: wintermute.h:51
void NORETURN_PRE error(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
Definition: debugger_controller.h:38
Definition: debugger_controller.h:52
Definition: debugger_controller.h:45