GUI: Breakpoint window has been started
This commit is contained in:
parent
3b8d5b8448
commit
84c42e9d95
|
@ -47,7 +47,8 @@ SOURCES += \
|
|||
Src/Gui/StatusLabel.cpp \
|
||||
Src/BasicView/WordEditDialog.cpp \
|
||||
Src/Gui/CPUDisassembly.cpp \
|
||||
Src/BasicView/LineEditDialog.cpp
|
||||
Src/BasicView/LineEditDialog.cpp \
|
||||
Src/Gui/BreakpointsView.cpp
|
||||
|
||||
|
||||
HEADERS += \
|
||||
|
@ -75,7 +76,8 @@ HEADERS += \
|
|||
Src/Gui/StatusLabel.h \
|
||||
Src/BasicView/WordEditDialog.h \
|
||||
Src/Gui/CPUDisassembly.h \
|
||||
Src/BasicView/LineEditDialog.h
|
||||
Src/BasicView/LineEditDialog.h \
|
||||
Src/Gui/BreakpointsView.h
|
||||
|
||||
INCLUDEPATH += \
|
||||
Src \
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
#include "BreakpointsView.h"
|
||||
|
||||
BreakpointsView::BreakpointsView(QWidget *parent) :QWidget(parent)
|
||||
{
|
||||
mHardBPTable = new StdTable(this);
|
||||
mHardBPTable->setMaximumHeight(100);
|
||||
mSoftBPTable = new StdTable(this);
|
||||
|
||||
mHardBPTable->addColumnAt(50, false);
|
||||
mHardBPTable->addColumnAt(50, false);
|
||||
|
||||
mSoftBPTable->addColumnAt(50, false);
|
||||
mSoftBPTable->addColumnAt(50, false);
|
||||
|
||||
mVertLayout = new QVBoxLayout;
|
||||
mVertLayout->setSpacing(0);
|
||||
mVertLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
mVertLayout->addWidget(mHardBPTable);
|
||||
mVertLayout->addWidget(mSoftBPTable);
|
||||
|
||||
this->setLayout(mVertLayout);
|
||||
}
|
||||
|
||||
|
||||
void BreakpointsView::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
BPMAP wBPList;
|
||||
int wI;
|
||||
|
||||
// Hardware
|
||||
DbgGetBpList(bp_hardware, &wBPList);
|
||||
mHardBPTable->setRowCount(wBPList.count);
|
||||
|
||||
for(wI = 0; wI < wBPList.count; wI++)
|
||||
{
|
||||
mHardBPTable->setCellContent(wI, 0, QString("%1").arg(wBPList.bp[wI].addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper());
|
||||
}
|
||||
|
||||
// Software
|
||||
DbgGetBpList(bp_normal, &wBPList);
|
||||
mSoftBPTable->setRowCount(wBPList.count);
|
||||
|
||||
for(wI = 0; wI < wBPList.count; wI++)
|
||||
{
|
||||
mSoftBPTable->setCellContent(wI, 0, QString("%1").arg(wBPList.bp[wI].addr, sizeof(int_t) * 2, 16, QChar('0')).toUpper());
|
||||
}
|
||||
|
||||
|
||||
QWidget::paintEvent(event);
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef BREAKPOINTSVIEW_H
|
||||
#define BREAKPOINTSVIEW_H
|
||||
|
||||
#include <QtGui>
|
||||
#include "StdTable.h"
|
||||
#include <QDebug>
|
||||
|
||||
class BreakpointsView : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit BreakpointsView(QWidget *parent = 0);
|
||||
void paintEvent(QPaintEvent* event);
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
private:
|
||||
QVBoxLayout* mVertLayout;
|
||||
StdTable* mHardBPTable;
|
||||
StdTable* mSoftBPTable;
|
||||
|
||||
};
|
||||
|
||||
#endif // BREAKPOINTSVIEW_H
|
|
@ -38,6 +38,13 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||
mLogView->hide();
|
||||
mLogView->setGeometry(20, 20, 800, 300);
|
||||
|
||||
// Breakpoints
|
||||
mBreakpointsView = new QMdiSubWindow();
|
||||
mBreakpointsView->setWindowTitle("Breakpoints");
|
||||
mBreakpointsView->setWidget(new BreakpointsView());
|
||||
mBreakpointsView->hide();
|
||||
mBreakpointsView->setGeometry(20, 20, 800, 300);
|
||||
|
||||
mdiArea = new QMdiArea;
|
||||
mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
|
@ -56,6 +63,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||
mdiArea->addSubWindow(subWindow);
|
||||
mdiArea->addSubWindow(mMemMapView);
|
||||
mdiArea->addSubWindow(mLogView);
|
||||
mdiArea->addSubWindow(mBreakpointsView);
|
||||
|
||||
setCentralWidget(mdiArea);
|
||||
|
||||
|
@ -87,6 +95,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||
connect(ui->actionPause,SIGNAL(triggered()),this,SLOT(execPause()));
|
||||
connect(ui->actionScylla,SIGNAL(triggered()),this,SLOT(startScylla()));
|
||||
connect(ui->actionRestart,SIGNAL(triggered()),this,SLOT(restartDebugging()));
|
||||
connect(ui->actionBreakpoints,SIGNAL(triggered()),this,SLOT(displayBreakpointWidget()));
|
||||
|
||||
const char* errormsg=DbgInit();
|
||||
if(errormsg)
|
||||
|
@ -214,6 +223,12 @@ void MainWindow::restartDebugging()
|
|||
Bridge::getBridge()->execCmd(cmd.sprintf("init \"%s\"", filename).toUtf8().constData());
|
||||
}
|
||||
|
||||
void MainWindow::displayBreakpointWidget()
|
||||
{
|
||||
mBreakpointsView->widget()->show();
|
||||
mBreakpointsView->setFocus();
|
||||
}
|
||||
|
||||
void MainWindow::dragEnterEvent(QDragEnterEvent* pEvent)
|
||||
{
|
||||
if(pEvent->mimeData()->hasUrls())
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "LogView.h"
|
||||
#include "GotoDialog.h"
|
||||
#include "StatusLabel.h"
|
||||
#include "BreakpointsView.h"
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
|
@ -40,6 +41,7 @@ public slots:
|
|||
void execPause();
|
||||
void startScylla();
|
||||
void restartDebugging();
|
||||
void displayBreakpointWidget();
|
||||
|
||||
private slots:
|
||||
void on_actionGoto_triggered();
|
||||
|
@ -53,6 +55,7 @@ private:
|
|||
|
||||
QMdiSubWindow* mMemMapView;
|
||||
QMdiSubWindow* mLogView;
|
||||
QMdiSubWindow* mBreakpointsView;
|
||||
|
||||
StatusLabel* mStatusLabel;
|
||||
StatusLabel* mLastLogLabel;
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
</property>
|
||||
<addaction name="actionMemoryMap"/>
|
||||
<addaction name="actionLog"/>
|
||||
<addaction name="actionBreakpoints"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuDebug">
|
||||
<property name="title">
|
||||
|
@ -101,6 +102,7 @@
|
|||
<addaction name="actionGoto"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionLog"/>
|
||||
<addaction name="actionBreakpoints"/>
|
||||
<addaction name="actionMemoryMap"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionScylla"/>
|
||||
|
@ -300,6 +302,18 @@
|
|||
<string>Ctrl+I</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionBreakpoints">
|
||||
<property name="icon">
|
||||
<iconset resource="../../resource.qrc">
|
||||
<normaloff>:/icons/images/alphabet/B.png</normaloff>:/icons/images/alphabet/B.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Breakpoints</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Alt+B</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources>
|
||||
|
|
|
@ -18,5 +18,6 @@
|
|||
<file>images/ui-combo-box-edit.png</file>
|
||||
<file>images/scylla.png</file>
|
||||
<file>images/compile-error.png</file>
|
||||
<file>images/alphabet/B.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
Loading…
Reference in New Issue