1
0
Fork 0

CPUSideBar : Fixed small bug that would crash the debugger

BreakpointsView : Added Enable/Disable All for Software BPs + Fixed breakpoints view not being updated after modifying a BP (enable/remove/disable, etc..)
This commit is contained in:
Herzeh 2015-12-23 20:12:59 +01:00
parent c78ede593a
commit 239983a311
5 changed files with 65 additions and 1 deletions

View File

@ -188,6 +188,11 @@ void BreakpointsView::reloadData()
mMemBPTable->setCellContent(wI, 4, "");
}
mMemBPTable->reloadData();
mMemBPTable->repaint();
mSoftBPTable->repaint();
mHardBPTable->repaint();
if(wBPList.count)
BridgeFree(wBPList.bp);
}
@ -333,6 +338,16 @@ void BreakpointsView::setupSoftBPRightClickContextMenu()
mSoftBPEnableDisableAction->setShortcutContext(Qt::WidgetShortcut);
mSoftBPTable->addAction(mSoftBPEnableDisableAction);
connect(mSoftBPEnableDisableAction, SIGNAL(triggered()), this, SLOT(enableDisableSoftBPActionSlot()));
// Enable All
mSoftBPEnableAllAction = new QAction("Enable All", this);
mSoftBPTable->addAction(mSoftBPEnableAllAction);
connect(mSoftBPEnableAllAction, SIGNAL(triggered()), this, SLOT(enableAllSoftBPActionSlot()));
// Disable All
mSoftBPDisableAllAction = new QAction("Disable All", this);
mSoftBPTable->addAction(mSoftBPDisableAllAction);
connect(mSoftBPDisableAllAction, SIGNAL(triggered()), this, SLOT(disableAllSoftBPActionSlot()));
}
void BreakpointsView::softwareBPContextMenuSlot(const QPoint & pos)
@ -377,6 +392,12 @@ void BreakpointsView::softwareBPContextMenuSlot(const QPoint & pos)
// Separator
wMenu->addSeparator();
// Enable All
wMenu->addAction(mSoftBPEnableAllAction);
// Enable All
wMenu->addAction(mSoftBPDisableAllAction);
// Remove All
wMenu->addAction(mSoftBPRemoveAllAction);
@ -412,6 +433,16 @@ void BreakpointsView::enableDisableSoftBPActionSlot()
table->selectNext();
}
void BreakpointsView::enableAllSoftBPActionSlot()
{
Breakpoints::toggleAllBP(bp_normal, true);
}
void BreakpointsView::disableAllSoftBPActionSlot()
{
Breakpoints::toggleAllBP(bp_normal, false);
}
void BreakpointsView::doubleClickSoftwareSlot()
{
StdTable* table = mSoftBPTable;

View File

@ -34,6 +34,8 @@ public slots:
void removeSoftBPActionSlot();
void removeAllSoftBPActionSlot();
void enableDisableSoftBPActionSlot();
void enableAllSoftBPActionSlot();
void disableAllSoftBPActionSlot();
void doubleClickSoftwareSlot();
// Memory
@ -59,6 +61,8 @@ private:
QAction* mSoftBPRemoveAction;
QAction* mSoftBPRemoveAllAction;
QAction* mSoftBPEnableDisableAction;
QAction* mSoftBPEnableAllAction;
QAction* mSoftBPDisableAllAction;
// Memory BP Context Menu
QAction* mMemBPRemoveAction;

View File

@ -278,7 +278,7 @@ void CPUSideBar::mouseReleaseEvent(QMouseEvent* e)
void CPUSideBar::mouseMoveEvent(QMouseEvent *event)
{
if(!DbgIsDebugging())
if(!DbgIsDebugging() || !InstrBuffer->size())
{
QAbstractScrollArea::mouseMoveEvent(event);
return;

View File

@ -279,6 +279,34 @@ void Breakpoints::toggleBPByDisabling(BPXTYPE type, duint va)
BridgeFree(wBPList.bp);
}
void Breakpoints::toggleAllBP(BPXTYPE type, bool bEnable)
{
BPMAP wBPList;
// Get breakpoints list
DbgGetBpList(type, &wBPList);
if(bEnable)
{
// Find breakpoint at address VA
for(int wI = 0; wI < wBPList.count; wI++)
{
enableBP(wBPList.bp[wI]);
}
}
else
{
// Find breakpoint at address VA
for(int wI = 0; wI < wBPList.count; wI++)
{
disableBP(wBPList.bp[wI]);
}
}
if(wBPList.count)
BridgeFree(wBPList.bp);
}
/**
* @brief returns if a breakpoint is disabled or not
*

View File

@ -26,6 +26,7 @@ public:
static void removeBP(BPXTYPE type, duint va);
static void toggleBPByDisabling(const BRIDGEBP & bp);
static void toggleBPByDisabling(BPXTYPE type, duint va);
static void toggleAllBP(BPXTYPE type, bool bEnable);
static void toggleBPByRemoving(BPXTYPE type, duint va);
static BPXSTATE BPState(BPXTYPE type, duint va);
};