2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-05-18 12:12:22 +02:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** Copyright (C) 2015 The Qt Company Ltd.
|
|
|
|
|
** Contact: http://www.qt.io/licensing
|
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
|
2015-01-14 18:07:15 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms and
|
|
|
|
|
** conditions see http://www.qt.io/terms-conditions. For further information
|
2014-10-01 13:21:18 +02:00
|
|
|
** use the contact form at http://www.qt.io/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
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2010-05-18 12:12:22 +02:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
|
|
|
** rights. These rights are described in The Qt Company 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
|
|
|
|
|
|
2010-10-15 10:56:39 +02:00
|
|
|
#include "threaddata.h"
|
2010-05-18 12:12:22 +02:00
|
|
|
|
2013-11-20 02:19:54 +01:00
|
|
|
#include <QAbstractTableModel>
|
|
|
|
|
#include <QIcon>
|
2011-10-13 10:17:06 +02:00
|
|
|
|
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
|
|
|
|
2013-11-14 13:24:02 +01:00
|
|
|
int currentThreadIndex() const;
|
2012-10-19 16:37:57 +02:00
|
|
|
ThreadId currentThread() const;
|
|
|
|
|
ThreadId threadAt(int index) const;
|
|
|
|
|
void setCurrentThread(ThreadId id);
|
2010-07-02 10:58:47 +02:00
|
|
|
|
2012-10-19 16:37:57 +02:00
|
|
|
void updateThread(const ThreadData &thread);
|
|
|
|
|
void updateThreads(const GdbMi &data);
|
|
|
|
|
|
|
|
|
|
void removeThread(ThreadId threadId);
|
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;
|
2012-10-19 16:37:57 +02:00
|
|
|
ThreadData thread(ThreadId id) const;
|
2011-10-13 10:17:06 +02:00
|
|
|
QAbstractItemModel *model();
|
2010-05-18 12:12:22 +02:00
|
|
|
|
|
|
|
|
// Clear out all frame information
|
2012-10-19 16:37:57 +02:00
|
|
|
void notifyRunning(const QByteArray &data);
|
|
|
|
|
void notifyRunning(ThreadId id);
|
|
|
|
|
void notifyAllRunning();
|
2010-05-18 12:12:22 +02:00
|
|
|
|
2012-10-19 16:37:57 +02:00
|
|
|
void notifyStopped(const QByteArray &data);
|
|
|
|
|
void notifyStopped(ThreadId id);
|
|
|
|
|
void notifyAllStopped();
|
2010-11-08 17:15:33 +01:00
|
|
|
|
2011-04-18 16:40:59 +02:00
|
|
|
void resetLocation();
|
|
|
|
|
void scheduleResetLocation();
|
|
|
|
|
|
2010-05-18 12:12:22 +02:00
|
|
|
private:
|
2012-10-19 16:37:57 +02:00
|
|
|
int indexOf(ThreadId threadId) const;
|
2010-05-18 12:12:22 +02:00
|
|
|
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;
|
2013-11-20 02:19:54 +01:00
|
|
|
void sort(int, Qt::SortOrder);
|
2011-09-01 16:36:27 +02:00
|
|
|
void updateThreadBox();
|
2013-11-14 13:24:02 +01:00
|
|
|
void threadDataChanged(ThreadId id);
|
2010-05-18 12:12:22 +02:00
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
Threads m_threads;
|
2013-11-14 13:24:02 +01:00
|
|
|
ThreadId m_currentId;
|
2010-05-18 12:12:22 +02:00
|
|
|
const QIcon m_positionIcon;
|
|
|
|
|
const QIcon m_emptyIcon;
|
2011-04-18 16:40:59 +02:00
|
|
|
|
|
|
|
|
bool m_resetLocationScheduled;
|
2010-05-18 12:12:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|
|
|
|
|
|
|
|
|
|
#endif // THREADSHANDLER_H
|