OSDN Git Service

Update license.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / debugger / debuggerconstants.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 (info@qt.nokia.com)
8 **
9 **
10 ** GNU Lesser General Public License Usage
11 **
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 **
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 **
23 ** Other Usage
24 **
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
27 **
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
30 **
31 **************************************************************************/
32
33 #ifndef DEBUGGERCONSTANTS_H
34 #define DEBUGGERCONSTANTS_H
35
36 #include <QtCore/QtGlobal>
37
38 namespace Debugger {
39 namespace Constants {
40
41 // modes and their priorities
42 const char * const MODE_DEBUG           = "Debugger.Mode.Debug";
43 const int          P_MODE_DEBUG         = 85;
44
45 // common actions
46 const char * const INTERRUPT            = "Debugger.Interrupt";
47 const char * const CONTINUE             = "Debugger.Continue";
48 const char * const STOP                 = "Debugger.Stop";
49 const char * const RESET                = "Debugger.Reset";
50 const char * const STEP                 = "Debugger.StepLine";
51 const char * const STEPOUT              = "Debugger.StepOut";
52 const char * const NEXT                 = "Debugger.NextLine";
53 const char * const REVERSE              = "Debugger.ReverseDirection";
54 const char * const OPERATE_BY_INSTRUCTION   = "Debugger.OperateByInstruction";
55
56 const char * const M_DEBUG_VIEWS        = "Debugger.Menu.View.Debug";
57
58 const char * const C_DEBUGMODE          = "Debugger.DebugMode";
59 const char * const C_CPPDEBUGGER        = "Gdb Debugger";
60 const char * const C_QMLDEBUGGER        = "Qml/JavaScript Debugger";
61
62 const char * const DEBUGGER_COMMON_SETTINGS_ID = "A.Common";
63 const char * const DEBUGGER_COMMON_SETTINGS_NAME =
64     QT_TRANSLATE_NOOP("Debugger", "General");
65 const char * const DEBUGGER_SETTINGS_CATEGORY = "O.Debugger";
66 const char * const DEBUGGER_SETTINGS_TR_CATEGORY =
67     QT_TRANSLATE_NOOP("Debugger", "Debugger");
68 const char * const DEBUGGER_COMMON_SETTINGS_CATEGORY_ICON =
69     ":/core/images/category_debug.png";
70
71 // dock widget names
72 const char * const DOCKWIDGET_BREAK      = "Debugger.Docks.Break";
73 const char * const DOCKWIDGET_CONSOLE    = "Debugger.Docks.Console";
74 const char * const DOCKWIDGET_MODULES    = "Debugger.Docks.Modules";
75 const char * const DOCKWIDGET_REGISTER   = "Debugger.Docks.Register";
76 const char * const DOCKWIDGET_OUTPUT     = "Debugger.Docks.Output";
77 const char * const DOCKWIDGET_SNAPSHOTS  = "Debugger.Docks.Snapshots";
78 const char * const DOCKWIDGET_STACK      = "Debugger.Docks.Stack";
79 const char * const DOCKWIDGET_SOURCE_FILES = "Debugger.Docks.SourceFiles";
80 const char * const DOCKWIDGET_THREADS    = "Debugger.Docks.Threads";
81 const char * const DOCKWIDGET_WATCHERS   = "Debugger.Docks.LocalsAndWatchers";
82
83 const char * const DOCKWIDGET_QML_INSPECTOR = "Debugger.Docks.QmlInspector";
84 const char * const DOCKWIDGET_QML_SCRIPTCONSOLE = "Debugger.Docks.ScriptConsole";
85 const char * const DOCKWIDGET_DEFAULT_AREA = "Debugger.Docks.DefaultArea";
86
87 namespace Internal {
88     enum { debug = 0 };
89 } // namespace Internal
90
91 const char * const OPENED_BY_DEBUGGER         = "OpenedByDebugger";
92 const char * const OPENED_WITH_DISASSEMBLY    = "DisassemblerView";
93 const char * const OPENED_WITH_MEMORY         = "MemoryView";
94
95 const char * const DEBUGMODE            = "Debugger.DebugMode";
96 const char * const DEBUG                = "Debugger.Debug";
97 const int          P_ACTION_DEBUG       = 90; //priority for the modemanager
98 #ifdef Q_OS_MAC
99 const char * const DEBUG_KEY = "Ctrl+Y";
100 #else
101 const char * const DEBUG_KEY = "F5";
102 #endif
103
104 } // namespace Constants
105
106
107 enum DebuggerState
108 {
109     DebuggerNotReady,          // Debugger not started
110
111     EngineSetupRequested,      // Engine starts
112     EngineSetupFailed,
113     EngineSetupOk,
114
115     InferiorSetupRequested,
116     InferiorSetupFailed,
117     InferiorSetupOk,
118
119     EngineRunRequested,
120     EngineRunFailed,
121
122     InferiorUnrunnable,        // Used in the core dump adapter
123
124     InferiorRunRequested,      // Debuggee requested to run
125     InferiorRunOk,             // Debuggee running
126     InferiorRunFailed,         // Debuggee running
127
128     InferiorStopRequested,     // Debuggee running, stop requested
129     InferiorStopOk,            // Debuggee stopped
130     InferiorStopFailed,        // Debuggee not stopped, will kill debugger
131
132     InferiorExitOk,
133
134     InferiorShutdownRequested,
135     InferiorShutdownFailed,
136     InferiorShutdownOk,
137
138     EngineShutdownRequested,
139     EngineShutdownFailed,
140     EngineShutdownOk,
141
142     DebuggerFinished
143 };
144
145 enum DebuggerStartMode
146 {
147     NoStartMode,
148     StartInternal,         // Start current start project's binary
149     StartExternal,         // Start binary found in file system
150     AttachExternal,        // Attach to running process by process id
151     AttachCrashedExternal, // Attach to crashed process by process id
152     AttachTcf,             // Attach to a running Target Communication Framework agent
153     AttachCore,            // Attach to a core file
154     AttachToRemote,        // Start and attach to a remote process
155     StartRemoteGdb,        // Start gdb itself remotely
156     StartRemoteEngine      // Start ipc guest engine on other machine
157 };
158
159 enum DebuggerCapabilities
160 {
161     ReverseSteppingCapability = 0x1,
162     SnapshotCapability = 0x2,
163     AutoDerefPointersCapability = 0x4,
164     DisassemblerCapability = 0x8,
165     RegisterCapability = 0x10,
166     ShowMemoryCapability = 0x20,
167     JumpToLineCapability = 0x40,
168     ReloadModuleCapability = 0x80,
169     ReloadModuleSymbolsCapability = 0x100,
170     BreakOnThrowAndCatchCapability = 0x200,
171     BreakConditionCapability = 0x400, //!< Conditional Breakpoints
172     BreakModuleCapability = 0x800, //!< Breakpoint specification includes module
173     TracePointCapability = 0x1000,
174     ReturnFromFunctionCapability = 0x2000,
175     CreateFullBacktraceCapability = 0x4000,
176     AddWatcherCapability = 0x8000,
177     WatchpointCapability = 0x10000,
178     ShowModuleSymbolsCapability = 0x20000,
179     CatchCapability = 0x40000, //!< fork, vfork, syscall
180     AllDebuggerCapabilities = 0xFFFFFFFF
181 };
182
183 enum LogChannel
184 {
185     LogInput,                // Used for user input
186     LogMiscInput,            // Used for misc stuff in the input pane
187     LogOutput,
188     LogWarning,
189     LogError,
190     LogStatus,               // Used for status changed messages
191     LogTime,                 // Used for time stamp messages
192     LogDebug,
193     LogMisc,
194     AppOutput,
195     AppError,
196     AppStuff,
197     StatusBar,                // LogStatus and also put to the status bar
198     ScriptConsoleOutput
199 };
200
201 enum ModelRoles
202 {
203     DisplaySourceRole = 32,  // Qt::UserRole
204
205     EngineStateRole,
206     EngineCapabilitiesRole,
207     EngineActionsEnabledRole,
208     RequestActivationRole,
209     RequestContextMenuRole,
210
211     // Locals and Watchers
212     LocalsINameRole,
213     LocalsEditTypeRole,     // A QVariant::type describing the item
214     LocalsIntegerBaseRole,  // Number base 16, 10, 8, 2
215     LocalsExpressionRole,
216     LocalsRawExpressionRole,
217     LocalsExpandedRole,     // The preferred expanded state to the view
218     LocalsTypeFormatListRole,
219     LocalsTypeFormatRole,   // Used to communicate alternative formats to the view
220     LocalsIndividualFormatRole,
221     LocalsAddressRole,      // Memory address of variable as quint64
222     LocalsRawValueRole,     // Unformatted value as string
223     LocalsPointerValueRole, // Pointer value (address) as quint64
224     LocalsIsWatchpointAtAddressRole,
225     LocalsIsWatchpointAtPointerValueRole,
226
227     // Snapshots
228     SnapshotCapabilityRole
229 };
230
231 enum DebuggerEngineType
232 {
233     NoEngineType      = 0,
234     GdbEngineType     = 0x01,
235     ScriptEngineType  = 0x02,
236     CdbEngineType     = 0x04,
237     PdbEngineType     = 0x08,
238     TcfEngineType     = 0x10,
239     QmlEngineType     = 0x20,
240     QmlCppEngineType  = 0x40,
241     LldbEngineType  = 0x80,
242     AllEngineTypes = GdbEngineType
243         | ScriptEngineType
244         | CdbEngineType
245         | PdbEngineType
246         | TcfEngineType
247         | QmlEngineType
248         | QmlCppEngineType
249         | LldbEngineType
250 };
251
252 enum DebuggerLanguage
253 {
254     AnyLanguage       = 0x0,
255     CppLanguage      = 0x1,
256     QmlLanguage      = 0x2
257 };
258 Q_DECLARE_FLAGS(DebuggerLanguages, DebuggerLanguage)
259
260 } // namespace Debugger
261
262 #endif // DEBUGGERCONSTANTS_H
263