1
0
Fork 0

GUI: resolved issue #136 (double click on breakpoint will follow in disassembler) + "toogle" --> "toggle"

This commit is contained in:
Mr. eXoDia 2014-07-19 05:17:26 +02:00
parent e18b3735f3
commit 1e8a2772cb
5 changed files with 46 additions and 16 deletions

View File

@ -52,8 +52,11 @@ BreakpointsView::BreakpointsView(QWidget *parent) : QWidget(parent)
// Signals/Slots // Signals/Slots
connect(Bridge::getBridge(), SIGNAL(updateBreakpoints()), this, SLOT(reloadData())); connect(Bridge::getBridge(), SIGNAL(updateBreakpoints()), this, SLOT(reloadData()));
connect(mHardBPTable, SIGNAL(contextMenuSignal(const QPoint &)), this, SLOT(hardwareBPContextMenuSlot(const QPoint &))); connect(mHardBPTable, SIGNAL(contextMenuSignal(const QPoint &)), this, SLOT(hardwareBPContextMenuSlot(const QPoint &)));
connect(mHardBPTable, SIGNAL(doubleClickedSignal()), this, SLOT(doubleClickHardwareSlot()));
connect(mSoftBPTable, SIGNAL(contextMenuSignal(const QPoint &)), this, SLOT(softwareBPContextMenuSlot(const QPoint &))); connect(mSoftBPTable, SIGNAL(contextMenuSignal(const QPoint &)), this, SLOT(softwareBPContextMenuSlot(const QPoint &)));
connect(mSoftBPTable, SIGNAL(doubleClickedSignal()), this, SLOT(doubleClickSoftwareSlot()));
connect(mMemBPTable, SIGNAL(contextMenuSignal(const QPoint &)), this, SLOT(memoryBPContextMenuSlot(const QPoint &))); connect(mMemBPTable, SIGNAL(contextMenuSignal(const QPoint &)), this, SLOT(memoryBPContextMenuSlot(const QPoint &)));
connect(mMemBPTable, SIGNAL(doubleClickedSignal()), this, SLOT(doubleClickMemorySlot()));
} }
@ -250,12 +253,20 @@ void BreakpointsView::removeHardBPActionSlot()
void BreakpointsView::removeAllHardBPActionSlot() void BreakpointsView::removeAllHardBPActionSlot()
{ {
DbgCmdExec("bphwc");
} }
void BreakpointsView::enableDisableHardBPActionSlot() void BreakpointsView::enableDisableHardBPActionSlot()
{ {
Breakpoints::toogleBPByDisabling(bp_hardware, mHardBPTable->getCellContent(mHardBPTable->getInitialSelection(), 0).toULongLong(0, 16)); Breakpoints::toggleBPByDisabling(bp_hardware, mHardBPTable->getCellContent(mHardBPTable->getInitialSelection(), 0).toULongLong(0, 16));
}
void BreakpointsView::doubleClickHardwareSlot()
{
GuiAddStatusBarMessage("double click!");
QString addrText=mHardBPTable->getCellContent(mHardBPTable->getInitialSelection(), 0);
DbgCmdExecDirect(QString("disasm " + addrText).toUtf8().constData());
emit showCpu();
} }
@ -348,12 +359,19 @@ void BreakpointsView::removeSoftBPActionSlot()
void BreakpointsView::removeAllSoftBPActionSlot() void BreakpointsView::removeAllSoftBPActionSlot()
{ {
DbgCmdExec("bc");
} }
void BreakpointsView::enableDisableSoftBPActionSlot() void BreakpointsView::enableDisableSoftBPActionSlot()
{ {
Breakpoints::toogleBPByDisabling(bp_normal, mSoftBPTable->getCellContent(mSoftBPTable->getInitialSelection(), 0).toULongLong(0, 16)); Breakpoints::toggleBPByDisabling(bp_normal, mSoftBPTable->getCellContent(mSoftBPTable->getInitialSelection(), 0).toULongLong(0, 16));
}
void BreakpointsView::doubleClickSoftwareSlot()
{
QString addrText=mSoftBPTable->getCellContent(mSoftBPTable->getInitialSelection(), 0);
DbgCmdExecDirect(QString("disasm " + addrText).toUtf8().constData());
emit showCpu();
} }
@ -446,10 +464,17 @@ void BreakpointsView::removeMemBPActionSlot()
void BreakpointsView::removeAllMemBPActionSlot() void BreakpointsView::removeAllMemBPActionSlot()
{ {
DbgCmdExec("bpmc");
} }
void BreakpointsView::enableDisableMemBPActionSlot() void BreakpointsView::enableDisableMemBPActionSlot()
{ {
Breakpoints::toogleBPByDisabling(bp_memory, mMemBPTable->getCellContent(mMemBPTable->getInitialSelection(), 0).toULongLong(0, 16)); Breakpoints::toggleBPByDisabling(bp_memory, mMemBPTable->getCellContent(mMemBPTable->getInitialSelection(), 0).toULongLong(0, 16));
}
void BreakpointsView::doubleClickMemorySlot()
{
QString addrText=mMemBPTable->getCellContent(mMemBPTable->getInitialSelection(), 0);
DbgCmdExecDirect(QString("disasm " + addrText).toUtf8().constData());
emit showCpu();
} }

