1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
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
16 ** GNU Lesser General Public License Usage
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.
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.
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
32 **************************************************************************/
34 #ifndef DEBUGGER_BREAKPOINT_H
35 #define DEBUGGER_BREAKPOINT_H
37 #include <QtCore/QList>
38 #include <QtCore/QMetaType>
39 #include <QtCore/QString>
44 typedef quint64 BreakpointId;
46 //////////////////////////////////////////////////////////////////
50 //////////////////////////////////////////////////////////////////
52 //! \enum Debugger::Internal::BreakpointType
56 BreakpointByFileAndLine,
69 //! \enum Debugger::Internal::BreakpointState
73 BreakpointInsertRequested, //!< Inferior was told about bp, not ack'ed.
74 BreakpointInsertProceeding,
75 BreakpointChangeRequested,
76 BreakpointChangeProceeding,
78 BreakpointRemoveRequested,
79 BreakpointRemoveProceeding,
83 //! \enum Debugger::Internal::BreakpointPathUsage
84 enum BreakpointPathUsage
86 BreakpointPathUsageEngineDefault, //!< Default value that suits the engine.
87 BreakpointUseFullPath, //!< Use full path to avoid ambiguities. Slow with gdb.
88 BreakpointUseShortPath //!< Use filename only, in case source files are relocated.
91 class BreakpointParameters
94 explicit BreakpointParameters(BreakpointType = UnknownType);
95 bool equals(const BreakpointParameters &rhs) const;
96 bool conditionsMatch(const QByteArray &other) const;
97 bool isWatchpoint() const { return type == Watchpoint; }
99 bool isBreakpoint() const { return type != Watchpoint && !tracepoint; }
100 bool isTracepoint() const { return tracepoint; }
101 QString toString() const;
103 bool operator==(const BreakpointParameters &p) const { return equals(p); }
104 bool operator!=(const BreakpointParameters &p) const { return !equals(p); }
106 BreakpointType type; //!< Type of breakpoint.
107 bool enabled; //!< Should we talk to the debugger engine?
108 BreakpointPathUsage pathUsage; //!< Should we use the full path when setting the bp?
109 QString fileName; //!< Short name of source file.
110 QByteArray condition; //!< Condition associated with breakpoint.
111 int ignoreCount; //!< Ignore count associated with breakpoint.
112 int lineNumber; //!< Line in source file.
113 quint64 address; //!< Address for watchpoints.
114 uint size; //!< Size of watched area for watchpoints.
115 uint bitpos; //!< Location of watched bitfield within watched area.
116 uint bitsize; //!< Size of watched bitfield within watched area.
117 int threadSpec; //!< Thread specification.
118 QString functionName;
119 QString module; //!< module for file name
120 QString command; //!< command to execute
124 class BreakpointResponse : public BreakpointParameters
127 BreakpointResponse();
128 QString toString() const;
131 void fromParameters(const BreakpointParameters &p);
133 int number; //!< Breakpoint number assigned by the debugger engine.
134 bool pending; //!< Breakpoint not fully resolved.
135 QString fullName; //!< Full file name acknowledged by the debugger engine.
136 bool multiple; //!< Happens in constructors/gdb.
137 QByteArray extra; //!< gdb: <PENDING>, <MULTIPLE>
138 QList<quint64> addresses;//!< Extra addresses for templated code.
139 int correctedLineNumber; //!< Line number as seen by gdb.
142 typedef QList<BreakpointId> BreakpointIds;
144 } // namespace Internal
145 } // namespace Debugger
147 #endif // DEBUGGER_BREAKPOINT_H