2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 15:08:31 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#ifndef DEBUGGERCONSTANTS_H
|
|
|
|
#define DEBUGGERCONSTANTS_H
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QFlags>
|
2009-04-17 09:03:32 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
namespace Debugger {
|
|
|
|
namespace Constants {
|
|
|
|
|
2011-04-21 15:52:51 +02:00
|
|
|
// Debug mode
|
2011-07-15 10:55:39 +02:00
|
|
|
const char MODE_DEBUG[] = "Mode.Debug";
|
2010-08-18 13:54:12 +02:00
|
|
|
|
2011-04-21 15:52:51 +02:00
|
|
|
// Contexts
|
2011-07-15 10:55:39 +02:00
|
|
|
const char C_DEBUGMODE[] = "Debugger.DebugMode";
|
|
|
|
const char C_CPPDEBUGGER[] = "Gdb Debugger";
|
|
|
|
const char C_QMLDEBUGGER[] = "Qml/JavaScript Debugger";
|
2011-04-21 15:52:51 +02:00
|
|
|
|
2016-03-02 13:57:37 +01:00
|
|
|
const char CppPerspectiveId[] = "Debugger.Perspective.Cpp";
|
|
|
|
const char QmlPerspectiveId[] = "Debugger.Perspective.Qml";
|
|
|
|
|
2011-10-10 13:38:58 +02:00
|
|
|
// Menu Groups
|
2012-08-15 16:19:15 +02:00
|
|
|
const char G_GENERAL[] = "Debugger.Group.General";
|
|
|
|
const char G_SPECIAL[] = "Debugger.Group.Special";
|
2011-10-19 11:51:51 +02:00
|
|
|
const char G_START_QML[] = "Debugger.Group.Start.Qml";
|
2011-10-10 13:38:58 +02:00
|
|
|
|
2012-04-18 14:20:54 +02:00
|
|
|
// Common actions
|
2011-07-15 10:55:39 +02:00
|
|
|
const char INTERRUPT[] = "Debugger.Interrupt";
|
|
|
|
const char CONTINUE[] = "Debugger.Continue";
|
|
|
|
const char STOP[] = "Debugger.Stop";
|
2011-08-03 18:57:37 +02:00
|
|
|
const char HIDDEN_STOP[] = "Debugger.HiddenStop";
|
2011-10-31 17:36:08 +01:00
|
|
|
const char ABORT[] = "Debugger.Abort";
|
2011-07-15 10:55:39 +02:00
|
|
|
const char STEP[] = "Debugger.StepLine";
|
|
|
|
const char STEPOUT[] = "Debugger.StepOut";
|
|
|
|
const char NEXT[] = "Debugger.NextLine";
|
|
|
|
const char REVERSE[] = "Debugger.ReverseDirection";
|
2014-06-05 17:22:51 +02:00
|
|
|
const char RESET[] = "Debugger.Reset";
|
2011-07-15 10:55:39 +02:00
|
|
|
const char OPERATE_BY_INSTRUCTION[] = "Debugger.OperateByInstruction";
|
2012-11-27 15:15:27 +01:00
|
|
|
const char QML_SHOW_APP_ON_TOP[] = "Debugger.QmlShowAppOnTop";
|
2012-04-18 14:20:54 +02:00
|
|
|
const char QML_SELECTTOOL[] = "Debugger.QmlSelectTool";
|
|
|
|
const char QML_ZOOMTOOL[] = "Debugger.QmlZoomTool";
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2012-11-02 16:14:43 +01:00
|
|
|
const char TASK_CATEGORY_DEBUGGER_DEBUGINFO[] = "Debuginfo";
|
|
|
|
const char TASK_CATEGORY_DEBUGGER_RUNTIME[] = "DebugRuntime";
|
2013-03-27 13:03:15 +01:00
|
|
|
|
2015-04-17 12:46:28 +02:00
|
|
|
const char TEXT_MARK_CATEGORY_BREAKPOINT[] = "Debugger.Mark.Breakpoint";
|
|
|
|
const char TEXT_MARK_CATEGORY_LOCATION[] = "Debugger.Mark.Location";
|
|
|
|
|
2013-03-27 13:03:15 +01:00
|
|
|
// Run Configuration Aspect defaults:
|
|
|
|
const int QML_DEFAULT_DEBUG_SERVER_PORT = 3768;
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
} // namespace Constants
|
2009-09-25 08:35:31 +02:00
|
|
|
|
2009-09-28 13:03:06 +02:00
|
|
|
enum DebuggerState
|
2009-09-25 08:35:31 +02:00
|
|
|
{
|
|
|
|
DebuggerNotReady, // Debugger not started
|
|
|
|
|
2010-07-09 17:07:59 +02:00
|
|
|
EngineSetupRequested, // Engine starts
|
2010-07-09 08:48:33 +02:00
|
|
|
EngineSetupFailed,
|
|
|
|
EngineSetupOk,
|
2010-07-08 11:54:06 +02:00
|
|
|
|
2010-07-09 17:07:59 +02:00
|
|
|
InferiorSetupRequested,
|
2010-07-08 18:10:50 +02:00
|
|
|
InferiorSetupFailed,
|
2011-01-14 14:25:02 +01:00
|
|
|
InferiorSetupOk,
|
2009-09-25 08:35:31 +02:00
|
|
|
|
2010-07-09 17:07:59 +02:00
|
|
|
EngineRunRequested,
|
|
|
|
EngineRunFailed,
|
2011-01-14 14:25:02 +01:00
|
|
|
|
2010-07-09 17:07:59 +02:00
|
|
|
InferiorUnrunnable, // Used in the core dump adapter
|
2009-09-25 08:35:31 +02:00
|
|
|
|
2010-07-09 17:07:59 +02:00
|
|
|
InferiorRunRequested, // Debuggee requested to run
|
|
|
|
InferiorRunOk, // Debuggee running
|
|
|
|
InferiorRunFailed, // Debuggee running
|
2009-09-25 08:35:31 +02:00
|
|
|
|
2010-07-09 17:07:59 +02:00
|
|
|
InferiorStopRequested, // Debuggee running, stop requested
|
|
|
|
InferiorStopOk, // Debuggee stopped
|
|
|
|
InferiorStopFailed, // Debuggee not stopped, will kill debugger
|
|
|
|
|
|
|
|
InferiorShutdownRequested,
|
2009-09-25 08:35:31 +02:00
|
|
|
InferiorShutdownFailed,
|
2011-01-14 14:25:02 +01:00
|
|
|
InferiorShutdownOk,
|
2009-09-25 08:35:31 +02:00
|
|
|
|
2010-07-09 17:07:59 +02:00
|
|
|
EngineShutdownRequested,
|
|
|
|
EngineShutdownFailed,
|
2011-01-14 14:25:02 +01:00
|
|
|
EngineShutdownOk,
|
2010-07-09 17:07:59 +02:00
|
|
|
|
|
|
|
DebuggerFinished
|
2009-09-25 08:35:31 +02:00
|
|
|
};
|
|
|
|
|
2014-06-02 17:05:52 +02:00
|
|
|
// Keep in sync with dumper.py
|
2009-09-25 08:35:31 +02:00
|
|
|
enum DebuggerStartMode
|
|
|
|
{
|
|
|
|
NoStartMode,
|
|
|
|
StartInternal, // Start current start project's binary
|
|
|
|
StartExternal, // Start binary found in file system
|
|
|
|
AttachExternal, // Attach to running process by process id
|
|
|
|
AttachCrashedExternal, // Attach to crashed process by process id
|
|
|
|
AttachCore, // Attach to a core file
|
2011-12-05 17:21:48 +01:00
|
|
|
AttachToRemoteServer, // Attach to a running gdbserver
|
|
|
|
AttachToRemoteProcess, // Attach to a running remote process
|
2014-10-14 19:08:58 +03:00
|
|
|
StartRemoteProcess // Start and attach to a remote process
|
2009-09-25 08:35:31 +02:00
|
|
|
};
|
|
|
|
|
2012-03-26 16:03:25 +02:00
|
|
|
enum DebuggerCloseMode
|
|
|
|
{
|
|
|
|
KillAtClose,
|
2014-10-09 00:13:33 +02:00
|
|
|
KillAndExitMonitorAtClose,
|
2012-03-26 16:03:25 +02:00
|
|
|
DetachAtClose
|
|
|
|
};
|
|
|
|
|
2010-02-05 10:23:55 +01:00
|
|
|
enum DebuggerCapabilities
|
|
|
|
{
|
2015-07-07 15:06:22 +02:00
|
|
|
ReverseSteppingCapability = 1 << 0,
|
|
|
|
SnapshotCapability = 1 << 1,
|
|
|
|
AutoDerefPointersCapability = 1 << 2,
|
|
|
|
DisassemblerCapability = 1 << 3,
|
|
|
|
RegisterCapability = 1 << 4,
|
|
|
|
ShowMemoryCapability = 1 << 5,
|
|
|
|
JumpToLineCapability = 1 << 6,
|
|
|
|
ReloadModuleCapability = 1 << 7,
|
|
|
|
ReloadModuleSymbolsCapability = 1 << 8,
|
|
|
|
BreakOnThrowAndCatchCapability = 1 << 9,
|
|
|
|
BreakConditionCapability = 1 << 10, //!< Conditional Breakpoints
|
|
|
|
BreakModuleCapability = 1 << 11, //!< Breakpoint specification includes module
|
|
|
|
TracePointCapability = 1 << 12,
|
|
|
|
ReturnFromFunctionCapability = 1 << 13,
|
|
|
|
CreateFullBacktraceCapability = 1 << 14,
|
|
|
|
AddWatcherCapability = 1 << 15,
|
|
|
|
AddWatcherWhileRunningCapability = 1 << 16,
|
|
|
|
WatchWidgetsCapability = 1 << 17,
|
|
|
|
WatchpointByAddressCapability = 1 << 18,
|
|
|
|
WatchpointByExpressionCapability = 1 << 19,
|
|
|
|
ShowModuleSymbolsCapability = 1 << 20,
|
|
|
|
CatchCapability = 1 << 21, //!< fork, vfork, syscall
|
|
|
|
OperateByInstructionCapability = 1 << 22,
|
|
|
|
RunToLineCapability = 1 << 23,
|
|
|
|
MemoryAddressCapability = 1 << 24,
|
|
|
|
ShowModuleSectionsCapability = 1 << 25,
|
|
|
|
WatchComplexExpressionsCapability = 1 << 26, // Used to filter out challenges for cdb.
|
|
|
|
AdditionalQmlStackCapability = 1 << 27, //!< C++ debugger engine is able to retrieve QML stack as well.
|
|
|
|
ResetInferiorCapability = 1 << 28, //!< restart program while debugging
|
|
|
|
NativeMixedCapability = 1 << 29
|
2010-02-05 10:23:55 +01:00
|
|
|
};
|
|
|
|
|
2009-09-25 08:35:31 +02:00
|
|
|
enum LogChannel
|
|
|
|
{
|
2010-06-16 11:08:54 +02:00
|
|
|
LogInput, // Used for user input
|
|
|
|
LogMiscInput, // Used for misc stuff in the input pane
|
2010-07-09 17:07:59 +02:00
|
|
|
LogOutput,
|
|
|
|
LogWarning,
|
|
|
|
LogError,
|
2010-06-16 11:08:54 +02:00
|
|
|
LogStatus, // Used for status changed messages
|
|
|
|
LogTime, // Used for time stamp messages
|
2010-07-09 17:07:59 +02:00
|
|
|
LogDebug,
|
|
|
|
LogMisc,
|
2011-05-11 12:08:23 +02:00
|
|
|
AppOutput, // stdout
|
|
|
|
AppError, // stderr
|
|
|
|
AppStuff, // (possibly) windows debug channel
|
2012-10-04 14:54:59 +02:00
|
|
|
StatusBar, // LogStatus and also put to the status bar
|
|
|
|
ConsoleOutput // Used to output to console
|
2010-07-09 17:07:59 +02:00
|
|
|
};
|
|
|
|
|
2014-10-28 09:35:06 +01:00
|
|
|
// Keep values compatible between Qt Creator versions,
|
|
|
|
// because they are used by the installer for registering debuggers
|
2010-06-16 11:08:54 +02:00
|
|
|
enum DebuggerEngineType
|
|
|
|
{
|
|
|
|
NoEngineType = 0,
|
2013-03-22 10:28:49 +01:00
|
|
|
GdbEngineType = 0x001,
|
|
|
|
CdbEngineType = 0x004,
|
|
|
|
PdbEngineType = 0x008,
|
|
|
|
QmlEngineType = 0x020,
|
|
|
|
QmlCppEngineType = 0x040,
|
|
|
|
LldbEngineType = 0x100,
|
2010-06-16 11:08:54 +02:00
|
|
|
AllEngineTypes = GdbEngineType
|
|
|
|
| CdbEngineType
|
|
|
|
| PdbEngineType
|
|
|
|
| QmlEngineType
|
2010-08-18 13:54:12 +02:00
|
|
|
| QmlCppEngineType
|
2010-11-26 10:10:00 +01:00
|
|
|
| LldbEngineType
|
2010-08-18 13:54:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
enum DebuggerLanguage
|
|
|
|
{
|
2016-03-01 07:51:06 +01:00
|
|
|
NoLanguage = 0x0,
|
2010-08-24 17:17:54 +02:00
|
|
|
CppLanguage = 0x1,
|
2016-03-01 07:51:06 +01:00
|
|
|
QmlLanguage = 0x2,
|
|
|
|
AnyLanguage = CppLanguage | QmlLanguage
|
2010-06-15 09:13:22 +02:00
|
|
|
};
|
2016-03-01 07:51:06 +01:00
|
|
|
|
2010-08-18 13:54:12 +02:00
|
|
|
Q_DECLARE_FLAGS(DebuggerLanguages, DebuggerLanguage)
|
2010-06-15 09:13:22 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
} // namespace Debugger
|
|
|
|
|
|
|
|
#endif // DEBUGGERCONSTANTS_H
|