From 3099a233c33ea2d56ed3d0442bdf119f2cb9c58c Mon Sep 17 00:00:00 2001 From: Matthew Budd Date: Sun, 20 Sep 2020 16:37:41 -0400 Subject: [PATCH] Added debugger bookmark add/edit via ASM view context menu. --- src/drivers/Qt/ConsoleDebugger.cpp | 23 ++++++++++++++++++++--- src/drivers/Qt/ConsoleDebugger.h | 1 + 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/drivers/Qt/ConsoleDebugger.cpp b/src/drivers/Qt/ConsoleDebugger.cpp index 449c17d9..cb8479f2 100644 --- a/src/drivers/Qt/ConsoleDebugger.cpp +++ b/src/drivers/Qt/ConsoleDebugger.cpp @@ -1128,11 +1128,14 @@ void ConsoleDebugger::edit_BM_name( int addr ) int ret; debuggerBookmark_t *bm; QInputDialog dialog(this); + char stmp[128]; bm = dbgBmMgr.getAddr( addr ); + sprintf( stmp, "Specify Bookmark Name for %04X", addr ); + dialog.setWindowTitle( tr("Edit Bookmark") ); - dialog.setLabelText( tr("Specify Bookmark Name") ); + dialog.setLabelText( tr(stmp) ); dialog.setOkButtonText( tr("Edit") ); if ( bm != NULL ) @@ -1590,6 +1593,17 @@ void ConsoleDebugger::asmViewCtxMenuAddBP(void) } //---------------------------------------------------------------------------- +void ConsoleDebugger::asmViewCtxMenuAddBM(void) +{ + int addr = asmView->getCtxMenuAddr(); + + dbgBmMgr.addBookmark( addr ); + + edit_BM_name( addr ); + + bmListUpdate(false); +} +//---------------------------------------------------------------------------- void ConsoleDebugger::setBookmarkSelectedAddress( int addr ) { char stmp[32]; @@ -2935,10 +2949,13 @@ void QAsmView::contextMenuEvent(QContextMenuEvent *event) menu.addAction(act); connect( act, SIGNAL(triggered(void)), parent, SLOT(asmViewCtxMenuAddBP(void)) ); - act = new QAction(tr("Add Symbolic Debug Name"), this); + act = new QAction(tr("Add Symbolic Debug Marker"), this); menu.addAction(act); connect( act, SIGNAL(triggered(void)), parent, SLOT(asmViewCtxMenuAddSym(void)) ); - //connect( act, SIGNAL(triggered(void)), this, SLOT(addBookMarkCB(void)) ); + + act = new QAction(tr("Add Bookmark"), this); + menu.addAction(act); + connect( act, SIGNAL(triggered(void)), parent, SLOT(asmViewCtxMenuAddBM(void)) ); menu.exec(event->globalPos()); } diff --git a/src/drivers/Qt/ConsoleDebugger.h b/src/drivers/Qt/ConsoleDebugger.h index 03c73cdd..515b7cac 100644 --- a/src/drivers/Qt/ConsoleDebugger.h +++ b/src/drivers/Qt/ConsoleDebugger.h @@ -235,6 +235,7 @@ class ConsoleDebugger : public QDialog public slots: void closeWindow(void); void asmViewCtxMenuAddBP(void); + void asmViewCtxMenuAddBM(void); void asmViewCtxMenuAddSym(void); private slots: void updatePeriodic(void);