| 
									
										
										
										
											2010-05-07 15:16:31 +02:00
										 |  |  | /**************************************************************************
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** This file is part of Qt Creator | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2011-01-11 16:28:15 +01:00
										 |  |  | ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). | 
					
						
							| 
									
										
										
										
											2010-05-07 15:16:31 +02:00
										 |  |  | ** | 
					
						
							|  |  |  | ** Contact: Nokia Corporation (qt-info@nokia.com) | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2010-12-17 16:01:08 +01:00
										 |  |  | ** No Commercial Usage | 
					
						
							| 
									
										
										
										
											2010-05-07 15:16:31 +02:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2010-12-17 16:01:08 +01:00
										 |  |  | ** This file contains pre-release code and may not be distributed. | 
					
						
							|  |  |  | ** You may use this file in accordance with the terms and conditions | 
					
						
							|  |  |  | ** contained in the Technology Preview License Agreement accompanying | 
					
						
							|  |  |  | ** this package. | 
					
						
							| 
									
										
										
										
											2010-05-07 15:16:31 +02:00
										 |  |  | ** | 
					
						
							|  |  |  | ** 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.
 | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2010-12-17 16:01:08 +01:00
										 |  |  | ** In addition, as a special exception, Nokia gives you certain additional | 
					
						
							|  |  |  | ** rights.  These rights are described in the Nokia Qt LGPL Exception | 
					
						
							|  |  |  | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** If you have questions regarding the use of this file, please contact | 
					
						
							|  |  |  | ** Nokia at qt-info@nokia.com. | 
					
						
							| 
									
										
										
										
											2010-05-07 15:16:31 +02:00
										 |  |  | ** | 
					
						
							|  |  |  | **************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef DEBUGGER_BREAKPOINT_H
 | 
					
						
							|  |  |  | #define DEBUGGER_BREAKPOINT_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-06-16 11:08:54 +02:00
										 |  |  | #include <QtCore/QList>
 | 
					
						
							| 
									
										
										
										
											2010-11-15 14:12:05 +01:00
										 |  |  | #include <QtCore/QMetaType>
 | 
					
						
							| 
									
										
										
										
											2010-05-07 15:16:31 +02:00
										 |  |  | #include <QtCore/QString>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Debugger { | 
					
						
							|  |  |  | namespace Internal { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-18 16:50:44 +01:00
										 |  |  | typedef quint64 BreakpointId; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-07 15:16:31 +02:00
										 |  |  | //////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // BreakpointData
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | //////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-04 15:08:31 +01:00
										 |  |  | //! \enum Debugger::Internal::BreakpointType
 | 
					
						
							| 
									
										
										
										
											2010-10-28 12:18:38 +02:00
										 |  |  | enum BreakpointType | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-11-10 16:33:11 +01:00
										 |  |  |     UnknownType, | 
					
						
							| 
									
										
										
										
											2010-10-28 12:18:38 +02:00
										 |  |  |     BreakpointByFileAndLine, | 
					
						
							|  |  |  |     BreakpointByFunction, | 
					
						
							|  |  |  |     BreakpointByAddress, | 
					
						
							| 
									
										
										
										
											2010-11-16 10:23:20 +01:00
										 |  |  |     BreakpointAtThrow, | 
					
						
							|  |  |  |     BreakpointAtCatch, | 
					
						
							|  |  |  |     BreakpointAtMain, | 
					
						
							| 
									
										
										
										
											2010-12-16 12:05:48 +01:00
										 |  |  |     Watchpoint | 
					
						
							| 
									
										
										
										
											2010-10-28 12:18:38 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-04 15:08:31 +01:00
										 |  |  | //! \enum Debugger::Internal::BreakpointState
 | 
					
						
							| 
									
										
										
										
											2010-11-08 18:00:57 +01:00
										 |  |  | enum BreakpointState | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     BreakpointNew, | 
					
						
							| 
									
										
										
										
											2011-02-04 15:08:31 +01:00
										 |  |  |     BreakpointInsertRequested,  //!< Inferior was told about bp, not ack'ed.
 | 
					
						
							| 
									
										
										
										
											2010-11-10 16:33:11 +01:00
										 |  |  |     BreakpointInsertProceeding, | 
					
						
							| 
									
										
										
										
											2010-11-08 18:00:57 +01:00
										 |  |  |     BreakpointChangeRequested, | 
					
						
							| 
									
										
										
										
											2010-11-10 16:33:11 +01:00
										 |  |  |     BreakpointChangeProceeding, | 
					
						
							|  |  |  |     BreakpointInserted, | 
					
						
							|  |  |  |     BreakpointRemoveRequested, | 
					
						
							|  |  |  |     BreakpointRemoveProceeding, | 
					
						
							| 
									
										
										
										
											2010-12-16 12:05:48 +01:00
										 |  |  |     BreakpointDead | 
					
						
							| 
									
										
										
										
											2010-11-08 18:00:57 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-17 13:00:11 +01:00
										 |  |  | //! \enum Debugger::Internal::BreakpointPathUsage
 | 
					
						
							|  |  |  | enum BreakpointPathUsage | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     BreakpointPathUsageEngineDefault, //!< Default value that suits the engine.
 | 
					
						
							|  |  |  |     BreakpointUseFullPath,            //!< Use full path to avoid ambiguities. Slow with gdb.
 | 
					
						
							|  |  |  |     BreakpointUseShortPath            //!< Use filename only, in case source files are relocated.
 | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-15 19:05:31 +01:00
										 |  |  | class BreakpointParameters | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2010-11-15 17:04:29 +01:00
										 |  |  | public: | 
					
						
							|  |  |  |     explicit BreakpointParameters(BreakpointType = UnknownType); | 
					
						
							|  |  |  |     bool equals(const BreakpointParameters &rhs) const; | 
					
						
							| 
									
										
										
										
											2010-11-16 11:06:09 +01:00
										 |  |  |     bool conditionsMatch(const QByteArray &other) const; | 
					
						
							| 
									
										
										
										
											2010-11-16 11:48:17 +01:00
										 |  |  |     bool isWatchpoint() const { return type == Watchpoint; } | 
					
						
							| 
									
										
										
										
											2010-12-16 13:02:59 +01:00
										 |  |  |     // Enough for now.
 | 
					
						
							|  |  |  |     bool isBreakpoint() const { return type != Watchpoint && !tracepoint; } | 
					
						
							|  |  |  |     bool isTracepoint() const { return tracepoint; } | 
					
						
							| 
									
										
										
										
											2010-11-16 11:48:17 +01:00
										 |  |  |     QString toString() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bool operator==(const BreakpointParameters &p) const { return equals(p); } | 
					
						
							|  |  |  |     bool operator!=(const BreakpointParameters &p) const { return !equals(p); } | 
					
						
							| 
									
										
										
										
											2010-11-15 17:04:29 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-04 15:08:31 +01:00
										 |  |  |     BreakpointType type;     //!< Type of breakpoint.
 | 
					
						
							|  |  |  |     bool enabled;            //!< Should we talk to the debugger engine?
 | 
					
						
							| 
									
										
										
										
											2011-02-17 13:00:11 +01:00
										 |  |  |     BreakpointPathUsage pathUsage;  //!< Should we use the full path when setting the bp?
 | 
					
						
							| 
									
										
										
										
											2011-02-04 15:08:31 +01:00
										 |  |  |     QString fileName;        //!< Short name of source file.
 | 
					
						
							|  |  |  |     QByteArray condition;    //!< Condition associated with breakpoint.
 | 
					
						
							|  |  |  |     int ignoreCount;         //!< Ignore count associated with breakpoint.
 | 
					
						
							|  |  |  |     int lineNumber;          //!< Line in source file.
 | 
					
						
							|  |  |  |     quint64 address;         //!< Address for watchpoints.
 | 
					
						
							| 
									
										
										
										
											2011-03-01 19:16:24 +01:00
										 |  |  |     uint size;               //!< Size of watched area for watchpoints.
 | 
					
						
							|  |  |  |     uint bitpos;             //!< Location of watched bitfield within watched area.
 | 
					
						
							|  |  |  |     uint bitsize;            //!< Size of watched bitfield within watched area.
 | 
					
						
							| 
									
										
										
										
											2011-02-04 15:08:31 +01:00
										 |  |  |     int threadSpec;          //!< Thread specification.
 | 
					
						
							| 
									
										
										
										
											2010-11-15 17:04:29 +01:00
										 |  |  |     QString functionName; | 
					
						
							| 
									
										
										
										
											2011-02-04 15:08:31 +01:00
										 |  |  |     QString module;          //!< module for file name
 | 
					
						
							|  |  |  |     QString command;         //!< command to execute
 | 
					
						
							| 
									
										
										
										
											2010-12-16 13:02:59 +01:00
										 |  |  |     bool tracepoint; | 
					
						
							| 
									
										
										
										
											2010-11-15 17:04:29 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BreakpointResponse : public BreakpointParameters | 
					
						
							| 
									
										
										
										
											2010-11-10 16:33:11 +01:00
										 |  |  | { | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     BreakpointResponse(); | 
					
						
							|  |  |  |     QString toString() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2010-11-16 10:23:20 +01:00
										 |  |  |     void fromParameters(const BreakpointParameters &p); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-04 15:08:31 +01:00
										 |  |  |     int number;             //!< Breakpoint number assigned by the debugger engine.
 | 
					
						
							|  |  |  |     bool pending;           //!< Breakpoint not fully resolved.
 | 
					
						
							|  |  |  |     QString fullName;       //!< Full file name acknowledged by the debugger engine.
 | 
					
						
							|  |  |  |     bool multiple;          //!< Happens in constructors/gdb.
 | 
					
						
							|  |  |  |     QByteArray extra;       //!< gdb: <PENDING>, <MULTIPLE>
 | 
					
						
							| 
									
										
										
										
											2011-03-02 13:37:29 +01:00
										 |  |  |     QList<quint64> addresses;//!< Extra addresses for templated code.
 | 
					
						
							|  |  |  |     int correctedLineNumber; //!< Line number as seen by gdb.
 | 
					
						
							| 
									
										
										
										
											2010-05-07 15:16:31 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-10 16:33:11 +01:00
										 |  |  | typedef QList<BreakpointId> BreakpointIds; | 
					
						
							| 
									
										
										
										
											2010-05-07 15:16:31 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | } // namespace Internal
 | 
					
						
							|  |  |  | } // namespace Debugger
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif // DEBUGGER_BREAKPOINT_H
 |