debuggeragents.h 2.99 KB
Newer Older
1 2 3 4
/**************************************************************************
**
** This file is part of Qt Creator
**
hjk's avatar
hjk committed
5
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** 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.
**
** If you are unsure which license is appropriate for your use, please
hjk's avatar
hjk committed
26
** contact the sales department at http://qt.nokia.com/contact.
27 28 29 30 31 32 33 34
**
**************************************************************************/

#ifndef DEBUGGER_AGENTS_H
#define DEBUGGER_AGENTS_H

#include <QtCore/QObject>
#include <QtCore/QPointer>
35

36 37 38
namespace Core {
    class IEditor;
}
39
namespace Debugger {
40
class DebuggerManager;
41

42 43 44
namespace Internal {
struct StackFrame;
class IDebuggerEngine;
45
struct DisassemblerViewAgentPrivate;
46 47 48 49 50 51 52

class MemoryViewAgent : public QObject
{
    Q_OBJECT

public:
    // Called from Gui
53 54
    explicit MemoryViewAgent(DebuggerManager *manager, quint64 startaddr);
    explicit MemoryViewAgent(DebuggerManager *manager, const QString &startaddr);
55 56 57 58 59 60
    ~MemoryViewAgent();

    enum { BinBlockSize = 1024 };

public slots:
    // Called from Engine
61
    void addLazyData(QObject *editorToken, quint64 addr, const QByteArray &data);
62

63
private:
64
    Q_SLOT void createBinEditor(quint64 startAddr);
ck's avatar
ck committed
65 66
    Q_SLOT void fetchLazyData(Core::IEditor *, quint64 block, bool sync);
    Q_SLOT void provideNewRange(Core::IEditor *editor, quint64 address);
67 68
    Q_SLOT void handleStartOfFileRequested(Core::IEditor *editor);
    Q_SLOT void handleEndOfFileRequested(Core::IEditor *editor);
69

70
    QPointer<IDebuggerEngine> m_engine;
71
    QList<QPointer<Core::IEditor> > m_editors;
72
    QPointer<DebuggerManager> m_manager;
73 74
};

75 76 77 78 79 80 81

class DisassemblerViewAgent : public QObject
{
    Q_OBJECT

public:
    // Called from Gui
82
    explicit DisassemblerViewAgent(DebuggerManager *manager);
83 84
    ~DisassemblerViewAgent();

85 86
    void setFrame(const StackFrame &frame, bool tryMixed = true);
    const StackFrame &frame() const;
87
    void resetLocation();
88 89
    Q_SLOT void setContents(const QString &contents);
    QString address() const;
90
    bool contentsCoversAddress(const QString &contents) const;
91
    void cleanup();
92
    bool isMixed() const;
93 94 95 96 97 98

private:
    DisassemblerViewAgentPrivate *d;
};


99 100 101 102
} // namespace Internal
} // namespace Debugger

#endif // DEBUGGER_WATCHWINDOW_H