Cleaned up some more 'core' handling.

Make the 'gdbCore' more like 'gdbStart', 'gdbRun', and 'gdbAttach'.
'gdbConnect' will happen sometime.
This commit is contained in:
Ernie Pasveer
2022-03-12 10:04:09 -06:00
parent 48e36c08e9
commit 2293786006
2 changed files with 29 additions and 14 deletions
+28 -13
View File
@@ -709,12 +709,22 @@ void SeerGdbWidget::handleGdbCoreFileExecutable () {
return;
}
// Delete old console.
deleteConsole();
// Kill previous gdb, if any.
// Do you really want to restart?
if (isGdbRuning() == true) {
//XXX killGdb();
int result = QMessageBox::warning(this, "Seer",
QString("The executable is already running.\n\nAre you sure to restart it?"),
QMessageBox::Ok|QMessageBox::Cancel, QMessageBox::Cancel);
if (result == QMessageBox::Cancel) {
return;
}
}
if (newExecutableFlag() == true) {
killGdb();
disconnectConsole();
deleteConsole();
}
// If gdb isn't running, start it.
@@ -731,22 +741,27 @@ void SeerGdbWidget::handleGdbCoreFileExecutable () {
}else{
handleGdbCommand("-gdb-set unwind-on-terminating-exception off");
}
// Set dprint parameters.
resetDprintf();
}
// Create a new console.
createConsole();
// Set dprint parameters.
resetDprintf();
// No console for 'core' mode.
setExecutableLaunchMode("corefile");
setExecutablePid(0);
handleGdbExecutableName(); // Load the program into the gdb process.
handleGdbExecutableSources(); // Load the program source files.
handleGdbTtyDeviceName(); // Set the program's tty device for stdin and stdout.
if (newExecutableFlag() == true) {
handleGdbExecutableName(); // Load the program into the gdb process.
handleGdbExecutableSources(); // Load the program source files.
}
setNewExecutableFlag(false);
// Load the executable's core file.
handleGdbCommand(QString("-target-select core %1").arg(executableCoreFilename()));
// This is needed for code mode to refresh the stack frame, for some reason.
handleGdbStackListFrames();
}
void SeerGdbWidget::handleGdbShutdown () {
+1 -1
View File
@@ -223,7 +223,7 @@ void SeerMainWindow::launchExecutable (const QString& launchMode) {
QTimer::singleShot(200, this, &SeerMainWindow::handleFileDebug);
}else{
qWarning() << "SeerMainWindow::launchMode(): bad launchMode:" << launchMode;
qWarning() << "Bad launchMode:" << launchMode;
}
}