debuggeragents.h 2.8 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
    // Called from Editor
63
    void fetchLazyData(Core::IEditor *, quint64 block, bool sync);
64

65
private:
66
    Q_SLOT void createBinEditor(quint64 startAddr);
67

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

73
74
75
76
77
78
79

class DisassemblerViewAgent : public QObject
{
    Q_OBJECT

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

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

private:
    DisassemblerViewAgentPrivate *d;
};


97
98
99
100
} // namespace Internal
} // namespace Debugger

#endif // DEBUGGER_WATCHWINDOW_H