OSDN Git Service

It's 2011 now.
[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 (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 DEBUGGERCONSTANTS_H
35 #define DEBUGGERCONSTANTS_H
36
37 #include <QtCore/QtGlobal>
38
39 namespace Debugger {
40 namespace Constants {
41
42 // modes and their priorities
43 const char * const MODE_DEBUG           = "Debugger.Mode.Debug";
44 const int          P_MODE_DEBUG         = 85;
45
46 // common actions
47 const char * const STOP                 = "Debugger.Interrupt";
48 const char * const RESET                = "Debugger.Reset";
49 const char * const STEP                 = "Debugger.StepLine";
50 const char * const STEPOUT              = "Debugger.StepOut";
51 const char * const NEXT                 = "Debugger.NextLine";
52 const char * const REVERSE              = "Debugger.ReverseDirection";
53
54 const char * const M_DEBUG_VIEWS        = "Debugger.Menu.View.Debug";
55
56 const char * const C_DEBUGMODE          = "Debugger.DebugMode";
57 const char * const C_CPPDEBUGGER        = "Gdb Debugger";
58 const char * const C_QMLDEBUGGER        = "Qml/JavaScript Debugger";
59
60 const char * const DEBUGGER_COMMON_SETTINGS_ID = "A.Common";
61 const char * const DEBUGGER_COMMON_SETTINGS_NAME =
62     QT_TRANSLATE_NOOP("Debugger", "General");
63 const char * const DEBUGGER_SETTINGS_CATEGORY = "O.Debugger";
64 const char * const DEBUGGER_SETTINGS_TR_CATEGORY =
65     QT_TRANSLATE_NOOP("Debugger", "Debugger");
66 const char * const DEBUGGER_COMMON_SETTINGS_CATEGORY_ICON =
67     ":/core/images/category_debug.png";
68
69 // dock widget names
70 const char * const DOCKWIDGET_BREAK      = "Debugger.Docks.Break";
71 const char * const DOCKWIDGET_CONSOLE    = "Debugger.Docks.Console";
72 const char * const DOCKWIDGET_MODULES    = "Debugger.Docks.Modules";
73 const char * const DOCKWIDGET_REGISTER   = "Debugger.Docks.Register";
74 const char * const DOCKWIDGET_OUTPUT     = "Debugger.Docks.Output";
75 const char * const DOCKWIDGET_SNAPSHOTS  = "Debugger.Docks.Snapshots";
76 const char * const DOCKWIDGET_STACK      = "Debugger.Docks.Stack";
77 const char * const DOCKWIDGET_SOURCE_FILES = "Debugger.Docks.SourceFiles";
78 const char * const DOCKWIDGET_THREADS    = "Debugger.Docks.Threads";
79 const char * const DOCKWIDGET_WATCHERS   = "Debugger.Docks.LocalsAndWatchers";
80
81 const char * const DOCKWIDGET_QML_INSPECTOR = "Debugger.Docks.QmlInspector";
82 const char * const DOCKWIDGET_QML_SCRIPTCONSOLE = "Debugger.Docks.ScriptConsole";
83 const char * const DOCKWIDGET_DEFAULT_AREA = "Debugger.Docks.DefaultArea";
84
85 namespace Internal {
86     enum { debug = 0 };
87 } // namespace Internal
88
89 const char * const OPENED_BY_DEBUGGER         = "OpenedByDebugger";
90 const char * const OPENED_WITH_DISASSEMBLY    = "DisassemblerView";
91 const char * const OPENED_WITH_MEMORY         = "MemoryView";
92
93 const char * const DEBUGMODE            = "Debugger.DebugMode";
94 const char * const DEBUG                = "Debugger.Debug";
95 const int          P_ACTION_DEBUG       = 90; //priority for the modemanager
96 #ifdef Q_OS_MAC
97 const char * const DEBUG_KEY = "Ctrl+Y";
98 #else
99 const char * const DEBUG_KEY = "F5";
100 #endif
101
102 } // namespace Constants
103
104
105 enum DebuggerState
106 {
107     DebuggerNotReady,          // Debugger not started
108
109     EngineSetupRequested,      // Engine starts
110     EngineSetupFailed,
111     EngineSetupOk,
112
113     InferiorSetupRequested,
114     InferiorSetupFailed,
115
116     EngineRunRequested,
117     EngineRunFailed,
118     InferiorUnrunnable,        // Used in the core dump adapter
119
120     InferiorRunRequested,      // Debuggee requested to run
121     InferiorRunOk,             // Debuggee running
122     InferiorRunFailed,         // Debuggee running
123
124     InferiorStopRequested,     // Debuggee running, stop requested
125     InferiorStopOk,            // Debuggee stopped
126     InferiorStopFailed,        // Debuggee not stopped, will kill debugger
127
128     InferiorShutdownRequested,
129     InferiorShutdownOk,
130     InferiorShutdownFailed,
131
132     EngineShutdownRequested,
133     EngineShutdownOk,
134     EngineShutdownFailed,
135
136     DebuggerFinished
137 };
138
139 enum DebuggerStartMode
140 {
141     NoStartMode,
142     StartInternal,         // Start current start project's binary
143     StartExternal,         // Start binary found in file system
144     AttachExternal,        // Attach to running process by process id
145     AttachCrashedExternal, // Attach to crashed process by process id
146     AttachTcf,             // Attach to a running Target Communication Framework agent
147     AttachCore,            // Attach to a core file
148     AttachToRemote,        // Start and attach to a remote process
149     StartRemoteGdb,        // Start gdb itself remotely
150     StartRemoteEngine      // Start ipc guest engine on other machine
151 };
152
153 enum DebuggerCapabilities
154 {
155     ReverseSteppingCapability = 0x1,
156     SnapshotCapability = 0x2,
157     AutoDerefPointersCapability = 0x4,
158     DisassemblerCapability = 0x80,
159     RegisterCapability = 0x10,
160     ShowMemoryCapability = 0x20,
161     JumpToLineCapability = 0x40,
162     ReloadModuleCapability = 0x80,
163     ReloadModuleSymbolsCapability = 0x100,
164     BreakOnThrowAndCatchCapability = 0x200,
165     ReturnFromFunctionCapability = 0x400,
166     CreateFullBacktraceCapability = 0x800,
167     AddWatcherCapability = 0x1000,
168     WatchpointCapability = 0x2000,
169     ShowModuleSymbolsCapability = 0x4000
170 };
171
172 enum LogChannel
173 {
174     LogInput,                // Used for user input
175     LogMiscInput,            // Used for misc stuff in the input pane
176     LogOutput,
177     LogWarning,
178     LogError,
179     LogStatus,               // Used for status changed messages
180     LogTime,                 // Used for time stamp messages
181     LogDebug,
182     LogMisc,
183     AppOutput,
184     AppError,
185     AppStuff,
186     StatusBar,                // LogStatus and also put to the status bar
187     ScriptConsoleOutput
188 };
189
190 enum ModelRoles
191 {
192     DisplaySourceRole = 32,  // Qt::UserRole
193
194     EngineStateRole,
195     EngineCapabilitiesRole,
196     EngineActionsEnabledRole,
197     RequestActivationRole,
198     RequestContextMenuRole,
199
200     // Locals and Watchers
201     LocalsINameRole,
202     LocalsEditTypeRole,     // A QVariant::type describing the item
203     LocalsIntegerBaseRole,  // Number base 16, 10, 8, 2
204     LocalsExpressionRole,
205     LocalsExpandedRole,     // The preferred expanded state to the view
206     LocalsTypeFormatListRole,
207     LocalsTypeFormatRole,   // Used to communicate alternative formats to the view
208     LocalsIndividualFormatRole,
209     LocalsAddressRole,      // Memory address of variable as quint64
210     LocalsRawValueRole,     // Unformatted value as string
211     LocalsPointerValueRole, // Pointer value (address) as quint64
212     LocalsIsWatchpointAtAddressRole,
213     LocalsIsWatchpointAtPointerValueRole,
214
215     // Snapshots
216     SnapshotCapabilityRole
217 };
218
219 enum DebuggerEngineType
220 {
221     NoEngineType      = 0,
222     GdbEngineType     = 0x01,
223     ScriptEngineType  = 0x02,
224     CdbEngineType     = 0x04,
225     PdbEngineType     = 0x08,
226     TcfEngineType     = 0x10,
227     QmlEngineType     = 0x20,
228     QmlCppEngineType  = 0x40,
229     LldbEngineType  = 0x80,
230     AllEngineTypes = GdbEngineType
231         | ScriptEngineType
232         | CdbEngineType
233         | PdbEngineType
234         | TcfEngineType
235         | QmlEngineType
236         | QmlCppEngineType
237         | LldbEngineType
238 };
239
240 enum DebuggerLanguage
241 {
242     AnyLanguage       = 0x0,
243     CppLanguage      = 0x1,
244     QmlLanguage      = 0x2
245 };
246 Q_DECLARE_FLAGS(DebuggerLanguages, DebuggerLanguage)
247
248 } // namespace Debugger
249
250 #endif // DEBUGGERCONSTANTS_H
251