2010-05-18 12:12:22 +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-18 12:12:22 +02:00
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Contact: Nokia Corporation (info@qt.nokia.com)
|
2010-05-18 12:12:22 +02:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** 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-05-18 12:12:22 +02:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-04-13 08:42:33 +02:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Other Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** If you have questions regarding the use of this file, please contact
|
2011-05-06 15:05:37 +02:00
|
|
|
** Nokia at info@qt.nokia.com.
|
2010-05-18 12:12:22 +02:00
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef THREADSHANDLER_H
|
|
|
|
|
#define THREADSHANDLER_H
|
|
|
|
|
|
|
|
|
|
#include <QtCore/QAbstractTableModel>
|
|
|
|
|
#include <QtGui/QIcon>
|
|
|
|
|
|
2010-10-15 10:56:39 +02:00
|
|
|
#include "threaddata.h"
|
2010-05-18 12:12:22 +02:00
|
|
|
|
|
|
|
|
namespace Debugger {
|
2010-09-13 13:30:35 +02:00
|
|
|
namespace Internal {
|
2010-11-08 17:15:33 +01:00
|
|
|
class GdbMi;
|
2010-05-18 12:12:22 +02:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// ThreadsHandler
|
|
|
|
|
//
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
class ThreadsHandler : public QAbstractTableModel
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2010-11-05 17:02:27 +01:00
|
|
|
ThreadsHandler();
|
2010-05-18 12:12:22 +02:00
|
|
|
|
2010-07-21 13:11:03 +02:00
|
|
|
int currentThread() const { return m_currentIndex; }
|
|
|
|
|
void setCurrentThread(int index);
|
2010-05-18 12:12:22 +02:00
|
|
|
int currentThreadId() const;
|
2010-07-02 10:58:47 +02:00
|
|
|
void setCurrentThreadId(int id);
|
2010-10-15 10:56:39 +02:00
|
|
|
int indexOf(quint64 threadId) const;
|
2010-07-02 10:58:47 +02:00
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
void setThreads(const Threads &threads);
|
2010-05-18 12:12:22 +02:00
|
|
|
void removeAll();
|
2010-06-16 11:08:54 +02:00
|
|
|
Threads threads() const;
|
|
|
|
|
QAbstractItemModel *model() { return this; }
|
2010-05-18 12:12:22 +02:00
|
|
|
|
|
|
|
|
// Clear out all frame information
|
|
|
|
|
void notifyRunning();
|
|
|
|
|
|
2010-11-08 17:15:33 +01:00
|
|
|
static Threads parseGdbmiThreads(const GdbMi &data, int *currentThread = 0);
|
|
|
|
|
|
2011-04-18 16:40:59 +02:00
|
|
|
void resetLocation();
|
|
|
|
|
void scheduleResetLocation();
|
|
|
|
|
|
2010-05-18 12:12:22 +02:00
|
|
|
private:
|
|
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
|
|
|
|
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
|
|
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
2010-06-16 11:08:54 +02:00
|
|
|
QVariant headerData(int section, Qt::Orientation orientation,
|
|
|
|
|
int role = Qt::DisplayRole) const;
|
2011-04-18 16:40:59 +02:00
|
|
|
Qt::ItemFlags flags(const QModelIndex &index) const;
|
2010-05-18 12:12:22 +02:00
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
Threads m_threads;
|
2010-05-18 12:12:22 +02:00
|
|
|
int m_currentIndex;
|
|
|
|
|
const QIcon m_positionIcon;
|
|
|
|
|
const QIcon m_emptyIcon;
|
2011-04-18 16:40:59 +02:00
|
|
|
|
|
|
|
|
bool m_resetLocationScheduled;
|
|
|
|
|
bool m_contentsValid;
|
2010-05-18 12:12:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|
|
|
|
|
|
|
|
|
|
#endif // THREADSHANDLER_H
|