2022-02-14 20:44:54 -06:00
|
|
|
#include "SeerGdbLogWidget.h"
|
2021-09-01 14:01:00 -05:00
|
|
|
#include "SeerUtl.h"
|
|
|
|
|
#include <QtWidgets/QScrollBar>
|
2023-05-05 17:00:08 -04:00
|
|
|
#include <QRegularExpression>
|
2021-09-01 14:01:00 -05:00
|
|
|
#include <QtCore/QDebug>
|
|
|
|
|
|
2022-02-14 20:44:54 -06:00
|
|
|
SeerGdbLogWidget::SeerGdbLogWidget (QWidget* parent) : SeerLogWidget(parent) {
|
2021-09-01 14:01:00 -05:00
|
|
|
}
|
|
|
|
|
|
2022-02-14 20:44:54 -06:00
|
|
|
SeerGdbLogWidget::~SeerGdbLogWidget () {
|
2021-09-01 14:01:00 -05:00
|
|
|
}
|
|
|
|
|
|
2022-02-14 20:44:54 -06:00
|
|
|
void SeerGdbLogWidget::processText (const QString& text) {
|
2021-09-01 14:01:00 -05:00
|
|
|
|
|
|
|
|
QString str;
|
|
|
|
|
|
|
|
|
|
// Remove leading "~"
|
|
|
|
|
// Remove leading "&"
|
2022-10-17 17:43:09 -05:00
|
|
|
// Remove leading "@"
|
2024-09-07 13:02:28 -05:00
|
|
|
switch (text.front().unicode()) {
|
|
|
|
|
case QChar('~').unicode():
|
|
|
|
|
case QChar('&').unicode():
|
|
|
|
|
case QChar('@').unicode():
|
|
|
|
|
|
|
|
|
|
str = text.mid(1);
|
2022-10-17 17:43:09 -05:00
|
|
|
|
2024-09-07 13:02:28 -05:00
|
|
|
// Remove leading """
|
|
|
|
|
if (str.front() == '"') {
|
|
|
|
|
str = str.mid(1);
|
|
|
|
|
}
|
2022-10-17 17:43:09 -05:00
|
|
|
|
2024-09-07 13:02:28 -05:00
|
|
|
// Remove trailing """
|
|
|
|
|
if (str.back() == '"') {
|
|
|
|
|
str.chop(1);
|
|
|
|
|
}
|
2022-10-17 17:43:09 -05:00
|
|
|
|
2024-09-07 13:02:28 -05:00
|
|
|
break;
|
2022-10-17 17:43:09 -05:00
|
|
|
|
2024-09-07 13:02:28 -05:00
|
|
|
default:
|
|
|
|
|
str = text;
|
2021-09-01 14:01:00 -05:00
|
|
|
}
|
|
|
|
|
|
2024-09-07 13:02:28 -05:00
|
|
|
// https://github.com/epasveer/seer/issues/238
|
|
|
|
|
str = Seer::unescape(str);
|
2021-09-01 14:01:00 -05:00
|
|
|
|
|
|
|
|
// Write the string to the log.
|
2024-05-03 15:08:37 -05:00
|
|
|
textEdit->insertPlainText(str);
|
2022-04-17 18:38:59 -05:00
|
|
|
|
|
|
|
|
// If there is breakpoint message (via a manual command), ask
|
|
|
|
|
// for the breakpoint list to be refreshed.
|
|
|
|
|
//
|
|
|
|
|
// Breakpoint 2 at 0x403a40: file explorer.cpp, line 78.
|
|
|
|
|
//
|
2023-05-05 17:00:08 -04:00
|
|
|
if (str.contains(QRegularExpression("^Breakpoint ([0-9]+) at (0[xX][0-9a-fA-F]+): file (.*\\,) (line) ([0-9]+)"))) {
|
2022-04-17 18:38:59 -05:00
|
|
|
emit refreshBreakpointsList();
|
|
|
|
|
}
|
2021-09-01 14:01:00 -05:00
|
|
|
}
|
|
|
|
|
|