2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01: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
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 15:08:31 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2012-06-04 18:06:59 +02:00
|
|
|
#include <utils/elfreader.h>
|
2015-01-13 22:42:30 +01:00
|
|
|
#include <utils/treemodel.h>
|
2012-06-04 18:06:59 +02:00
|
|
|
|
2011-10-13 10:17:06 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
2012-06-01 19:01:37 +02:00
|
|
|
class QAbstractItemModel;
|
2011-10-13 10:17:06 +02:00
|
|
|
class QSortFilterProxyModel;
|
|
|
|
|
QT_END_NAMESPACE
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
namespace Debugger {
|
2010-09-13 13:30:35 +02:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2014-12-12 15:33:16 +01:00
|
|
|
class DebuggerEngine;
|
2016-07-18 12:36:31 +02:00
|
|
|
class ModuleItem;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-04-15 12:01:58 +02:00
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Symbol
|
|
|
|
|
//
|
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
class Symbol
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
QString address;
|
|
|
|
|
QString state;
|
|
|
|
|
QString name;
|
2010-11-26 09:58:34 +01:00
|
|
|
QString section;
|
|
|
|
|
QString demangled;
|
2009-04-15 12:01:58 +02:00
|
|
|
};
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-11-26 09:58:34 +01:00
|
|
|
typedef QVector<Symbol> Symbols;
|
2010-06-15 11:14:44 +02:00
|
|
|
|
2012-11-07 18:31:17 +01:00
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Section
|
|
|
|
|
//
|
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
class Section
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
QString from;
|
|
|
|
|
QString to;
|
|
|
|
|
QString address;
|
|
|
|
|
QString name;
|
|
|
|
|
QString flags;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef QVector<Section> Sections;
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Module
|
|
|
|
|
//
|
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
class Module
|
|
|
|
|
{
|
|
|
|
|
public:
|
2015-02-13 16:46:27 +01:00
|
|
|
Module() : symbolsRead(UnknownReadState), startAddress(0), endAddress(0) {}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
public:
|
2010-07-22 16:15:50 +02:00
|
|
|
enum SymbolReadState {
|
|
|
|
|
UnknownReadState, // Not tried.
|
|
|
|
|
ReadFailed, // Tried to read, but failed.
|
2012-06-02 03:30:21 +02:00
|
|
|
ReadOk // Dwarf index available.
|
2010-07-22 16:15:50 +02:00
|
|
|
};
|
2008-12-02 12:01:29 +01:00
|
|
|
QString moduleName;
|
2010-05-03 19:12:52 +02:00
|
|
|
QString modulePath;
|
2012-06-02 03:30:21 +02:00
|
|
|
QString hostPath;
|
2010-07-22 16:15:50 +02:00
|
|
|
SymbolReadState symbolsRead;
|
2010-12-21 13:34:59 +01:00
|
|
|
quint64 startAddress;
|
|
|
|
|
quint64 endAddress;
|
2012-06-04 18:06:59 +02:00
|
|
|
|
2012-06-06 16:08:59 +02:00
|
|
|
Utils::ElfData elfData;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
2010-11-26 09:58:34 +01:00
|
|
|
typedef QVector<Module> Modules;
|
2010-06-15 11:14:44 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// ModulesHandler
|
|
|
|
|
//
|
|
|
|
|
//////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2016-06-24 09:36:42 +02:00
|
|
|
using ModulesModel = Utils::TreeModel<Utils::TypedTreeItem<ModuleItem>, ModuleItem>;
|
2016-07-18 12:36:31 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
class ModulesHandler : public QObject
|
|
|
|
|
{
|
2010-10-30 21:17:35 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
public:
|
2012-08-28 10:53:33 +02:00
|
|
|
explicit ModulesHandler(DebuggerEngine *engine);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
QAbstractItemModel *model() const;
|
|
|
|
|
|
2012-06-01 19:01:37 +02:00
|
|
|
void removeModule(const QString &modulePath);
|
|
|
|
|
void updateModule(const Module &module);
|
2010-05-19 15:14:15 +02:00
|
|
|
|
2015-01-13 22:42:30 +01:00
|
|
|
void beginUpdateAll();
|
|
|
|
|
void endUpdateAll();
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
void removeAll();
|
2015-01-13 22:42:30 +01:00
|
|
|
Modules modules() const;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
private:
|
2016-07-18 12:36:31 +02:00
|
|
|
ModuleItem *moduleFromPath(const QString &modulePath) const;
|
|
|
|
|
|
2012-08-28 10:53:33 +02:00
|
|
|
DebuggerEngine *m_engine;
|
2016-07-18 12:36:31 +02:00
|
|
|
ModulesModel *m_model;
|
2008-12-02 12:01:29 +01:00
|
|
|
QSortFilterProxyModel *m_proxyModel;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|