OpenCores
URL https://opencores.org/ocsvn/riscv_vhdl/riscv_vhdl/trunk

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [gui_plugin/] [CpuWidgets/] [SymbolBrowserWidget.h] - Blame information for rev 5

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 sergeykhbr
/**
2
 * @file
3
 * @copyright  Copyright 2016 GNSS Sensor Ltd. All right reserved.
4
 * @author     Sergey Khabarov - sergeykhbr@gmail.com
5
 * @brief      Disassembler viewer form.
6
 */
7
 
8
#pragma once
9
 
10
#include "api_core.h"   // MUST BE BEFORE QtWidgets.h or any other Qt header.
11
#include "attribute.h"
12
#include "igui.h"
13
 
14
#include <QtWidgets/QMdiArea>
15
#include <QtWidgets/QMdiSubWindow>
16
#include <QtWidgets/QGridLayout>
17
#include <QtWidgets/QAction>
18
#include <QtGui/qevent.h>
19
 
20
namespace debugger {
21
 
22
class SymbolBrowserWidget : public QWidget {
23
    Q_OBJECT
24
public:
25
    SymbolBrowserWidget(IGui *igui, QWidget *parent);
26
 
27
public slots:
28
    void slotShowFunction(uint64_t addr, uint64_t sz) {
29
        emit signalShowFunction(addr, sz);
30
    }
31
    void slotShowData(uint64_t addr, uint64_t sz) {
32
        emit signalShowData(addr, sz);
33
    }
34
 
35
signals:
36
    void signalShowFunction(uint64_t addr, uint64_t sz);
37
    void signalShowData(uint64_t addr, uint64_t sz);
38
 
39
private:
40
    QGridLayout *gridLayout;
41
    IGui *igui_;
42
};
43
 
44
 
45
class SymbolBrowserQMdiSubWindow : public QMdiSubWindow {
46
    Q_OBJECT
47
public:
48
    SymbolBrowserQMdiSubWindow(IGui *igui, QMdiArea *area, QWidget *parent = 0)
49
        : QMdiSubWindow(parent) {
50
        area_ = area;
51
        setWindowTitle(tr("Symbol Browser"));
52
        setWindowIcon(QIcon(tr(":/images/info_96x96.png")));
53
 
54
        SymbolBrowserWidget *pWidget = new SymbolBrowserWidget(igui, this);
55
        setWidget(pWidget);
56
        connect(pWidget, SIGNAL(signalShowFunction(uint64_t, uint64_t)),
57
                parent, SLOT(slotOpenDisasm(uint64_t, uint64_t)));
58
        connect(pWidget, SIGNAL(signalShowData(uint64_t, uint64_t)),
59
                parent, SLOT(slotOpenMemory(uint64_t, uint64_t)));
60
 
61
        area_->addSubWindow(this);
62
        setAttribute(Qt::WA_DeleteOnClose);
63
        show();
64
    }
65
 
66
 
67
protected:
68
    void closeEvent(QCloseEvent *event_) Q_DECL_OVERRIDE {
69
        area_->removeSubWindow(this);
70
        event_->accept();
71
    }
72
private:
73
    QMdiArea *area_;
74
};
75
 
76
 
77
 
78
}  // namespace debugger

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.