Fixed bug with ordering of message tabs.

This commit is contained in:
Ernie Pasveer
2025-02-02 13:48:46 -06:00
parent 55341a681c
commit 1ea768b112
5 changed files with 52 additions and 12 deletions
+2 -2
View File
@@ -359,7 +359,7 @@ void SeerConsoleWidget::deleteConsole () {
void SeerConsoleWidget::connectConsole () {
if (isConsoleConnected()) {
qDebug() << "Console is already connected!";
//qDebug() << "Console is already connected!";
return;
}
@@ -376,7 +376,7 @@ void SeerConsoleWidget::connectConsole () {
void SeerConsoleWidget::disconnectConsole () {
if (isConsoleConnected() == false) {
qDebug() << "Console is already disconnected!";
//qDebug() << "Console is already disconnected!";
return;
}
+31 -6
View File
@@ -70,6 +70,7 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) {
_rememberManualCommandCount = 10;
_currentFrame = -1;
setIsQuitting(false);
setNewExecutableFlag(true);
setupUi(this);
@@ -141,6 +142,9 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) {
// Restore tab ordering.
readLogsSettings();
// Handle the app's 'quit' event, in case we want to do things before exiting.
QObject::connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, &SeerGdbWidget::handleAboutToQuit);
// Connect things.
QObject::connect(logsTabWidget->tabBar(), &QTabBar::tabMoved, this, &SeerGdbWidget::handleLogsTabMoved);
QObject::connect(logsTabWidget->tabBar(), &QTabBar::currentChanged, this, &SeerGdbWidget::handleLogsTabChanged);
@@ -363,6 +367,7 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) {
// Restore window settings.
readSettings();
}
SeerGdbWidget::~SeerGdbWidget () {
@@ -693,6 +698,11 @@ void SeerGdbWidget::handleLogsTabMoved (int from, int to) {
Q_UNUSED(from);
Q_UNUSED(to);
// Don't handle anything here if Seer is exiting.
if (isQuitting()) {
return;
}
writeLogsSettings();
}
@@ -700,6 +710,11 @@ void SeerGdbWidget::handleLogsTabChanged (int index) {
Q_UNUSED(index);
// Don't handle anything here if Seer is exiting.
if (isQuitting()) {
return;
}
writeLogsSettings();
}
@@ -725,8 +740,8 @@ void SeerGdbWidget::writeLogsSettings () {
QString current = logsTabWidget->tabBar()->tabText(logsTabWidget->tabBar()->currentIndex());
qDebug() << "Tabs" << tabs;
qDebug() << "Current" << current;
//qDebug() << "Tabs" << tabs;
//qDebug() << "Current" << current;
QSettings settings;
@@ -2001,8 +2016,6 @@ void SeerGdbWidget::handleGdbBreakpointCommand (QString breakpoint, QString comm
return;
}
qDebug().noquote() << "XXX: " << breakpoint << command;
handleGdbCommand("-break-commands " + breakpoint + " \"" + command + "\"");
handleGdbGenericpointList();
}
@@ -2859,6 +2872,12 @@ void SeerGdbWidget::handleConsoleModeChanged () {
}
}
void SeerGdbWidget::handleAboutToQuit () {
// Detect if we're exiting Seer.
setIsQuitting(true);
}
void SeerGdbWidget::writeSettings () {
//qDebug() << "Write Settings";
@@ -3070,6 +3089,14 @@ void SeerGdbWidget::readSettings () {
} settings.endGroup();
}
bool SeerGdbWidget::isQuitting () const {
return _isQuitting;
}
void SeerGdbWidget::setIsQuitting (bool f) {
_isQuitting = f;
}
bool SeerGdbWidget::isGdbRuning () const {
if (_gdbProcess->state() == QProcess::NotRunning) {
@@ -3237,8 +3264,6 @@ void SeerGdbWidget::createConsole () {
setConsoleMode(consoleMode());
setConsoleScrollLines(consoleScrollLines());
writeLogsSettings();
}
}
+5
View File
@@ -334,6 +334,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm {
void handleGdbProcessErrored (QProcess::ProcessError errorStatus);
void handleConsoleModeChanged ();
void handleAboutToQuit ();
signals:
void stoppingPointReached ();
@@ -346,6 +347,9 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm {
void readLogsSettings ();
private:
bool isQuitting () const;
void setIsQuitting (bool f);
bool isGdbRuning () const;
bool startGdb ();
bool startGdbRR ();
@@ -357,6 +361,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm {
SeerConsoleWidget* console ();
void sendGdbInterrupt (int signal);
bool _isQuitting;
QString _gdbProgram;
QString _gdbArguments;
QString _gdbProgramOverride;
+13
View File
@@ -6,6 +6,13 @@
#include <QtCore/QRegularExpressionMatch>
#include <QtCore/QByteArray>
// Comment out for now. I don't want to include boost because
// that would impact people try to compile Seer. Qt6 offer
// a 'stacktrace' function. OpenSuse may be slow in adoption.
// For now, comment it out and use when needed.
// #include <boost/stacktrace.hpp>
#include <iostream>
#include <mutex>
//
@@ -1258,5 +1265,11 @@ namespace Seer {
return result;
}
void printStackTrace () {
// Capture and print the stack trace using Boost.Stacktrace.
// See comments at top.
// std::cout << "Stack trace:\n" << boost::stacktrace::stacktrace() << std::endl;
}
}
+1 -4
View File
@@ -31,9 +31,7 @@ namespace Seer {
QString elideText (const QString& str, Qt::TextElideMode mode, int length);
QStringList split (const QString& str);
QString unescape (const QString& str);
int createID ();
unsigned char ebcdicToAscii (unsigned char byte);
unsigned char ucharToAscii (unsigned char byte);
QString ucharToHex (const QVector<quint8>& bytes, int from, int count);
@@ -47,9 +45,8 @@ namespace Seer {
QString ucharToLong (const QVector<quint8>& bytes, int from, int count);
QString ucharToFloat (const QVector<quint8>& bytes, int from, int count);
QString ucharToDouble (const QVector<quint8>& bytes, int from, int count);
int typeBytes (const QString& type);
bool readFile (const QString& filename, QStringList& lines);
void printStackTrace ();
}