Move gdb messages into a tab in the breakpoints manager.

This commit is contained in:
Ernie Pasveer
2023-10-05 19:17:12 -05:00
parent b32d28fb83
commit 93b8719fac
9 changed files with 259 additions and 27 deletions
+13 -22
View File
@@ -108,9 +108,6 @@ SeerMainWindow::SeerMainWindow(QWidget* parent) : QMainWindow(parent) {
setKeySettings(SeerKeySettings::populate());
setProjectFilename("");
// Create the message list.
_executionMessages = new SeerMessagesDialog(this);
//
// Set up signals/slots.
//
@@ -123,7 +120,6 @@ SeerMainWindow::SeerMainWindow(QWidget* parent) : QMainWindow(parent) {
QObject::connect(actionViewBasicStructVisualizer, &QAction::triggered, this, &SeerMainWindow::handleViewStructVisualizer);
QObject::connect(actionViewImageVisualizer, &QAction::triggered, this, &SeerMainWindow::handleViewImageVisualizer);
QObject::connect(actionViewAssembly, &QAction::triggered, this, &SeerMainWindow::handleViewAssembly);
QObject::connect(actionViewExecutionMessages, &QAction::triggered, this, &SeerMainWindow::handleViewExecutionMessages);
QObject::connect(actionConsoleNormal, &QAction::triggered, this, &SeerMainWindow::handleViewConsoleNormal);
QObject::connect(actionConsoleHidden, &QAction::triggered, this, &SeerMainWindow::handleViewConsoleHidden);
QObject::connect(actionConsoleMinimized, &QAction::triggered, this, &SeerMainWindow::handleViewConsoleMinimized);
@@ -572,11 +568,6 @@ void SeerMainWindow::handleViewAssembly () {
gdbWidget->editorManager()->showAssembly();
}
void SeerMainWindow::handleViewExecutionMessages () {
_executionMessages->showMessages();
}
void SeerMainWindow::handleViewAssemblyShown (bool shown) {
// Corefile always have them off.
@@ -828,7 +819,7 @@ void SeerMainWindow::handleText (const QString& text) {
return;
}
_executionMessages->addMessage(Seer::filterEscapes(msg_text), QMessageBox::Warning);
gdbWidget->addMessage(Seer::filterEscapes(msg_text), QMessageBox::Warning);
return;
@@ -948,7 +939,7 @@ void SeerMainWindow::handleText (const QString& text) {
QString signalname_text = Seer::parseFirst(text, "signal-name=", '"', '"', false);
_executionMessages->addMessage("Program encountered a '" + signalname_text + "' signal.", QMessageBox::Warning);
gdbWidget->addMessage("Program encountered a '" + signalname_text + "' signal.", QMessageBox::Warning);
}else if (reason_text == "breakpoint-hit") {
@@ -956,9 +947,9 @@ void SeerMainWindow::handleText (const QString& text) {
QString disp_text = Seer::parseFirst(text, "disp=", '"', '"', false);
if (disp_text == "del") {
_executionMessages->addMessage("Program reached temporary breakpoint '" + bkptno_text + "'.", QMessageBox::Information);
gdbWidget->addMessage("Program reached temporary breakpoint '" + bkptno_text + "'.", QMessageBox::Information);
}else{
_executionMessages->addMessage("Program reached breakpoint '" + bkptno_text + "'.", QMessageBox::Information);
gdbWidget->addMessage("Program reached breakpoint '" + bkptno_text + "'.", QMessageBox::Information);
}
}else if (reason_text == "watchpoint-trigger") {
@@ -971,7 +962,7 @@ void SeerMainWindow::handleText (const QString& text) {
QString old_text = Seer::parseFirst(value_text, "old=", '"', '"', false);
QString new_text = Seer::parseFirst(value_text, "new=", '"', '"', false);
_executionMessages->addMessage(QString("Watchpoint triggered.\n\nNumber: %1\nExpression: %2\nOld value: %3\nNew value: %4").arg(number_text).arg(exp_text).arg(old_text).arg(new_text), QMessageBox::Information);
gdbWidget->addMessage(QString("Watchpoint triggered.\n\nNumber: %1\nExpression: %2\nOld value: %3\nNew value: %4").arg(number_text).arg(exp_text).arg(old_text).arg(new_text), QMessageBox::Information);
}else if (reason_text == "read-watchpoint-trigger") {
//*stopped,reason="read-watchpoint-trigger",hw-rwpt={number="5",exp="i"},value={value="42"},frame={addr="0x0000000000400d9a",func="function1",args=[{name="text",value="\"Hello, World!\""}],file="function1.cpp",fullname="/home/erniep/Development/Peak/src/Seer/helloworld/function1.cpp",line="11",arch="i386:x86-64"},thread-id="1",stopped-threads="all",core="4"
@@ -982,7 +973,7 @@ void SeerMainWindow::handleText (const QString& text) {
QString value_text = Seer::parseFirst(text, "value=", '{', '}', false);
QString value_text2 = Seer::parseFirst(value_text, "value=", '"', '"', false);
_executionMessages->addMessage(QString("Watchpoint triggered.\n\nNumber: %1\nExpression: %2\nValue: %3").arg(number_text).arg(exp_text).arg(value_text2), QMessageBox::Information);
gdbWidget->addMessage(QString("Watchpoint triggered.\n\nNumber: %1\nExpression: %2\nValue: %3").arg(number_text).arg(exp_text).arg(value_text2), QMessageBox::Information);
}else if (reason_text == "access-watchpoint-trigger") {
//*stopped,reason="access-watchpoint-trigger",hw-awpt={number="3",exp="v"},value={old="1",new="11"},frame={addr="0x000000000040059a",func="bar",args=[{name="v",value="11"}],file="helloonefile.cpp",fullname="/home/erniep/Development/Peak/src/Seer/helloonefile/helloonefile.cpp",line="15",arch="i386:x86-64"},thread-id="1",stopped-threads="all",core="3"
@@ -994,33 +985,33 @@ void SeerMainWindow::handleText (const QString& text) {
QString old_text = Seer::parseFirst(value_text, "old=", '"', '"', false);
QString new_text = Seer::parseFirst(value_text, "new=", '"', '"', false);
_executionMessages->addMessage(QString("Watchpoint triggered.\n\nNumber: %1\nExpression: %2\nOld value: %3\nNew value: %4").arg(number_text).arg(exp_text).arg(old_text).arg(new_text), QMessageBox::Information);
gdbWidget->addMessage(QString("Watchpoint triggered.\n\nNumber: %1\nExpression: %2\nOld value: %3\nNew value: %4").arg(number_text).arg(exp_text).arg(old_text).arg(new_text), QMessageBox::Information);
}else if (reason_text == "watchpoint-scope") {
//*stopped,reason="watchpoint-scope",wpnum="5", frame={func="callee3",args=[{name="strarg", value="0x11940 \"A string argument.\""}], file="../../../devo/gdb/testsuite/gdb.mi/basics.c", fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="18"}
QString wpnum_text = Seer::parseFirst(text, "wpnum=", '"', '"', false);
_executionMessages->addMessage(QString("Watchpoint went out of scope. Will be deleted.\n\nNumber: %1").arg(wpnum_text), QMessageBox::Information);
gdbWidget->addMessage(QString("Watchpoint went out of scope. Will be deleted.\n\nNumber: %1").arg(wpnum_text), QMessageBox::Information);
}else if (reason_text == "exited-normally") {
//*stopped,reason="exited-normally"
_executionMessages->addMessage("Program exited normally.", QMessageBox::Information);
gdbWidget->addMessage("Program exited normally.", QMessageBox::Information);
}else if (reason_text == "exited") {
//*stopped,reason="exited",exit-code="01"
QString exitcode_text = Seer::parseFirst(text, "exit-code=", '"', '"', false);
_executionMessages->addMessage("Program exited with code '" + exitcode_text +"'", QMessageBox::Information);
gdbWidget->addMessage("Program exited with code '" + exitcode_text +"'", QMessageBox::Information);
}else if (reason_text == "exited-signalled") {
//*stopped,reason="exited-signalled",signal-name="SIGSEGV",signal-meaning="Segmentation fault"
QString signalname_text = Seer::parseFirst(text, "signal-name=", '"', '"', false);
_executionMessages->addMessage("Program exited abnormally.\nIt encountered a '" + signalname_text + "' signal.", QMessageBox::Warning);
gdbWidget->addMessage("Program exited abnormally.\nIt encountered a '" + signalname_text + "' signal.", QMessageBox::Warning);
}else if (reason_text == "unknown") {
@@ -1029,7 +1020,7 @@ void SeerMainWindow::handleText (const QString& text) {
//qDebug() << "Text=" << text;
_executionMessages->addMessage("Program encountered an unknown problem. See the Gdb output tab for messages.", QMessageBox::Warning);
gdbWidget->addMessage("Program encountered an unknown problem. See the Gdb output tab for messages.", QMessageBox::Warning);
}
return;
@@ -1041,7 +1032,7 @@ void SeerMainWindow::handleText (const QString& text) {
//qDebug() << "Inferior pid = " << pid_text;
_executionMessages->addMessage("Program started. (pid=" + pid_text +")", QMessageBox::Information);
gdbWidget->addMessage("Program started. (pid=" + pid_text +")", QMessageBox::Information);
return;