diff --git a/CHANGELOG.md b/CHANGELOG.md index ba9b605..5f4e4d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ the Debug dialog for the Run mode. Some apps use deferred loading of code with dlopen(). * Fixed bug when restoring from project file with 'start' mode. +* Improve visualizers for Ada arrays. "(system.address) 0x7fffffffcf10" ## [1.15] - 2023-03-04 * Revamp Debug dialog. Move debug modes into "tabs". diff --git a/src/SeerArrayVisualizerWidget.cpp b/src/SeerArrayVisualizerWidget.cpp index f4256bb..fb768a3 100644 --- a/src/SeerArrayVisualizerWidget.cpp +++ b/src/SeerArrayVisualizerWidget.cpp @@ -303,24 +303,26 @@ void SeerArrayVisualizerWidget::handleText (const QString& text) { if (id_text.toInt() == _aVariableId) { -#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) - QStringList words = Seer::filterEscapes(Seer::parseFirst(text, "value=", '"', '"', false)).split(' ', Qt::SkipEmptyParts); -#else - QStringList words = Seer::filterEscapes(Seer::parseFirst(text, "value=", '"', '"', false)).split(' ', QString::SkipEmptyParts); -#endif + // Look for an address in the value. + QRegExp re("0[xX][0-9a-fA-F]+"); - setAVariableAddress(words.first()); + re.indexIn(text); + + QString address = re.cap(); + + setAVariableAddress((address == "") ? "not an address" : address); } if (id_text.toInt() == _bVariableId) { -#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) - QStringList words = Seer::filterEscapes(Seer::parseFirst(text, "value=", '"', '"', false)).split(' ', Qt::SkipEmptyParts); -#else - QStringList words = Seer::filterEscapes(Seer::parseFirst(text, "value=", '"', '"', false)).split(' ', QString::SkipEmptyParts); -#endif + // Look for an address in the value. + QRegExp re("0[xX][0-9a-fA-F]+"); - setBVariableAddress(words.first()); + re.indexIn(text); + + QString address = re.cap(); + + setBVariableAddress((address == "") ? "not an address" : address); } }else if (text.contains(QRegExp("^([0-9]+)\\^done,memory="))) { diff --git a/src/SeerMemoryVisualizerWidget.cpp b/src/SeerMemoryVisualizerWidget.cpp index 29e269e..53ab9db 100644 --- a/src/SeerMemoryVisualizerWidget.cpp +++ b/src/SeerMemoryVisualizerWidget.cpp @@ -26,7 +26,6 @@ SeerMemoryVisualizerWidget::SeerMemoryVisualizerWidget (QWidget* parent) : QWidg setWindowTitle("Seer Memory Visualizer"); setAttribute(Qt::WA_DeleteOnClose); - //memoryLengthLineEdit->setValidator(new QIntValidator(1, 9999999, this)); memoryLengthLineEdit->setValidator(new QRegExpValidator(QRegExp("\\s*([1-9]\\d*\\s*)+"), this)); columnCountSpinBox->setValue(memoryHexEditor->bytesPerLine()); @@ -158,13 +157,14 @@ void SeerMemoryVisualizerWidget::handleText (const QString& text) { if (id_text.toInt() == _variableId) { -#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) - QStringList words = Seer::filterEscapes(Seer::parseFirst(text, "value=", '"', '"', false)).split(' ', Qt::SkipEmptyParts); -#else - QStringList words = Seer::filterEscapes(Seer::parseFirst(text, "value=", '"', '"', false)).split(' ', QString::SkipEmptyParts); -#endif + // Look for an address in the value. + QRegExp re("0[xX][0-9a-fA-F]+"); - setVariableAddress(words.first()); + re.indexIn(text); + + QString address = re.cap(); + + setVariableAddress((address == "") ? "not an address" : address); } }else if (text.contains(QRegExp("^([0-9]+)\\^done,memory="))) {