View File

@ -20,6 +20,7 @@ public:
void setupMemBPRightClickContextMenu(); void setupMemBPRightClickContextMenu();
signals: signals:
void showCpu();
public slots: public slots:
void reloadData(); void reloadData();
@ -29,18 +30,21 @@ public slots:
void removeHardBPActionSlot(); void removeHardBPActionSlot();
void removeAllHardBPActionSlot(); void removeAllHardBPActionSlot();
void enableDisableHardBPActionSlot(); void enableDisableHardBPActionSlot();
void doubleClickHardwareSlot();
// Software // Software
void softwareBPContextMenuSlot(const QPoint & pos); void softwareBPContextMenuSlot(const QPoint & pos);
void removeSoftBPActionSlot(); void removeSoftBPActionSlot();
void removeAllSoftBPActionSlot(); void removeAllSoftBPActionSlot();
void enableDisableSoftBPActionSlot(); void enableDisableSoftBPActionSlot();
void doubleClickSoftwareSlot();
// Memory // Memory
void memoryBPContextMenuSlot(const QPoint & pos); void memoryBPContextMenuSlot(const QPoint & pos);
void removeMemBPActionSlot(); void removeMemBPActionSlot();
void removeAllMemBPActionSlot(); void removeAllMemBPActionSlot();
void enableDisableMemBPActionSlot(); void enableDisableMemBPActionSlot();
void doubleClickMemorySlot();
private: private:
QVBoxLayout* mVertLayout; QVBoxLayout* mVertLayout;

View File

@ -47,6 +47,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
mBreakpointsView->setWindowTitle("Breakpoints"); mBreakpointsView->setWindowTitle("Breakpoints");
mBreakpointsView->setWindowIcon(QIcon(":/icons/images/breakpoint.png")); mBreakpointsView->setWindowIcon(QIcon(":/icons/images/breakpoint.png"));
mBreakpointsView->hide(); mBreakpointsView->hide();
connect(mBreakpointsView, SIGNAL(showCpu()), this, SLOT(displayCpuWidget()));
// Memory Map View // Memory Map View
mMemMapView = new MemoryMapView(); mMemMapView = new MemoryMapView();

View File

