From 584593816f8f561c142d3b2d6f3f7c08273fb046 Mon Sep 17 00:00:00 2001 From: harry Date: Mon, 15 May 2023 20:42:17 -0400 Subject: [PATCH] Remove debug symbol save call from load symbols function so that live file edits are not overwriten. Added a save debug symbols debugger menu action so that this can be explicitly performed. Fixes issue #642. --- src/debugsymboltable.cpp | 1 - src/drivers/Qt/ConsoleDebugger.cpp | 17 +++++++++++++++++ src/drivers/Qt/ConsoleDebugger.h | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/debugsymboltable.cpp b/src/debugsymboltable.cpp index 60089fcd..a8f92b7c 100644 --- a/src/debugsymboltable.cpp +++ b/src/debugsymboltable.cpp @@ -756,7 +756,6 @@ int debugSymbolTable_t::loadGameSymbols(void) { int nPages, pageSize, romSize = 0x10000; - this->save(); this->clear(); if ( GameInfo != nullptr ) diff --git a/src/drivers/Qt/ConsoleDebugger.cpp b/src/drivers/Qt/ConsoleDebugger.cpp index 76b0eda6..406b7a74 100644 --- a/src/drivers/Qt/ConsoleDebugger.cpp +++ b/src/drivers/Qt/ConsoleDebugger.cpp @@ -879,6 +879,16 @@ QMenuBar *ConsoleDebugger::buildMenuBar(void) symMenu->addAction(act); + // Symbols -> Save + act = new QAction(tr("&Save"), this); + //act->setShortcut(QKeySequence( tr("F7") ) ); + act->setStatusTip(tr("&Save")); + //act->setCheckable(true); + //act->setChecked( break_on_unlogged_data ); + connect( act, SIGNAL(triggered(void)), this, SLOT(saveSymbolsCB(void)) ); + + symMenu->addAction(act); + symMenu->addSeparator(); // Symbols -> Symbolic Debug @@ -2935,6 +2945,13 @@ void ConsoleDebugger::reloadSymbolsCB(void) FCEU_WRAPPER_UNLOCK(); } //---------------------------------------------------------------------------- +void ConsoleDebugger::saveSymbolsCB(void) +{ + FCEU_WRAPPER_LOCK(); + debugSymbolTable.save(); + FCEU_WRAPPER_UNLOCK(); +} +//---------------------------------------------------------------------------- void ConsoleDebugger::pcSetPlaceTop(void) { asmView->setPC_placement( 0 ); diff --git a/src/drivers/Qt/ConsoleDebugger.h b/src/drivers/Qt/ConsoleDebugger.h index f78f7d22..65278c80 100644 --- a/src/drivers/Qt/ConsoleDebugger.h +++ b/src/drivers/Qt/ConsoleDebugger.h @@ -632,6 +632,7 @@ class ConsoleDebugger : public QDialog void resizeToMinimumSizeHint(void); void resetCountersCB (void); void reloadSymbolsCB(void); + void saveSymbolsCB(void); void displayByteCodesCB(bool value); void displayTraceDataCB(bool value); void displayROMoffsetCB(bool value);