Added logic to allow for quick toggling of breakpoints by just clicking left mouse button between the end of cdl end boundary and the beginning of the line address text.

This commit is contained in:
mjbudd77 2021-07-09 00:01:32 -04:00
parent a712448d81
commit 1efe2de1f7
2 changed files with 44 additions and 3 deletions

View File

@ -1062,7 +1062,7 @@ void ConsoleDebugger::selBmAddrChanged(const QString &txt)
//printf("selBmAddrVal = %04X\n", selBmAddrVal ); //printf("selBmAddrVal = %04X\n", selBmAddrVal );
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void ConsoleDebugger::openBpEditWindow( int editIdx, watchpointinfo *wp ) void ConsoleDebugger::openBpEditWindow( int editIdx, watchpointinfo *wp, bool forceAccept )
{ {
int ret; int ret;
QDialog dialog(this); QDialog dialog(this);
@ -1237,7 +1237,14 @@ void ConsoleDebugger::openBpEditWindow( int editIdx, watchpointinfo *wp )
dialog.setLayout( mainLayout ); dialog.setLayout( mainLayout );
if ( forceAccept )
{
ret = QDialog::Accepted;
}
else
{
ret = dialog.exec(); ret = dialog.exec();
}
if ( ret == QDialog::Accepted ) if ( ret == QDialog::Accepted )
{ {
@ -2260,6 +2267,32 @@ void QAsmView::setPC_placement( int mode, int ofs )
g_config->save(); g_config->save();
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void QAsmView::toggleBreakpoint(int line)
{
if ( line < asmEntry.size() )
{
int bpNum = isBreakpointAtLine(line);
if ( bpNum >= 0 )
{
DeleteBreak( bpNum );
}
else
{
watchpointinfo wp;
wp.address = asmEntry[line]->addr;
wp.endaddress = 0;
wp.flags = WP_X | WP_E;
wp.condText = 0;
wp.desc = NULL;
dbgWin->openBpEditWindow( -1, &wp, true );
}
asmEntry[line]->bpNum = isBreakpointAtLine(line);
}
}
//----------------------------------------------------------------------------
int QAsmView::isBreakpointAtAddr( int addr ) int QAsmView::isBreakpointAtAddr( int addr )
{ {
for (int i=0; i<numWPs; i++) for (int i=0; i<numWPs; i++)
@ -4192,6 +4225,13 @@ void QAsmView::mousePressEvent(QMouseEvent * event)
txtHlgtAnchorLine = line; txtHlgtAnchorLine = line;
setHighlightEndCoord( c.x(), line ); setHighlightEndCoord( c.x(), line );
if ( (c.x() >= 2) && (c.x() <= 3) )
{
//printf("Toggle BP!\n");
toggleBreakpoint(line);
}
} }
selAddrLine = -1; selAddrLine = -1;

View File

@ -133,6 +133,7 @@ class QAsmView : public QWidget
void wheelEvent(QWheelEvent *event); void wheelEvent(QWheelEvent *event);
void contextMenuEvent(QContextMenuEvent *event); void contextMenuEvent(QContextMenuEvent *event);
void loadHighlightToClipboard(void); void loadHighlightToClipboard(void);
void toggleBreakpoint(int line);
void calcFontData(void); void calcFontData(void);
QPoint convPixToCursor( QPoint p ); QPoint convPixToCursor( QPoint p );
@ -230,7 +231,7 @@ class ConsoleDebugger : public QDialog
void updateWindowData(void); void updateWindowData(void);
void updateRegisterView(void); void updateRegisterView(void);
void breakPointNotify(int bpNum); void breakPointNotify(int bpNum);
void openBpEditWindow(int editIdx = -1, watchpointinfo *wp = NULL ); void openBpEditWindow(int editIdx = -1, watchpointinfo *wp = NULL, bool forceAccept = false );
void openDebugSymbolEditWindow( int addr ); void openDebugSymbolEditWindow( int addr );
void setBookmarkSelectedAddress( int addr ); void setBookmarkSelectedAddress( int addr );
int getBookmarkSelectedAddress(void){ return selBmAddrVal; }; int getBookmarkSelectedAddress(void){ return selBmAddrVal; };