@ -237,7 +237,7 @@ void Breakpoints::removeBP(BPXTYPE type, uint_t va)
} }
/** /**
* @brief Toogle the given breakpoint by disabling it when enabled.@n * @brief Toggle the given breakpoint by disabling it when enabled.@n
* If breakpoint is initially active and enabled, it will be disabled.@n * If breakpoint is initially active and enabled, it will be disabled.@n
* If breakpoint is initially active and disabled, it will stay disabled.@n * If breakpoint is initially active and disabled, it will stay disabled.@n
* *
@ -245,7 +245,7 @@ void Breakpoints::removeBP(BPXTYPE type, uint_t va)
* *
* @return Nothing. * @return Nothing.
*/ */
void Breakpoints::toogleBPByDisabling(BRIDGEBP bp) void Breakpoints::toggleBPByDisabling(BRIDGEBP bp)
{ {
if(bp.enabled == true) if(bp.enabled == true)
disableBP(bp); disableBP(bp);
@ -254,7 +254,7 @@ void Breakpoints::toogleBPByDisabling(BRIDGEBP bp)
} }
/** /**
* @brief Toogle the given breakpoint by disabling it when enabled.@n * @brief Toggle the given breakpoint by disabling it when enabled.@n
* If breakpoint is initially active and enabled, it will be disabled.@n * If breakpoint is initially active and enabled, it will be disabled.@n
* If breakpoint is initially active and disabled, it will stay disabled.@n * If breakpoint is initially active and disabled, it will stay disabled.@n
* If breakpoint was previously removed, this method has no effect.@n * If breakpoint was previously removed, this method has no effect.@n
@ -264,7 +264,7 @@ void Breakpoints::toogleBPByDisabling(BRIDGEBP bp)
* *
* @return Nothing. * @return Nothing.
*/ */
void Breakpoints::toogleBPByDisabling(BPXTYPE type, uint_t va) void Breakpoints::toggleBPByDisabling(BPXTYPE type, uint_t va)
{ {
int wI = 0; int wI = 0;
BPMAP wBPList; BPMAP wBPList;
@ -277,7 +277,7 @@ void Breakpoints::toogleBPByDisabling(BPXTYPE type, uint_t va)
{ {
if(wBPList.bp[wI].addr == va) if(wBPList.bp[wI].addr == va)
{ {
toogleBPByDisabling(wBPList.bp[wI]); toggleBPByDisabling(wBPList.bp[wI]);
} }
} }
if(wBPList.count) if(wBPList.count)
@ -319,7 +319,7 @@ BPXSTATE Breakpoints::BPState(BPXTYPE type, uint_t va)
/** /**
* @brief Toogle the given breakpoint by disabling it when enabled.@n * @brief Toggle the given breakpoint by disabling it when enabled.@n
* If breakpoint is initially active and enabled, it will be disabled.@n * If breakpoint is initially active and enabled, it will be disabled.@n
* If breakpoint is initially active and disabled, it will stay disabled.@n * If breakpoint is initially active and disabled, it will stay disabled.@n
* If breakpoint was previously removed, this method has no effect.@n * If breakpoint was previously removed, this method has no effect.@n
@ -329,7 +329,7 @@ BPXSTATE Breakpoints::BPState(BPXTYPE type, uint_t va)
* *
* @return Nothing. * @return Nothing.
*/ */
void Breakpoints::toogleBPByRemoving(BPXTYPE type, uint_t va) void Breakpoints::toggleBPByRemoving(BPXTYPE type, uint_t va)
{ {
int wI = 0; int wI = 0;
BPMAP wBPList; BPMAP wBPList;

View File

@ -29,10 +29,10 @@ public:
static void removeBP(BRIDGEBP bp); static void removeBP(BRIDGEBP bp);
static void removeBP(BPXTYPE type, uint_t va); static void removeBP(BPXTYPE type, uint_t va);
static void toogleBPByDisabling(BRIDGEBP bp); static void toggleBPByDisabling(BRIDGEBP bp);
static void toogleBPByDisabling(BPXTYPE type, uint_t va); static void toggleBPByDisabling(BPXTYPE type, uint_t va);
static void toogleBPByRemoving(BPXTYPE type, uint_t va); static void toggleBPByRemoving(BPXTYPE type, uint_t va);
static BPXSTATE BPState(BPXTYPE type, uint_t va); static BPXSTATE BPState(BPXTYPE type, uint_t va);
signals: signals: