Changeset View
Changeset View
Standalone View
Standalone View
debuggers/gdb/variablecontroller.h
- This file was copied to debuggers/common/mivariablecontroller.h.
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * GDB Debugger Support | 2 | * GDB-specific variable controller implementation | ||
3 | * Copyright 2016 Aetf <aetf@unlimitedcodeworks.xyz> | ||||
3 | * | 4 | * | ||
4 | * Copyright 2007 Hamish Rodda <rodda@kde.org> | 5 | * This program is free software; you can redistribute it and/or | ||
5 | * Copyright 2008 Vladimir Prus <ghost@cs.msu.su> | 6 | * modify it under the terms of the GNU General Public License as | ||
6 | * Copyright 2009 Niko Sams <niko.sams@gmail.com> | 7 | * published by the Free Software Foundation; either version 2 of | ||
7 | * | 8 | * the License or (at your option) version 3 or any later version | ||
8 | * This program is free software; you can redistribute it and/or modify | 9 | * accepted by the membership of KDE e.V. (or its successor approved | ||
9 | * it under the terms of the GNU General Public License as | 10 | * by the membership of KDE e.V.), which shall act as a proxy | ||
10 | * published by the Free Software Foundation; either version 2 of the | 11 | * defined in Section 14 of version 3 of the license. | ||
11 | * License, or (at your option) any later version. | | |||
12 | * | 12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | 13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. | ||
17 | * | 17 | * | ||
18 | * You should have received a copy of the GNU General Public | 18 | * You should have received a copy of the GNU General Public License | ||
19 | * License along with this program; if not, write to the | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
20 | * Free Software Foundation, Inc., | 20 | * | ||
21 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | | |||
22 | */ | 21 | */ | ||
23 | 22 | | |||
24 | #ifndef GDBDEBUGGER_VARIABLECONTROLLER_H | 23 | #ifndef VARIABLECONTROLLER_H | ||
25 | #define GDBDEBUGGER_VARIABLECONTROLLER_H | 24 | #define VARIABLECONTROLLER_H | ||
26 | | ||||
27 | #include <debugger/interfaces/ivariablecontroller.h> | | |||
28 | | ||||
29 | #include "gdbglobal.h" | | |||
30 | | ||||
31 | using namespace KDevelop; | | |||
32 | 25 | | |||
33 | namespace GDBMI { | 26 | #include "mivariablecontroller.h" | ||
34 | struct AsyncRecord; | | |||
35 | struct ResultRecord; | | |||
36 | struct Value; | | |||
37 | } | | |||
38 | 27 | | |||
39 | namespace GDBDebugger { | 28 | namespace KDevMI { namespace GDB { | ||
40 | 29 | | |||
41 | class GDBController; | | |||
42 | class DebugSession; | 30 | class DebugSession; | ||
43 | 31 | class VariableController : public MIVariableController | |||
44 | class VariableController : public KDevelop::IVariableController | | |||
45 | { | 32 | { | ||
46 | Q_OBJECT | 33 | Q_OBJECT | ||
47 | 34 | | |||
48 | public: | 35 | public: | ||
49 | VariableController(DebugSession* parent); | 36 | VariableController(DebugSession* parent); | ||
50 | 37 | | |||
51 | Variable* createVariable(TreeModel* model, TreeItem* parent, | | |||
52 | const QString& expression, | | |||
53 | const QString& display = "") override; | | |||
54 | KTextEditor::Range expressionRangeUnderCursor(KTextEditor::Document* doc, const KTextEditor::Cursor& cursor) override; | | |||
55 | void addWatch(KDevelop::Variable* variable) override; | | |||
56 | void addWatchpoint(KDevelop::Variable* variable) override; | | |||
57 | void update() override; | | |||
58 | | ||||
59 | private slots: | | |||
60 | void programStopped(const GDBMI::AsyncRecord &r); | | |||
61 | void stateChanged(KDevelop::IDebugSession::DebuggerState); | | |||
62 | | ||||
63 | private: | 38 | private: | ||
64 | DebugSession* debugSession() const; | 39 | DebugSession* debugSession() const; | ||
65 | | ||||
66 | void updateLocals(); | | |||
67 | | ||||
68 | void handleVarUpdate(const GDBMI::ResultRecord& r); | | |||
69 | void addWatch(const GDBMI::ResultRecord& r); | | |||
70 | void addWatchpoint(const GDBMI::ResultRecord& r); | | |||
71 | | ||||
72 | void handleEvent(IDebugSession::event_t event) override; | | |||
73 | }; | 40 | }; | ||
74 | 41 | | |||
75 | } | 42 | } // end of namespace GDB | ||
43 | } // end of namespace KDevMI | ||||
76 | 44 | | |||
77 | #endif // GDBDEBUGGER_VARIABLECONTROLLER_H | 45 | #endif // VARIABLECONTROLLER_H |