disassembleragent.h 2.57 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
#ifndef DEBUGGER_DISASSEMBLERAGENT_H
#define DEBUGGER_DISASSEMBLERAGENT_H

#include "disassemblerlines.h"
34 35 36

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

38
namespace Core {
39
class IEditor;
40
}
41

42 43 44
namespace Debugger {

class DebuggerEngine;
45 46 47

namespace Internal {

48
class StackFrame;
49 50
class DisassemblerViewAgent;
class DisassemblerViewAgentPrivate;
51

52 53 54
class DisassemblerViewAgent : public QObject
{
    Q_OBJECT
55
    Q_PROPERTY(QString mimeType READ mimeType WRITE setMimeType)
56 57
public:
    // Called from Gui
58
    explicit DisassemblerViewAgent(DebuggerEngine *engine);
59 60
    ~DisassemblerViewAgent();

61
    void setFrame(const StackFrame &frame, bool tryMixed, bool setMarker);
62
    const StackFrame &frame() const;
63
    void resetLocation();
64
    void setContents(const DisassemblerLines &contents);
65 66
    void updateLocationMarker();
    void updateBreakpointMarkers();
67 68 69 70 71

    // Mimetype: "text/a-asm" or some specialized architecture
    QString mimeType() const;
    Q_SLOT void setMimeType(const QString &mt);

72
    quint64 address() const;
73
    bool contentsCoversAddress(const QString &contents) const;
74
    void cleanup();
75
    bool isMixed() const;
76

77
    // Return address of an assembly line "0x0dfd  bla"
78
    static quint64 addressFromDisassemblyLine(const QString &data);
79

80 81 82 83 84
private:
    DisassemblerViewAgentPrivate *d;
};


85 86 87
} // namespace Internal
} // namespace Debugger

88
#endif // DEBUGGER_DISASSEMBLERAGENT_H