OSDN Git Service

77473d1ade23e494e36d9557b34446949cff7551
[qt-creator-jp/qt-creator-jp.git] / src / plugins / debugger / qml / qmlcppengine.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
8 **
9 ** No Commercial Usage
10 **
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
14 ** this package.
15 **
16 ** GNU Lesser General Public License Usage
17 **
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file.  Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights.  These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
31 **
32 **************************************************************************/
33
34 #ifndef QMLGDBENGINE_H
35 #define QMLGDBENGINE_H
36
37 #include "debuggerengine.h"
38
39 #include <QtCore/QScopedPointer>
40
41 namespace Debugger {
42 namespace Internal {
43
44 class QmlCppEnginePrivate;
45
46 class DEBUGGER_EXPORT QmlCppEngine : public DebuggerEngine
47 {
48     Q_OBJECT
49
50 public:
51     explicit QmlCppEngine(const DebuggerStartParameters &sp,
52                           DebuggerEngineType slaveEngineType,
53                           QString *errorMessage);
54     ~QmlCppEngine();
55
56     bool setToolTipExpression(const QPoint &mousePos,
57         TextEditor::ITextEditor * editor, const DebuggerToolTipContext &);
58     void updateWatchData(const WatchData &data,
59         const WatchUpdateFlags &flags);
60
61     void watchPoint(const QPoint &);
62     void fetchMemory(MemoryAgent *, QObject *, quint64 addr, quint64 length);
63     void fetchDisassembler(DisassemblerAgent *);
64     void activateFrame(int index);
65
66     void reloadModules();
67     void examineModules();
68     void loadSymbols(const QString &moduleName);
69     void loadAllSymbols();
70     void requestModuleSymbols(const QString &moduleName);
71
72     void reloadRegisters();
73     void reloadSourceFiles();
74     void reloadFullStack();
75
76     void setRegisterValue(int regnr, const QString &value);
77     unsigned debuggerCapabilities() const;
78     virtual bool canWatchWidgets() const;
79     virtual bool acceptsWatchesWhileRunning() const;
80
81     bool isSynchronous() const;
82     QByteArray qtNamespace() const;
83
84     void createSnapshot();
85     void updateAll();
86
87     void attemptBreakpointSynchronization();
88     bool acceptsBreakpoint(BreakpointId id) const;
89     void selectThread(int index);
90
91     void assignValueInDebugger(const WatchData *data,
92         const QString &expr, const QVariant &value);
93
94     DebuggerEngine *cppEngine() const;
95     void handleRemoteSetupDone(int gdbServerPort, int qmlPort);
96     void handleRemoteSetupFailed(const QString &message);
97
98     void showMessage(const QString &msg, int channel = LogDebug,
99         int timeout = -1) const;
100
101 protected:
102     void detachDebugger();
103     void executeStep();
104     void executeStepOut();
105     void executeNext();
106     void executeStepI();
107     void executeNextI();
108     void executeReturn();
109     void continueInferior();
110     void interruptInferior();
111     void requestInterruptInferior();
112
113     void executeRunToLine(const ContextData &data);
114     void executeRunToFunction(const QString &functionName);
115     void executeJumpToLine(const ContextData &data);
116     void executeDebuggerCommand(const QString &command);
117
118     void setupEngine();
119     void setupInferior();
120     void runEngine();
121     void shutdownInferior();
122     void shutdownEngine();
123
124     void notifyInferiorRunOk();
125     void notifyInferiorSpontaneousStop();
126     void notifyEngineRunAndInferiorRunOk();
127     void notifyInferiorShutdownOk();
128
129 private:
130     void engineStateChanged(DebuggerState newState);
131     void setState(DebuggerState newState, bool forced = false);
132     void slaveEngineStateChanged(DebuggerEngine *slaveEngine, DebuggerState state);
133
134     void readyToExecuteQmlStep();
135
136 private:
137     QScopedPointer<QmlCppEnginePrivate> d;
138 };
139
140 } // namespace Internal
141 } // namespace Debugger
142
143 #endif // QMLGDBENGINE_H