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"
32 namespace Wintermute {
33 
34 class ScScript;
35 class DebuggableScript;
36 class ScValue;
37 
39  Common::String _filename;
40  int _line;
41  int _hits;
42  bool _enabled;
43 };
44 
45 struct WatchInfo {
46  Common::String _filename;
47  Common::String _symbol;
48  int _hits;
49  bool _enabled;
50 };
51 
52 struct TopEntry {
53  bool current;
54  Common::String filename;
55  int watches;
56  int breakpointInfo;
57 };
58 
60  SourceListingProvider *_sourceListingProvider;
61  const WintermuteEngine *_engine;
62  DebuggableScript *_lastScript;
63  uint32 _lastLine;
64  void clear();
65  bool bytecodeExists(const Common::String &filename);
66 public:
68  ~DebuggerController() override;
69  Common::Array<TopEntry> getTop() const;
73  uint32 getLastLine() const;
74  Error addBreakpoint(const char *filename, int line);
75  Error removeBreakpoint(uint id);
76  Error disableBreakpoint(uint id);
77  Error enableBreakpoint(uint id);
78  Error addWatch(const char *filename, const char *symbol);
79  Error removeWatchpoint(uint id);
80  Error disableWatchpoint(uint id);
81  Error enableWatchpoint(uint id);
82  Common::Array<BreakpointInfo> getBreakpoints() const;
83  Common::Array<WatchInfo> getWatchlist() const;
87  Error step();
91  Error stepContinue();
95  Error stepFinish();
99  Common::String readValue(const Common::String &name, Error **error);
103  Error setValue(const Common::String &name, const Common::String &value, ScValue*&var);
104  Error setSourcePath(const Common::Path &sourcePath);
105  Common::Path getSourcePath() const;
106  Listing *getListing(Error* &err);
107  void showFps(bool show);
111  void onBreakpoint(const Breakpoint *breakpoint, DebuggableScript *script) override;
112  void onWatch(const Watch *watch, DebuggableScript *script) override;
113  void notifyStep(DebuggableScript *script) override;
114 };
115 }
116 
117 #endif // WINTERMUTE_DEBUGGER_H
Definition: script_value.h:42
Definition: str.h:59
Definition: array.h:52
Definition: path.h:52
Definition: debugger_controller.h:59
Definition: wintermute.h:51
Definition: source_listing_provider.h:35
Definition: debugger_controller.h:45
Definition: listing.h:35
Definition: watch.h:34
Definition: error.h:54
void NORETURN_PRE error(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
Definition: script_monitor.h:31
Definition: breakpoint.h:31
Definition: debugger_controller.h:38
Definition: debuggable_script.h:32
Definition: debugger_controller.h:52
Definition: achievements_tables.h:27