debuggeractions.h 4.74 KB
Newer Older
hjk's avatar
hjk committed
1 2 3 4
/**************************************************************************
**
** This file is part of Qt Creator
**
hjk's avatar
hjk committed
5
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
hjk's avatar
hjk committed
6
**
7
** Contact: Nokia Corporation (qt-info@nokia.com)
hjk's avatar
hjk committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
hjk's avatar
hjk committed
26
** contact the sales department at http://qt.nokia.com/contact.
hjk's avatar
hjk committed
27 28 29 30 31 32
**
**************************************************************************/

#ifndef DEBUGGER_ACTIONS_H
#define DEBUGGER_ACTIONS_H

33
#include <QtCore/QHash>
34 35
#include <QtCore/QMap>
#include <QtCore/QSharedPointer>
36

37
QT_BEGIN_NAMESPACE
38
class QAction;
39
class QActionGroup;
40
class QSettings;
41
QT_END_NAMESPACE
42

43 44 45 46
namespace Utils {
    class SavedAction;
}

47 48
namespace Debugger {
namespace Internal {
49

hjk's avatar
hjk committed
50
class DebuggerSettings : public QObject
51 52 53
{
    Q_OBJECT
public:
54 55 56 57
    typedef QMultiMap<QString, int> GdbBinaryToolChainMap;
    typedef QSharedPointer<GdbBinaryToolChainMap> GdbBinaryToolChainMapPtr;

    explicit DebuggerSettings(QObject *parent = 0);
hjk's avatar
hjk committed
58
    ~DebuggerSettings();
dt's avatar
dt committed
59

60 61
    GdbBinaryToolChainMapPtr gdbBinaryToolChainMap() const { return m_gdbBinaryToolChainMap; }

62 63
    void insertItem(int code, Utils::SavedAction *item);
    Utils::SavedAction *item(int code) const;
64

65
    QString dump() const;
66

67 68
    static DebuggerSettings *instance();

69 70
public slots:
    void readSettings(QSettings *settings);
71
    void writeSettings(QSettings *settings) const;
72 73

private:
74
    QHash<int, Utils::SavedAction *> m_items;
75 76

    const GdbBinaryToolChainMapPtr m_gdbBinaryToolChainMap;
77 78 79 80 81
};


///////////////////////////////////////////////////////////

hjk's avatar
hjk committed
82
enum DebuggerActionCode
hjk's avatar
hjk committed
83 84 85 86 87
{
    // General
    SettingsDialog,
    AdjustColumnWidths,
    AlwaysAdjustColumnWidths,
88
    UseAlternatingRowColors,
89
    UseMessageBoxForSignals,
hjk's avatar
hjk committed
90
    AutoQuit,
hjk's avatar
hjk committed
91
    LockView,
92
    LogTimeStamps,
93
    VerboseLog,
94
    OperateByInstruction,
95
    AutoDerefPointers,
hjk's avatar
hjk committed
96

97 98 99 100 101
    RecheckDebuggingHelpers,
    UseDebuggingHelpers,
    UseCustomDebuggingHelperLocation,
    CustomDebuggingHelperLocation,
    DebugDebuggingHelpers,
102 103

    UseCodeModel,
104

105 106 107 108 109 110 111
    UseToolTipsInMainEditor,
    UseToolTipsInLocalsView,
    UseToolTipsInBreakpointsView,
    UseToolTipsInStackView,
    UseAddressInBreakpointsView,
    UseAddressInStackView,

112 113
    RegisterForPostMortem,

hjk's avatar
hjk committed
114 115 116
    // Gdb
    GdbEnvironment,
    GdbScriptFile,
117
    ExecuteCommand,
118
    GdbWatchdogTimeout,
hjk's avatar
hjk committed
119

120 121
    // Stack
    MaximalStackDepth,
122
    ExpandStack,
123
    CreateFullBacktrace,
124

hjk's avatar
hjk committed
125 126
    // Watchers & Locals
    WatchExpression,
127
    WatchExpressionInWindow,
hjk's avatar
hjk committed
128
    RemoveWatchExpression,
129
    WatchPoint,
hjk's avatar
hjk committed
130
    AssignValue,
hjk's avatar
hjk committed
131
    AssignType,
132 133
    ShowStdNamespace,
    ShowQtNamespace,
hjk's avatar
hjk committed
134

hjk's avatar
hjk committed
135 136 137 138
    // Source List
    ListSourceFiles,

    // Running
139
    SkipKnownFrames,
140
    EnableReverseDebugging,
hjk's avatar
hjk committed
141 142 143 144 145 146 147

    // Breakpoints
    SynchronizeBreakpoints,
    AllPluginBreakpoints,
    SelectedPluginBreakpoints,
    NoPluginBreakpoints,
    SelectedPluginBreakpointsPattern,
148 149
    UsePreciseBreakpoints,
    BreakOnThrow,
150 151 152 153
    BreakOnCatch,

    // UI/Language switching
    SwitchLanguageAutomatically
154
};
hjk's avatar
hjk committed
155

156
// singleton access
157
Utils::SavedAction *theDebuggerAction(int code);
hjk's avatar
hjk committed
158

159
// convenience
hjk's avatar
hjk committed
160 161
bool theDebuggerBoolSetting(int code);
QString theDebuggerStringSetting(int code);
hjk's avatar
hjk committed
162

163 164
struct DebuggerManagerActions
{
165 166 167 168 169
    QAction *continueAction;
    QAction *stopAction;
    QAction *resetAction; // FIXME: Should not be needed in a stable release
    QAction *stepAction;
    QAction *stepOutAction;
170 171
    QAction *runToLineAction1; // in the Debug menu
    QAction *runToLineAction2; // in the text editor context menu
172
    QAction *runToFunctionAction;
173 174
    QAction *jumpToLineAction1; // in the Debug menu
    QAction *jumpToLineAction2; // in the text editor context menu
175
    QAction *returnFromFunctionAction;
176
    QAction *nextAction;
177
    QAction *snapshotAction;
178 179
    QAction *watchAction1; // in the Debug menu
    QAction *watchAction2; // in the text editor context menu
180 181 182 183 184
    QAction *breakAction;
    QAction *sepAction;
    QAction *reverseDirectionAction;
};

hjk's avatar
hjk committed
185 186 187 188
} // namespace Internal
} // namespace Debugger

#endif // DEBUGGER_WATCHWINDOW_H