Update the breakpoint feature
authorJean-Paul Mari <djipi.mari@gmail.com>
Sat, 27 Mar 2021 00:12:02 +0000 (20:12 -0400)
committerJean-Paul Mari <djipi.mari@gmail.com>
Sat, 27 Mar 2021 00:12:02 +0000 (20:12 -0400)
Breakpoint list window refresh after to add a breakpoint

docs/vj_HistoryNotes.txt
src/debugger/NewFnctBreakpointWin.cpp
src/debugger/NewFnctBreakpointWin.h
src/gui/mainwin.cpp

index d285393..3bb478b 100644 (file)
@@ -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
 -- 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)
 -----------------------------
 
 Release 4a (15th August 2019)
 -----------------------------
index 268898c..5bfc8ba 100644 (file)
@@ -8,6 +8,7 @@
 // Who  When        What
 // ---  ----------  -----------------------------------------------------------
 // JPM  10/19/2018  Created this file
 // Who  When        What
 // ---  ----------  -----------------------------------------------------------
 // JPM  10/19/2018  Created this file
+// JPM  March/2021  Breakpoint list window refresh
 //
 
 // STILL TO DO:
 //
 
 // STILL TO DO:
@@ -40,6 +41,7 @@ add(new QPushButton(tr("Add")))
        setLayout(layout);
 
        connect(add, SIGNAL(clicked()), this, SLOT(AddBreakpointAddress()));
        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)
 // 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));
        S_BrkInfo Brk;
 
        memset(&Brk, 0, sizeof(Brk));
-       QPalette p = address->palette();
        newAddress = address->text();
 
        if ((len = newAddress.size()))
        newAddress = address->text();
 
        if ((len = newAddress.size()))
@@ -105,21 +119,28 @@ void NewFnctBreakpointWindow::AddBreakpointAddress(void)
                        Brk.Adr = adr;
 
                        // Add the breakpoint
                        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
                        {
                        }
                        else
                        {
-                               p.setColor(QPalette::Text, Qt::darkYellow);
+                               address->setText("");
                        }
                }
                else
                {
                        // Address is not valid
                        }
                }
                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()
+{
+}
index cb44aa9..ab79184 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <QtWidgets/QtWidgets>
 #include <stdint.h>
 
 #include <QtWidgets/QtWidgets>
 #include <stdint.h>
+#include "debugger/BreakpointsWin.h"
 
 class NewFnctBreakpointWindow: public QWidget
 {
 
 class NewFnctBreakpointWindow: public QWidget
 {
@@ -16,6 +17,8 @@ class NewFnctBreakpointWindow: public QWidget
 
        public:
                NewFnctBreakpointWindow(QWidget * parent = 0);
 
        public:
                NewFnctBreakpointWindow(QWidget * parent = 0);
+               void SetFnctBreakpointWin(BreakpointsWindow* BpW);
+               ~NewFnctBreakpointWindow();
 
        public slots:
 
 
        public slots:
 
@@ -24,11 +27,13 @@ class NewFnctBreakpointWindow: public QWidget
 
        protected slots:
                void AddBreakpointAddress(void);
 
        protected slots:
                void AddBreakpointAddress(void);
+               void SelectBreakpointAddress(void);
 
        private:
                QVBoxLayout *layout;
                QLineEdit *address;
                QPushButton *add;
 
        private:
                QVBoxLayout *layout;
                QLineEdit *address;
                QPushButton *add;
+               BreakpointsWindow* BPWin;
 };
 
 #endif // __NEWFNCTBREAKPOINTWIN_H__
 };
 
 #endif // __NEWFNCTBREAKPOINTWIN_H__
index 478dcd2..f9ead48 100644 (file)
@@ -1563,6 +1563,7 @@ void MainWin::DisableAllBreakpoints(void)
 // Open, or display, the new breakpoint function window\r
 void MainWin::ShowNewFunctionBreakpointWin(void)\r
 {\r
 // Open, or display, the new breakpoint function window\r
 void MainWin::ShowNewFunctionBreakpointWin(void)\r
 {\r
+       NewFunctionBreakpointWin->SetFnctBreakpointWin(BreakpointsWin);\r
        NewFunctionBreakpointWin->show();\r
        ShowBreakpointsWin();\r
 }\r
        NewFunctionBreakpointWin->show();\r
        ShowBreakpointsWin();\r
 }\r