Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qv4debuggeragent.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QV4DEBUGGERAGENT_H
5#define QV4DEBUGGERAGENT_H
6
7#include "qv4debugger.h"
8
10
12
14{
16public:
17 QV4DebuggerAgent(QV4DebugServiceImpl *debugService) : m_debugService(debugService) {}
18
20 bool isRunning() const;
21
22 void addDebugger(QV4Debugger *debugger);
23 void removeDebugger(QV4Debugger *debugger);
24 const QList<QV4Debugger *> &debuggers();
25
26 void pause(QV4Debugger *debugger) const;
27 void pauseAll() const;
28 void resumeAll() const;
29 int addBreakPoint(const QString &fileName, int lineNumber, bool enabled = true, const QString &condition = QString());
30 void removeBreakPoint(int id);
32 void enableBreakPoint(int id, bool onoff);
33 QList<int> breakPointIds(const QString &fileName, int lineNumber) const;
34
35 bool breakOnThrow() const { return m_breakOnThrow; }
36 void setBreakOnThrow(bool onoff);
38
40 void handleDebuggerDeleted(QObject *debugger);
41
42private:
43 QList<QV4Debugger *> m_debuggers;
44
45 struct BreakPoint {
47 int lineNr;
48 bool enabled;
50
51 BreakPoint(): lineNr(-1), enabled(false) {}
52 BreakPoint(const QString &fileName, int lineNr, bool enabled, const QString &condition)
53 : fileName(fileName), lineNr(lineNr), enabled(enabled), condition(condition)
54 {}
55
56 bool isValid() const { return lineNr >= 0 && !fileName.isEmpty(); }
57 };
58
59 QHash<int, BreakPoint> m_breakPoints;
60 int m_lastBreakPointId = 0;
61 bool m_breakOnThrow = false;
62 QV4DebugServiceImpl *m_debugService = nullptr;
63};
64
66
67#endif // QV4DEBUGGERAGENT_H
\inmodule QtCore
Definition qobject.h:103
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
void setBreakOnThrow(bool onoff)
QV4Debugger * pausedDebugger() const
const QList< QV4Debugger * > & debuggers()
QList< int > breakPointIds(const QString &fileName, int lineNumber) const
void handleDebuggerDeleted(QObject *debugger)
bool breakOnThrow() const
int addBreakPoint(const QString &fileName, int lineNumber, bool enabled=true, const QString &condition=QString())
QV4DebuggerAgent(QV4DebugServiceImpl *debugService)
void addDebugger(QV4Debugger *debugger)
void removeDebugger(QV4Debugger *debugger)
void pause(QV4Debugger *debugger) const
void removeBreakPoint(int id)
void enableBreakPoint(int id, bool onoff)
void debuggerPaused(QV4Debugger *debugger, QV4Debugger::PauseReason reason)
Combined button and popup list for selecting options.
GLenum condition
GLenum GLenum GLsizei const GLuint GLboolean enabled
#define Q_OBJECT