2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-05-18 12:12:22 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
|
|
|
|
** Contact: http://www.qt-project.org/legal
|
2010-05-18 12:12:22 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-05-18 12:12:22 +02: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
|
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
|
|
|
|
** conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
|
** use the contact form at http://qt.digia.com/contact-us.
|
2010-05-18 12:12:22 +02:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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-05-18 12:12:22 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-05-18 12:12:22 +02:00
|
|
|
|
|
|
|
|
#ifndef THREADSHANDLER_H
|
|
|
|
|
#define THREADSHANDLER_H
|
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QAbstractTableModel>
|
|
|
|
|
#include <QIcon>
|
2010-05-18 12:12:22 +02:00
|
|
|
|
2010-10-15 10:56:39 +02:00
|
|
|
#include "threaddata.h"
|
2010-05-18 12:12:22 +02:00
|
|
|
|
2011-10-13 10:17:06 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QSortFilterProxyModel;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2010-05-18 12:12:22 +02:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// ThreadsHandler
|
|
|
|
|
//
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2011-09-01 16:36:27 +02:00
|
|
|
namespace Debugger {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class GdbMi;
|
|
|
|
|
|
2010-05-18 12:12:22 +02:00
|
|
|
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;
|
2011-10-13 10:17:06 +02:00
|
|
|
QAbstractItemModel *model();
|
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;
|
2011-09-01 16:36:27 +02:00
|
|
|
void updateThreadBox();
|
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;
|
2011-10-13 10:17:06 +02:00
|
|
|
|
|
|
|
|
QSortFilterProxyModel *m_proxyModel;
|
2010-05-18 12:12:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|
|
|
|
|
|
|
|
|
|
#endif // THREADSHANDLER_H
|