From a6d8d890aaf79864a3d49ba4ee878bb0cbf3dc5d Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Mon, 28 Mar 2022 19:07:39 -0500 Subject: [PATCH] Fixed the "new arguments" dialog. When specifying new arguments with File->Arguments dialog, the new arguments were not being passed to gdb. Now fixed. This feature applies to 'run' and 'start'. Remove it from 'attach'. --- src/SeerGdbWidget.cpp | 9 ++++++--- src/SeerMainWindow.cpp | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/SeerGdbWidget.cpp b/src/SeerGdbWidget.cpp index 87b236e..70313bd 100644 --- a/src/SeerGdbWidget.cpp +++ b/src/SeerGdbWidget.cpp @@ -514,13 +514,15 @@ void SeerGdbWidget::handleGdbRunExecutable () { if (newExecutableFlag() == true) { handleGdbExecutableName(); // Load the program into the gdb process. handleGdbExecutableSources(); // Load the program source files. - handleGdbExecutableArguments(); // Set the program's arguments before running. handleGdbExecutableWorkingDirectory(); // Set the program's working directory before running. handleGdbExecutableLoadBreakpoints(); // Set the program's breakpoints (if any) before running. } setNewExecutableFlag(false); + // Set the program's arguments before running. + handleGdbExecutableArguments(); + // Run the executable. Do not stop in main. handleGdbCommand("-exec-run"); @@ -589,13 +591,15 @@ void SeerGdbWidget::handleGdbStartExecutable () { if (newExecutableFlag() == true) { handleGdbExecutableName(); // Load the program into the gdb process. handleGdbExecutableSources(); // Load the program source files. - handleGdbExecutableArguments(); // Set the program's arguments before running. handleGdbExecutableWorkingDirectory(); // Set the program's working directory before running. handleGdbExecutableLoadBreakpoints(); // Set the program's breakpoints (if any) before running. } setNewExecutableFlag(false); + // Set the program's arguments before running. + handleGdbExecutableArguments(); + // Run the executable. Stop in main. handleGdbCommand("-exec-run --start"); @@ -656,7 +660,6 @@ void SeerGdbWidget::handleGdbAttachExecutable () { if (newExecutableFlag() == true) { handleGdbExecutableName(); // Load the program into the gdb process. handleGdbExecutableSources(); // Load the program source files. - handleGdbExecutableArguments(); // Set the program's arguments before running. handleGdbExecutableWorkingDirectory(); // Set the program's working directory before running. } diff --git a/src/SeerMainWindow.cpp b/src/SeerMainWindow.cpp index 82fd24b..75dc5f2 100644 --- a/src/SeerMainWindow.cpp +++ b/src/SeerMainWindow.cpp @@ -132,6 +132,7 @@ const QString& SeerMainWindow::executableName () const { } void SeerMainWindow::setExecutableArguments (const QString& executableArguments) { + gdbWidget->setExecutableArguments(executableArguments); }