From: Jean-Paul Mari Date: Sat, 27 Mar 2021 00:12:02 +0000 (-0400) Subject: Update the breakpoint feature X-Git-Tag: v2.1.3-R5^2~20 X-Git-Url: http://git.hcoop.net/clinton/Virtual-Jaguar-Rx.git/commitdiff_plain/cbd79f6681578e8e8086cd175b1fbe5301a0b43d Update the breakpoint feature Breakpoint list window refresh after to add a breakpoint --- diff --git a/docs/vj_HistoryNotes.txt b/docs/vj_HistoryNotes.txt index d285393..3bb478b 100644 --- a/docs/vj_HistoryNotes.txt +++ b/docs/vj_HistoryNotes.txt @@ -32,6 +32,7 @@ Release 5 (TBA) -- Added a M68K exception catch check in the Alpine tab settings -- Added a specific breakpoint for the M68K bus error exception 21) Project has switched to libdwarf 20210305 library 64bits for VS 2017 +22) Breakpoint list window is now refreshed after a new breakpoint is set Release 4a (15th August 2019) ----------------------------- diff --git a/src/debugger/NewFnctBreakpointWin.cpp b/src/debugger/NewFnctBreakpointWin.cpp index 268898c..5bfc8ba 100644 --- a/src/debugger/NewFnctBreakpointWin.cpp +++ b/src/debugger/NewFnctBreakpointWin.cpp @@ -8,6 +8,7 @@ // Who When What // --- ---------- ----------------------------------------------------------- // JPM 10/19/2018 Created this file +// JPM March/2021 Breakpoint list window refresh // // STILL TO DO: @@ -40,6 +41,7 @@ add(new QPushButton(tr("Add"))) setLayout(layout); connect(add, SIGNAL(clicked()), this, SLOT(AddBreakpointAddress())); + connect(address, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(SelectBreakpointAddress())); } @@ -60,6 +62,19 @@ void NewFnctBreakpointWindow::keyPressEvent(QKeyEvent * e) } +// +void NewFnctBreakpointWindow::SetFnctBreakpointWin(BreakpointsWindow* BpW) +{ + BPWin = BpW; +} + + +void NewFnctBreakpointWindow::SelectBreakpointAddress(void) +{ + address->setStyleSheet("color: black"); +} + + // Add a breakpoint to the address // Address can be an hexa, decimal or a symbol name void NewFnctBreakpointWindow::AddBreakpointAddress(void) @@ -71,7 +86,6 @@ void NewFnctBreakpointWindow::AddBreakpointAddress(void) S_BrkInfo Brk; memset(&Brk, 0, sizeof(Brk)); - QPalette p = address->palette(); newAddress = address->text(); if ((len = newAddress.size())) @@ -105,21 +119,28 @@ void NewFnctBreakpointWindow::AddBreakpointAddress(void) Brk.Adr = adr; // Add the breakpoint - if (m68k_brk_add(&Brk)) + if (!m68k_brk_add(&Brk)) { - p.setColor(QPalette::Text, Qt::black); + address->setStyleSheet("color: green"); } else { - p.setColor(QPalette::Text, Qt::darkYellow); + address->setText(""); } } else { // Address is not valid - p.setColor(QPalette::Text, Qt::red); + address->setStyleSheet("color: red"); } - address->setPalette(p); + // update the breakpoint functions window + BPWin->RefreshContents(); } } + + +// +NewFnctBreakpointWindow::~NewFnctBreakpointWindow() +{ +} diff --git a/src/debugger/NewFnctBreakpointWin.h b/src/debugger/NewFnctBreakpointWin.h index cb44aa9..ab79184 100644 --- a/src/debugger/NewFnctBreakpointWin.h +++ b/src/debugger/NewFnctBreakpointWin.h @@ -9,6 +9,7 @@ #include #include +#include "debugger/BreakpointsWin.h" class NewFnctBreakpointWindow: public QWidget { @@ -16,6 +17,8 @@ class NewFnctBreakpointWindow: public QWidget public: NewFnctBreakpointWindow(QWidget * parent = 0); + void SetFnctBreakpointWin(BreakpointsWindow* BpW); + ~NewFnctBreakpointWindow(); public slots: @@ -24,11 +27,13 @@ class NewFnctBreakpointWindow: public QWidget protected slots: void AddBreakpointAddress(void); + void SelectBreakpointAddress(void); private: QVBoxLayout *layout; QLineEdit *address; QPushButton *add; + BreakpointsWindow* BPWin; }; #endif // __NEWFNCTBREAKPOINTWIN_H__ diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index 478dcd2..f9ead48 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -1563,6 +1563,7 @@ void MainWin::DisableAllBreakpoints(void) // Open, or display, the new breakpoint function window void MainWin::ShowNewFunctionBreakpointWin(void) { + NewFunctionBreakpointWin->SetFnctBreakpointWin(BreakpointsWin); NewFunctionBreakpointWin->show(); ShowBreakpointsWin(); }