Add 'catchpoint' support.

Still working on Editor config options.
This commit is contained in:
Ernie Pasveer
2021-12-31 13:00:54 -06:00
parent 07f2f0176b
commit 7449fc7e66
12 changed files with 372 additions and 681 deletions
+47 -4
View File
@@ -1,13 +1,56 @@
# Setting a catchpoint.
-catch-throw
-catch-throw [ -t ] [ -r regexp]
-catch-throw [ -t ] [ -r regexp]
-catch-rethrow [ -t ] [ -r regexp]
-catch-catch [ -t ] [ -r regexp]
-catch-catch [ -t ] [ -r regexp]
# When a catchpoint is reached.
*stopped,bkptno="2",reason="breakpoint-hit",disp="keep",frame={addr="0x00007fffed933b72",func="__cxa_throw",args=[],from="/usr/lib64/libstdc++.so.6",arch="i386:x86-64"},thread-id="1",stopped-threads="all",core="5"
*stopped,
bkptno="2",
reason="breakpoint-hit",
disp="keep",
frame={addr="0x00007fffed933b72",
func="__cxa_throw",
args=[],
from="/usr/lib64/libstdc++.so.6",
arch="i386:x86-64"
},
thread-id="1",
stopped-threads="all",
core="5"
# Return status from '-catch-xxxx' command.
^done,bkpt={number="2",type="catchpoint",disp="keep",enabled="y",what="exception catch",catch-type="catch",thread-groups=["i1"],times="0"}
^done,bkpt={number="3",type="catchpoint",disp="keep",enabled="y",what="exception throw",catch-type="throw",thread-groups=["i1"],times="0"}
^done,bkpt={number="4",type="catchpoint",disp="keep",enabled="y",what="exception rethrow",catch-type="rethrow",thread-groups=["i1"],times="0"}
^done,bkpt={number="2",type="catchpoint",disp="del",enabled="y",what="exception catch",catch-type="catch",thread-groups=["i1"],regexp="Exception*",times="0"}
# List catchpoints using the same method as listing breakpoints and watchpoints, except a different 'type'.
-break-list
^done,
BreakpointTable={
nr_rows="3",
nr_cols="6",
hdr=[
{width="7",alignment="-1",col_name="number",colhdr="Num"},
{width="14",alignment="-1",col_name="type",colhdr="Type"},
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
{width="18",alignment="-1",col_name="addr",colhdr="Address"},
{width="40",alignment="2",col_name="what",colhdr="What"}
],
body=[
bkpt={
number="2",type="catchpoint",disp="keep",enabled="y",what="exception catch",catch-type="catch",thread-groups=["i1"],times="0"
},
bkpt={
number="3",type="catchpoint",disp="keep",enabled="y",what="exception throw",catch-type="throw",thread-groups=["i1"],times="0"
},
bkpt={
number="4",type="catchpoint",disp="keep",enabled="y",what="exception rethrow",catch-type="rethrow",thread-groups=["i1"],times="0"
}
]
}
+4
View File
@@ -23,6 +23,8 @@ set(HEADER_FILES
SeerArgumentsDialog.h
SeerBreakpointCreateDialog.h
SeerBreakpointsBrowserWidget.h
SeerCatchpointCreateDialog.h
SeerCatchpointsBrowserWidget.h
SeerCaretAsteriskLogWidget.h
SeerConsoleWidget.h
SeerConfigDialog.h
@@ -78,6 +80,8 @@ set(SOURCE_FILES
SeerArgumentsDialog.cpp
SeerBreakpointCreateDialog.cpp
SeerBreakpointsBrowserWidget.cpp
SeerCatchpointCreateDialog.cpp
SeerCatchpointsBrowserWidget.cpp
SeerCaretAsteriskLogWidget.cpp
SeerConsoleWidget.cpp
SeerConfigDialog.cpp
+42 -151
View File
@@ -7,201 +7,92 @@ SeerCatchpointCreateDialog::SeerCatchpointCreateDialog (QWidget* parent) : QDial
setupUi(this);
// Setup the widgets
setFilename("");
setFunctionName("");
setLabelName("");
setLineNumber("");
setType("");
setNameText("");
setTemporaryEnabled (false);
setHardwareEnabled (false);
setPendingEnabled (false);
setDisabledEnabled (false);
setConditionalEnabled (false);
setIgnoreCountEnabled (false);
setThreadIdEnabled (false);
setConditionalText ("");
setIgnoreCountText ("");
setThreadIdText ("");
setNameEnabled (false);
// Connect things.
QObject::connect(conditionalCheckBox, &QCheckBox::clicked, conditionalLineEdit, &QLineEdit::setEnabled);
QObject::connect(ignoreCountCheckBox, &QCheckBox::clicked, ignoreCountLineEdit, &QLineEdit::setEnabled);
QObject::connect(threadIdCheckBox, &QCheckBox::clicked, threadIdLineEdit, &QLineEdit::setEnabled);
QObject::connect(nameCheckBox, &QCheckBox::clicked, nameLineEdit, &QLineEdit::setEnabled);
}
SeerCatchpointCreateDialog::~SeerCatchpointCreateDialog () {
}
void SeerCatchpointCreateDialog::setFilename (const QString& text) {
filenameLineEdit->setText(text);
void SeerCatchpointCreateDialog::setType (const QString& text) {
if (text == "throw") {
throwRadioButton->setChecked(true);
}else if (text == "rethrow") {
rethrowRadioButton->setChecked(true);
}else if (text == "catch") {
catchRadioButton->setChecked(true);
}else{
throwRadioButton->setChecked(true);
}
}
void SeerCatchpointCreateDialog::setFunctionName (const QString& text) {
functionLineEdit->setText(text);
}
QString SeerCatchpointCreateDialog::typeText () const {
void SeerCatchpointCreateDialog::setLabelName (const QString& text) {
labelLineEdit->setText(text);
}
if (throwRadioButton->isChecked()) {
return "throw";
void SeerCatchpointCreateDialog::setLineNumber (const QString& text) {
lineNumberLineEdit->setText(text);
}
}else if (rethrowRadioButton->isChecked()) {
return "rethrow";
QString SeerCatchpointCreateDialog::filenameText () const {
return filenameLineEdit->text();
}
}else if (catchRadioButton->isChecked()) {
return "catch";
QString SeerCatchpointCreateDialog::functionNameText () const {
return functionLineEdit->text();
}
QString SeerCatchpointCreateDialog::labelNameText () const {
return labelLineEdit->text();
}
QString SeerCatchpointCreateDialog::lineNumberText () const {
return lineNumberLineEdit->text();
}else{
return "throw";
}
}
void SeerCatchpointCreateDialog::setTemporaryEnabled (bool flag) {
temporaryCheckBox->setChecked(flag);
}
void SeerCatchpointCreateDialog::setHardwareEnabled (bool flag) {
hardwareCheckBox->setChecked(flag);
void SeerCatchpointCreateDialog::setNameEnabled (bool flag) {
nameCheckBox->setChecked(flag);
nameLineEdit->setEnabled(flag);
}
void SeerCatchpointCreateDialog::setPendingEnabled (bool flag) {
pendingCheckBox->setChecked(flag);
void SeerCatchpointCreateDialog::setNameText (const QString& text) {
nameLineEdit->setText(text);
}
void SeerCatchpointCreateDialog::setDisabledEnabled (bool flag) {
disabledCheckBox->setChecked(flag);
}
void SeerCatchpointCreateDialog::setConditionalEnabled (bool flag) {
conditionalCheckBox->setChecked(flag);
conditionalLineEdit->setEnabled(flag);
}
void SeerCatchpointCreateDialog::setIgnoreCountEnabled (bool flag) {
ignoreCountCheckBox->setChecked(flag);
ignoreCountLineEdit->setEnabled(flag);
}
void SeerCatchpointCreateDialog::setThreadIdEnabled (bool flag) {
threadIdCheckBox->setChecked(flag);
threadIdLineEdit->setEnabled(flag);
}
void SeerCatchpointCreateDialog::setConditionalText (const QString& text) {
conditionalLineEdit->setText(text);
}
void SeerCatchpointCreateDialog::setIgnoreCountText (const QString& text) {
ignoreCountLineEdit->setText(text);
}
void SeerCatchpointCreateDialog::setThreadIdText (const QString& text) {
threadIdLineEdit->setText(text);
QString SeerCatchpointCreateDialog::nameText () const {
return nameLineEdit->text();
}
bool SeerCatchpointCreateDialog::temporaryEnabled () const {
return temporaryCheckBox->isChecked();
}
bool SeerCatchpointCreateDialog::hardwareEnabled () const {
return hardwareCheckBox->isChecked();
}
bool SeerCatchpointCreateDialog::pendingEnabled () const {
return pendingCheckBox->isChecked();
}
bool SeerCatchpointCreateDialog::disabledEnabled () const {
return disabledCheckBox->isChecked();
}
bool SeerCatchpointCreateDialog::conditionalEnabled () const {
return conditionalCheckBox->isChecked();
}
bool SeerCatchpointCreateDialog::ignoreCountEnabled () const {
return ignoreCountCheckBox->isChecked();
}
bool SeerCatchpointCreateDialog::threadIdEnabled () const {
return threadIdCheckBox->isChecked();
}
QString SeerCatchpointCreateDialog::conditionalText () const {
return conditionalLineEdit->text();
}
QString SeerCatchpointCreateDialog::ignoreCountText () const {
return ignoreCountLineEdit->text();
}
QString SeerCatchpointCreateDialog::threadIdText () const {
return threadIdLineEdit->text();
bool SeerCatchpointCreateDialog::nameEnabled () const {
return nameCheckBox->isChecked();
}
QString SeerCatchpointCreateDialog::catchpointText () const {
// Build a catchpoint specification.
QString catchpointParameters;
QString catchpointParameters = typeText();
if (temporaryEnabled()) {
catchpointParameters += " -t";
}
if (hardwareEnabled()) {
catchpointParameters += " -h";
}
if (pendingEnabled()) {
catchpointParameters += " -f";
}
if (disabledEnabled()) {
catchpointParameters += " -d";
}
if (conditionalEnabled()) {
if (conditionalText() != "") {
catchpointParameters += " -c " + conditionalText();
if (nameEnabled()) {
if (nameText() != "") {
catchpointParameters += " -r " + nameText();
}
}
if (ignoreCountEnabled()) {
if (ignoreCountText() != "") {
catchpointParameters += " -i " + ignoreCountText();
}
}
if (threadIdEnabled()) {
if (threadIdText() != "") {
catchpointParameters += " -p " + threadIdText();
}
}
if (filenameText() != "") {
catchpointParameters += " --source " + filenameText();
}
if (functionNameText() != "") {
catchpointParameters += " --function " + functionNameText();
}
if (labelNameText() != "") {
catchpointParameters += " --label " + labelNameText();
}
if (lineNumberText() != "") {
catchpointParameters += " --line " + lineNumberText();
}
//qDebug() << __PRETTY_FUNCTION__ << ":" << catchpointParameters;
return catchpointParameters;
}
+7 -29
View File
@@ -13,39 +13,17 @@ class SeerCatchpointCreateDialog : public QDialog, protected Ui::SeerCatchpointC
explicit SeerCatchpointCreateDialog (QWidget* parent = 0);
~SeerCatchpointCreateDialog ();
void setFilename (const QString& text);
void setFunctionName (const QString& text);
void setLabelName (const QString& text);
void setLineNumber (const QString& text);
QString filenameText () const;
QString functionNameText () const;
QString labelNameText () const;
QString lineNumberText () const;
void setType (const QString& text);
QString typeText () const;
void setTemporaryEnabled (bool flag);
void setHardwareEnabled (bool flag);
void setPendingEnabled (bool flag);
void setDisabledEnabled (bool flag);
void setConditionalEnabled (bool flag);
void setIgnoreCountEnabled (bool flag);
void setThreadIdEnabled (bool flag);
void setConditionalText (const QString& text);
void setIgnoreCountText (const QString& text);
void setThreadIdText (const QString& text);
bool temporaryEnabled () const;
bool hardwareEnabled () const;
bool pendingEnabled () const;
bool disabledEnabled () const;
bool conditionalEnabled () const;
bool ignoreCountEnabled () const;
bool threadIdEnabled () const;
QString conditionalText () const;
QString ignoreCountText () const;
QString threadIdText () const;
void setNameEnabled (bool flag);
bool nameEnabled () const;
void setNameText (const QString& text);
QString nameText () const;
QString catchpointText () const;
+43 -190
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>489</width>
<height>395</height>
<width>521</width>
<height>304</height>
</rect>
</property>
<property name="windowTitle">
@@ -15,102 +15,67 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="catchpointLocationGroupBox">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Catchpoint Location</string>
<string>Catchpoint Type</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="filenameLabel">
<widget class="QRadioButton" name="throwRadioButton">
<property name="text">
<string>Filename</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QLineEdit" name="filenameLineEdit">
<property name="clearButtonEnabled">
<bool>true</bool>
<string>Catch on 'throw'</string>
</property>
<attribute name="buttonGroup">
<string notr="true">typeButtonGroup</string>
</attribute>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lineNumberLabel">
<widget class="QRadioButton" name="rethrowRadioButton">
<property name="text">
<string>Line number</string>
<string>Catch on 'rethrow'</string>
</property>
<attribute name="buttonGroup">
<string notr="true">typeButtonGroup</string>
</attribute>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineNumberLineEdit">
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="lineNumberHorizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<widget class="QLabel" name="functionLabel">
<widget class="QRadioButton" name="catchRadioButton">
<property name="text">
<string>Function</string>
<string>Catch on 'catch'</string>
</property>
<attribute name="buttonGroup">
<string notr="true">typeButtonGroup</string>
</attribute>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QLineEdit" name="functionLineEdit">
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelLabel">
<property name="text">
<string>Label</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="labelLineEdit">
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="2">
<spacer name="labelHorizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="catchpointTypeGroupBox">
<widget class="QGroupBox" name="catchpointLocationGroupBox">
<property name="title">
<string>Catchpoint Type</string>
<string>Catchpoint Location</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QCheckBox" name="nameCheckBox">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="nameLineEdit">
<property name="placeholderText">
<string>Exception name as a regular expression.</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="temporaryCheckBox">
<property name="text">
@@ -118,121 +83,6 @@
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="temporaryHorizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="conditionalCheckBox">
<property name="text">
<string>Conditional</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLineEdit" name="conditionalLineEdit">
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="hardwareCheckBox">
<property name="text">
<string>Hardware</string>
</property>
</widget>
</item>
<item row="1" column="1">
<spacer name="hardwareHorizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="ignoreCountCheckBox">
<property name="text">
<string>Ignore Count</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLineEdit" name="ignoreCountLineEdit">
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="pendingCheckBox">
<property name="text">
<string>Pending</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="pendingHorizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2">
<widget class="QCheckBox" name="threadIdCheckBox">
<property name="text">
<string>Thread Id</string>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QLineEdit" name="threadIdLineEdit">
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="disabledCheckBox">
<property name="text">
<string>Disabled</string>
</property>
</widget>
</item>
<item row="3" column="1">
<spacer name="disabledHorizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
@@ -283,4 +133,7 @@
</hints>
</connection>
</connections>
<buttongroups>
<buttongroup name="typeButtonGroup"/>
</buttongroups>
</ui>
+119 -241
View File
@@ -1,94 +1,82 @@
#include "SeerWatchpointsBrowserWidget.h"
#include "SeerWatchpointCreateDialog.h"
#include "SeerCatchpointsBrowserWidget.h"
#include "SeerCatchpointCreateDialog.h"
#include "SeerUtl.h"
#include <QtWidgets/QTreeWidget>
#include <QtWidgets/QTreeWidgetItemIterator>
#include <QtWidgets/QApplication>
#include <QtCore/QDebug>
SeerWatchpointsBrowserWidget::SeerWatchpointsBrowserWidget (QWidget* parent) : QWidget(parent) {
SeerCatchpointsBrowserWidget::SeerCatchpointsBrowserWidget (QWidget* parent) : QWidget(parent) {
// Construct the UI.
setupUi(this);
// Setup the widgets
watchpointsTreeWidget->clear();
catchpointsTreeWidget->clear();
watchpointsTreeWidget->setSortingEnabled(false);
watchpointsTreeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
watchpointsTreeWidget->resizeColumnToContents(0); // number
watchpointsTreeWidget->resizeColumnToContents(1); // type
watchpointsTreeWidget->resizeColumnToContents(2); // disp
watchpointsTreeWidget->resizeColumnToContents(3); // enabled
watchpointsTreeWidget->resizeColumnToContents(4); // addr
//watchpointsTreeWidget->resizeColumnToContents(5); // func Too long to show
watchpointsTreeWidget->resizeColumnToContents(6); // file
//watchpointsTreeWidget->resizeColumnToContents(7); // fullname Too long to show
watchpointsTreeWidget->resizeColumnToContents(8); // line
watchpointsTreeWidget->resizeColumnToContents(9); // thread-groups
watchpointsTreeWidget->resizeColumnToContents(10); // times
watchpointsTreeWidget->resizeColumnToContents(11); // original-location / expression
watchpointsTreeWidget->resizeColumnToContents(12); // value
watchpointsTreeWidget->resizeColumnToContents(13); // new value
watchpointsTreeWidget->resizeColumnToContents(14); // used
catchpointsTreeWidget->setSortingEnabled(false);
catchpointsTreeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
catchpointsTreeWidget->resizeColumnToContents(0); // number
catchpointsTreeWidget->resizeColumnToContents(1); // type
catchpointsTreeWidget->resizeColumnToContents(2); // disp
catchpointsTreeWidget->resizeColumnToContents(3); // enabled
catchpointsTreeWidget->resizeColumnToContents(4); // what
catchpointsTreeWidget->resizeColumnToContents(5); // catch-type
catchpointsTreeWidget->resizeColumnToContents(6); // name
catchpointsTreeWidget->resizeColumnToContents(7); // thread-groups
catchpointsTreeWidget->resizeColumnToContents(8); // times
watchpointsTreeWidget->setColumnHidden(4, true); // Hide the 'addr' column.
watchpointsTreeWidget->setColumnHidden(5, true); // Hide the 'func' column.
watchpointsTreeWidget->setColumnHidden(14, true); // Hide the 'used' column.
watchpointsTreeWidget->clear();
catchpointsTreeWidget->setColumnHidden(9, true); // Hide the 'used' column.
catchpointsTreeWidget->clear();
// Connect things.
QObject::connect(watchpointsTreeWidget, &QTreeWidget::itemDoubleClicked, this, &SeerWatchpointsBrowserWidget::handleItemDoubleClicked);
QObject::connect(refreshWatchpointsToolButton, &QToolButton::clicked, this, &SeerWatchpointsBrowserWidget::handleRefreshToolButton);
QObject::connect(addWatchpointToolButton, &QToolButton::clicked, this, &SeerWatchpointsBrowserWidget::handleAddToolButton);
QObject::connect(deleteWatchpointsToolButton, &QToolButton::clicked, this, &SeerWatchpointsBrowserWidget::handleDeleteToolButton);
QObject::connect(enableWatchpointsToolButton, &QToolButton::clicked, this, &SeerWatchpointsBrowserWidget::handleEnableToolButton);
QObject::connect(disableWatchpointsToolButton, &QToolButton::clicked, this, &SeerWatchpointsBrowserWidget::handleDisableToolButton);
QObject::connect(refreshCatchpointsToolButton, &QToolButton::clicked, this, &SeerCatchpointsBrowserWidget::handleRefreshToolButton);
QObject::connect(addCatchpointToolButton, &QToolButton::clicked, this, &SeerCatchpointsBrowserWidget::handleAddToolButton);
QObject::connect(deleteCatchpointsToolButton, &QToolButton::clicked, this, &SeerCatchpointsBrowserWidget::handleDeleteToolButton);
QObject::connect(enableCatchpointsToolButton, &QToolButton::clicked, this, &SeerCatchpointsBrowserWidget::handleEnableToolButton);
QObject::connect(disableCatchpointsToolButton, &QToolButton::clicked, this, &SeerCatchpointsBrowserWidget::handleDisableToolButton);
}
SeerWatchpointsBrowserWidget::~SeerWatchpointsBrowserWidget () {
SeerCatchpointsBrowserWidget::~SeerCatchpointsBrowserWidget () {
}
void SeerWatchpointsBrowserWidget::handleText (const QString& text) {
void SeerCatchpointsBrowserWidget::handleText (const QString& text) {
// Don't do any work if the widget is hidden.
if (isHidden()) {
return;
}
//qDebug() << __PRETTY_FUNCTION__ << ":" << text;
QApplication::setOverrideCursor(Qt::BusyCursor);
if (text.startsWith("^done,BreakpointTable={") && text.endsWith("}")) {
//
// ^done,BreakpointTable={
// nr_rows="2",nr_cols="6",
// nr_rows="3", nr_cols="6",
//
// hdr=[
// {width="7",alignment="-1",col_name="number",colhdr="Num"},
// {width="14",alignment="-1",col_name="type",colhdr="Type"},
// {width="4",alignment="-1",col_name="disp",colhdr="Disp"},
// {width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
// {width="18",alignment="-1",col_name="addr",colhdr="Address"},
// {width="40",alignment="2",col_name="what",colhdr="What"}
// ],
// hdr=[
// {width="7",alignment="-1",col_name="number",colhdr="Num"},
// {width="14",alignment="-1",col_name="type",colhdr="Type"},
// {width="4",alignment="-1",col_name="disp",colhdr="Disp"},
// {width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
// {width="18",alignment="-1",col_name="addr",colhdr="Address"},
// {width="40",alignment="2",col_name="what",colhdr="What"}
// ],
//
// body=[
// bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400c17",func="main(int, char**)",file="helloworld.cpp",fullname="/home/erniep/Development/Peak/src/Seer/helloworld/helloworld.cpp",line="8",thread-groups=["i1"],times="0",original-location="main"},
// bkpt={number="3",
// type="breakpoint",
// disp="keep",
// enabled="y",
// addr="0x0000000000400d72",
// func="function1(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)",
// file="function1.cpp",
// fullname="/home/erniep/Development/Peak/src/Seer/helloworld/function1.cpp",
// line="7",
// thread-groups=["i1"],
// times="0",
// original-location="function1"}
// body=[
// bkpt={number="2",type="catchpoint",disp="keep",enabled="y",what="exception catch",catch-type="catch",thread-groups=["i1"],times="0"},
// bkpt={number="3",
// type="catchpoint",
// disp="keep",
// enabled="y",
// what="exception throw",
// catch-type="throw",
// thread-groups=["i1"],
// regexp="Exception*",
// times="0"}
// ]
// }
//
QString newtext = Seer::filterEscapes(text); // Filter escaped characters.
@@ -99,7 +87,7 @@ void SeerWatchpointsBrowserWidget::handleText (const QString& text) {
// No rows? Just clear the tree.
if (body_text == "") {
watchpointsTreeWidget->clear();
catchpointsTreeWidget->clear();
// Otherwise, populate it.
}else{
@@ -107,9 +95,9 @@ void SeerWatchpointsBrowserWidget::handleText (const QString& text) {
// Mark each entry initially as "unused".
// Later, some will be marked as "reused" or "new". Then the "unused" ones will
// be deleted.
QTreeWidgetItemIterator it(watchpointsTreeWidget);
QTreeWidgetItemIterator it(catchpointsTreeWidget);
while (*it) {
(*it)->setText(14, "unused");
(*it)->setText(9, "unused");
++it;
}
@@ -121,23 +109,20 @@ void SeerWatchpointsBrowserWidget::handleText (const QString& text) {
QString type_text = Seer::parseFirst(bkpt_text, "type=", '"', '"', false);
QString disp_text = Seer::parseFirst(bkpt_text, "disp=", '"', '"', false);
QString enabled_text = Seer::parseFirst(bkpt_text, "enabled=", '"', '"', false);
QString addr_text = Seer::parseFirst(bkpt_text, "addr=", '"', '"', false);
QString func_text = Seer::parseFirst(bkpt_text, "func=", '"', '"', false);
QString file_text = Seer::parseFirst(bkpt_text, "file=", '"', '"', false);
QString fullname_text = Seer::parseFirst(bkpt_text, "fullname=", '"', '"', false);
QString line_text = Seer::parseFirst(bkpt_text, "line=", '"', '"', false);
QString what_text = Seer::parseFirst(bkpt_text, "what=", '"', '"', false);
QString catch_type_text = Seer::parseFirst(bkpt_text, "catch-type=", '"', '"', false);
QString name_text = Seer::parseFirst(bkpt_text, "regexp=", '"', '"', false);
QString thread_groups_text = Seer::parseFirst(bkpt_text, "thread-groups=", '[', ']', false);
QString times_text = Seer::parseFirst(bkpt_text, "times=", '"', '"', false);
QString original_location_text = Seer::parseFirst(bkpt_text, "original-location=", '"', '"', false);
// Only look for 'watchpoint' type break points.
if (type_text != "hw watchpoint" && type_text != "watchpoint" && type_text != "read watchpoint" && type_text != "acc watchpoint") {
// Only look for 'catchpoint' type break points.
if (type_text != "catchpoint") {
continue;
}
// Instead of creating a new tree each time, we will reuse existing items, if they are there.
// This allows the expanded items to remain expanded.
QList<QTreeWidgetItem*> matches = watchpointsTreeWidget->findItems(number_text, Qt::MatchExactly, 0);
QList<QTreeWidgetItem*> matches = catchpointsTreeWidget->findItems(number_text, Qt::MatchExactly, 0);
// No matches. So can't reuse. Add the new entry.
if (matches.size() == 0) {
@@ -148,22 +133,16 @@ void SeerWatchpointsBrowserWidget::handleText (const QString& text) {
topItem->setText(1, type_text);
topItem->setText(2, disp_text);
topItem->setText(3, enabled_text);
topItem->setText(4, addr_text);
topItem->setText(5, func_text);
topItem->setText(6, file_text);
topItem->setText(7, fullname_text);
topItem->setText(8, line_text);
topItem->setText(9, thread_groups_text);
topItem->setText(10, times_text);
topItem->setText(11, original_location_text);
topItem->setText(12, "");
topItem->setText(13, "");
topItem->setText(14, "new");
topItem->setText(4, what_text);
topItem->setText(5, catch_type_text);
topItem->setText(6, name_text);
topItem->setText(7, thread_groups_text);
topItem->setText(8, times_text);
topItem->setText(9, "new");
watchpointsTreeWidget->addTopLevelItem(topItem);
catchpointsTreeWidget->addTopLevelItem(topItem);
// Found a match. Reuse it.
// But don't overwrite the file, fullname, line, value, and new value.
}else{
QTreeWidgetItem* topItem = matches.takeFirst();
@@ -172,109 +151,22 @@ void SeerWatchpointsBrowserWidget::handleText (const QString& text) {
topItem->setText(1, type_text);
topItem->setText(2, disp_text);
topItem->setText(3, enabled_text);
topItem->setText(4, addr_text);
topItem->setText(5, func_text);
//topItem->setText(6, file_text);
//topItem->setText(7, fullname_text);
//topItem->setText(8, line_text);
topItem->setText(9, thread_groups_text);
topItem->setText(10, times_text);
topItem->setText(11, original_location_text);
//topItem->setText(12, "");
//topItem->setText(13, "");
topItem->setText(14, "reused");
topItem->setText(4, what_text);
topItem->setText(5, catch_type_text);
topItem->setText(6, name_text);
topItem->setText(7, thread_groups_text);
topItem->setText(8, times_text);
topItem->setText(9, "reused");
}
}
// At this point, there are some new entries, some reused entries, and some unused ones.
// Delete the unused ones. They are obsolete.
QList<QTreeWidgetItem*> matches = watchpointsTreeWidget->findItems("unused", Qt::MatchExactly, 14);
QList<QTreeWidgetItem*> matches = catchpointsTreeWidget->findItems("unused", Qt::MatchExactly, 9);
qDeleteAll(matches);
}
}else if (text.startsWith("*stopped,reason=\"") || text.startsWith("*stopped,hw-awpt={")) {
QString reason_text = Seer::parseFirst(text, "reason=", '"', '"', false);
if (reason_text == "watchpoint-trigger") {
//*stopped,reason="watchpoint-trigger",wpt={number="3",exp="i"},value={old="32767",new="42"},frame={addr="0x0000000000400d79",func="function1",args=[{name="text",value="\"Hello, World!\""}],file="function1.cpp",fullname="/home/erniep/Development/Peak/src/Seer/helloworld/function1.cpp",line="9",arch="i386:x86-64"},thread-id="1",stopped-threads="all",core="0"
QString wpt_text = Seer::parseFirst(text, "wpt=", '{', '}', false);
QString number_text = Seer::parseFirst(wpt_text, "number=", '"', '"', false);
QString exp_text = Seer::parseFirst(wpt_text, "exp=", '"', '"', false);
QString value_text = Seer::parseFirst(text, "value=", '{', '}', false);
QString old_text = Seer::parseFirst(value_text, "old=", '"', '"', false);
QString new_text = Seer::parseFirst(value_text, "new=", '"', '"', false);
QString frame_text = Seer::parseFirst(text, "frame=", '{', '}', false);
QString file_text = Seer::parseFirst(frame_text, "file=", '"', '"', false);
QString fullname_text = Seer::parseFirst(frame_text, "fullname=", '"', '"', false);
QString line_text = Seer::parseFirst(frame_text, "line=", '"', '"', false);
// Find watchpoint number in the tree
QList<QTreeWidgetItem*> matches = watchpointsTreeWidget->findItems(number_text, Qt::MatchExactly, 0);
if (matches.size() > 0) {
//qDebug() << __PRETTY_FUNCTION__ << ":" << text;
QTreeWidgetItem* item = matches.first();
item->setText(6, file_text);
item->setText(7, fullname_text);
item->setText(8, line_text);
item->setText(12, old_text);
item->setText(13, new_text);
}
}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"
QString hwwpt_text = Seer::parseFirst(text, "hw-rwpt=", '{', '}', false);
QString number_text = Seer::parseFirst(hwwpt_text, "number=", '"', '"', false);
QString exp_text = Seer::parseFirst(hwwpt_text, "exp=", '"', '"', false);
QString value_text = Seer::parseFirst(text, "value=", '{', '}', false);
QString value_text2 = Seer::parseFirst(value_text, "value=", '"', '"', false);
QString frame_text = Seer::parseFirst(text, "frame=", '{', '}', false);
QString file_text = Seer::parseFirst(frame_text, "file=", '"', '"', false);
QString fullname_text = Seer::parseFirst(frame_text, "fullname=", '"', '"', false);
QString line_text = Seer::parseFirst(frame_text, "line=", '"', '"', false);
// Find watchpoint number in the tree
QList<QTreeWidgetItem*> matches = watchpointsTreeWidget->findItems(number_text, Qt::MatchExactly, 0);
if (matches.size() > 0) {
//qDebug() << __PRETTY_FUNCTION__ << ":" << text;
QTreeWidgetItem* item = matches.first();
item->setText(6, file_text);
item->setText(7, fullname_text);
item->setText(8, line_text);
item->setText(12, value_text2);
item->setText(13, "");
}
}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"
QString hwawpt_text = Seer::parseFirst(text, "hw-awpt=", '{', '}', false);
QString number_text = Seer::parseFirst(hwawpt_text, "number=", '"', '"', false);
QString exp_text = Seer::parseFirst(hwawpt_text, "exp=", '"', '"', false);
QString value_text = Seer::parseFirst(text, "value=", '{', '}', false);
QString old_text = Seer::parseFirst(value_text, "old=", '"', '"', false);
QString new_text = Seer::parseFirst(value_text, "new=", '"', '"', false);
QString frame_text = Seer::parseFirst(text, "frame=", '{', '}', false);
QString file_text = Seer::parseFirst(frame_text, "file=", '"', '"', false);
QString fullname_text = Seer::parseFirst(frame_text, "fullname=", '"', '"', false);
QString line_text = Seer::parseFirst(frame_text, "line=", '"', '"', false);
// Find watchpoint number in the tree
QList<QTreeWidgetItem*> matches = watchpointsTreeWidget->findItems(number_text, Qt::MatchExactly, 0);
if (matches.size() > 0) {
//qDebug() << __PRETTY_FUNCTION__ << ":" << text;
QTreeWidgetItem* item = matches.first();
item->setText(6, file_text);
item->setText(7, fullname_text);
item->setText(8, line_text);
item->setText(12, old_text);
item->setText(13, new_text);
}
}
}else if (text.startsWith("^error,msg=\"No registers.\"")) {
// Ignore.
@@ -282,52 +174,38 @@ void SeerWatchpointsBrowserWidget::handleText (const QString& text) {
// Ignore others.
}
watchpointsTreeWidget->resizeColumnToContents(0);
watchpointsTreeWidget->resizeColumnToContents(1);
watchpointsTreeWidget->resizeColumnToContents(2);
watchpointsTreeWidget->resizeColumnToContents(3);
watchpointsTreeWidget->resizeColumnToContents(4);
//watchpointsTreeWidget->resizeColumnToContents(5);
watchpointsTreeWidget->resizeColumnToContents(6);
//watchpointsTreeWidget->resizeColumnToContents(7);
watchpointsTreeWidget->resizeColumnToContents(8);
watchpointsTreeWidget->resizeColumnToContents(9);
watchpointsTreeWidget->resizeColumnToContents(10);
watchpointsTreeWidget->resizeColumnToContents(11);
watchpointsTreeWidget->resizeColumnToContents(12);
watchpointsTreeWidget->resizeColumnToContents(13);
watchpointsTreeWidget->resizeColumnToContents(14);
catchpointsTreeWidget->resizeColumnToContents(0);
catchpointsTreeWidget->resizeColumnToContents(1);
catchpointsTreeWidget->resizeColumnToContents(2);
catchpointsTreeWidget->resizeColumnToContents(3);
catchpointsTreeWidget->resizeColumnToContents(4);
catchpointsTreeWidget->resizeColumnToContents(5);
catchpointsTreeWidget->resizeColumnToContents(6);
catchpointsTreeWidget->resizeColumnToContents(7);
catchpointsTreeWidget->resizeColumnToContents(8);
catchpointsTreeWidget->resizeColumnToContents(9);
QApplication::restoreOverrideCursor();
}
void SeerWatchpointsBrowserWidget::handleStoppingPointReached () {
void SeerCatchpointsBrowserWidget::handleStoppingPointReached () {
// Don't do any work if the widget is hidden.
if (isHidden()) {
return;
}
emit refreshWatchpointsList();
emit refreshCatchpointsList();
}
void SeerWatchpointsBrowserWidget::handleItemDoubleClicked (QTreeWidgetItem* item, int column) {
void SeerCatchpointsBrowserWidget::handleRefreshToolButton () {
Q_UNUSED(column);
int lineno = item->text(8).toInt();
emit selectedFile(item->text(6), item->text(7), lineno);
emit refreshCatchpointsList();
}
void SeerWatchpointsBrowserWidget::handleRefreshToolButton () {
void SeerCatchpointsBrowserWidget::handleAddToolButton () {
emit refreshWatchpointsList();
}
void SeerWatchpointsBrowserWidget::handleAddToolButton () {
SeerWatchpointCreateDialog dlg(this);
SeerCatchpointCreateDialog dlg(this);
int ret = dlg.exec();
@@ -335,101 +213,101 @@ void SeerWatchpointsBrowserWidget::handleAddToolButton () {
return;
}
// Build a watchpoint specification.
QString watchpointParameters = dlg.watchpointText();
// Build a catchpoint specification.
QString catchpointParameters = dlg.catchpointText();
// If nothing, just return.
if (watchpointParameters == "") {
if (catchpointParameters == "") {
return;
}
// Otherwise send the command to create the watchpoint.
emit insertWatchpoint(watchpointParameters);
// Otherwise send the command to create the catchpoint.
emit insertCatchpoint(catchpointParameters);
}
void SeerWatchpointsBrowserWidget::handleDeleteToolButton () {
void SeerCatchpointsBrowserWidget::handleDeleteToolButton () {
// Get selected tree items.
QList<QTreeWidgetItem*> items = watchpointsTreeWidget->selectedItems();
QList<QTreeWidgetItem*> items = catchpointsTreeWidget->selectedItems();
// Build a string that is a list of watchpoints.
QString watchpoints;
// Build a string that is a list of catchpoints.
QString catchpoints;
QList<QTreeWidgetItem*>::iterator i;
for (i = items.begin(); i != items.end(); ++i) {
if (i != items.begin()) {
watchpoints += " ";
catchpoints += " ";
}
watchpoints += (*i)->text(0);
catchpoints += (*i)->text(0);
}
// Don't do anything if the list of watchpoints is empty.
if (watchpoints == "") {
// Don't do anything if the list of catchpoints is empty.
if (catchpoints == "") {
return;
}
// Send the signal.
emit deleteWatchpoints(watchpoints);
emit deleteCatchpoints(catchpoints);
}
void SeerWatchpointsBrowserWidget::handleEnableToolButton () {
void SeerCatchpointsBrowserWidget::handleEnableToolButton () {
// Get selected tree items.
QList<QTreeWidgetItem*> items = watchpointsTreeWidget->selectedItems();
QList<QTreeWidgetItem*> items = catchpointsTreeWidget->selectedItems();
// Build a string that is a list of watchpoints.
QString watchpoints;
// Build a string that is a list of catchpoints.
QString catchpoints;
QList<QTreeWidgetItem*>::iterator i;
for (i = items.begin(); i != items.end(); ++i) {
if (i != items.begin()) {
watchpoints += " ";
catchpoints += " ";
}
watchpoints += (*i)->text(0);
catchpoints += (*i)->text(0);
}
// Don't do anything if the list of watchpoints is empty.
if (watchpoints == "") {
// Don't do anything if the list of catchpoints is empty.
if (catchpoints == "") {
return;
}
// Send the signal.
emit enableWatchpoints(watchpoints);
emit enableCatchpoints(catchpoints);
}
void SeerWatchpointsBrowserWidget::handleDisableToolButton () {
void SeerCatchpointsBrowserWidget::handleDisableToolButton () {
// Get selected tree items.
QList<QTreeWidgetItem*> items = watchpointsTreeWidget->selectedItems();
QList<QTreeWidgetItem*> items = catchpointsTreeWidget->selectedItems();
// Build a string that is a list of watchpoints.
QString watchpoints;
// Build a string that is a list of catchpoints.
QString catchpoints;
QList<QTreeWidgetItem*>::iterator i;
for (i = items.begin(); i != items.end(); ++i) {
if (i != items.begin()) {
watchpoints += " ";
catchpoints += " ";
}
watchpoints += (*i)->text(0);
catchpoints += (*i)->text(0);
}
// Don't do anything if the list of watchpoints is empty.
if (watchpoints == "") {
// Don't do anything if the list of catchpoints is empty.
if (catchpoints == "") {
return;
}
// Send the signal.
emit disableWatchpoints(watchpoints);
emit disableCatchpoints(catchpoints);
}
void SeerWatchpointsBrowserWidget::showEvent (QShowEvent* event) {
void SeerCatchpointsBrowserWidget::showEvent (QShowEvent* event) {
QWidget::showEvent(event);
emit refreshWatchpointsList();
emit refreshCatchpointsList();
}
+9 -11
View File
@@ -2,22 +2,21 @@
#include <QtWidgets/QWidget>
#include <QtCore/QString>
#include "ui_SeerWatchpointsBrowserWidget.h"
#include "ui_SeerCatchpointsBrowserWidget.h"
class SeerWatchpointsBrowserWidget : public QWidget, protected Ui::SeerWatchpointsBrowserWidgetForm {
class SeerCatchpointsBrowserWidget : public QWidget, protected Ui::SeerCatchpointsBrowserWidgetForm {
Q_OBJECT
public:
explicit SeerWatchpointsBrowserWidget (QWidget* parent = 0);
~SeerWatchpointsBrowserWidget ();
explicit SeerCatchpointsBrowserWidget (QWidget* parent = 0);
~SeerCatchpointsBrowserWidget ();
public slots:
void handleText (const QString& text);
void handleStoppingPointReached ();
private slots:
void handleItemDoubleClicked (QTreeWidgetItem* item, int column);
void handleRefreshToolButton ();
void handleAddToolButton ();
void handleDeleteToolButton ();
@@ -25,12 +24,11 @@ class SeerWatchpointsBrowserWidget : public QWidget, protected Ui::SeerWatchpoin
void handleDisableToolButton ();
signals:
void refreshWatchpointsList ();
void deleteWatchpoints (QString watchpoints);
void enableWatchpoints (QString watchpoints);
void disableWatchpoints (QString watchpoints);
void insertWatchpoint (QString watchpoint);
void selectedFile (QString file, QString fullname, int lineno);
void refreshCatchpointsList ();
void deleteCatchpoints (QString catchpoints);
void enableCatchpoints (QString catchpoints);
void disableCatchpoints (QString catchpoints);
void insertCatchpoint (QString catchpoint);
protected:
void showEvent (QShowEvent* event);
+17 -42
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SeerWatchpointsBrowserWidgetForm</class>
<widget class="QWidget" name="SeerWatchpointsBrowserWidgetForm">
<class>SeerCatchpointsBrowserWidgetForm</class>
<widget class="QWidget" name="SeerCatchpointsBrowserWidgetForm">
<property name="geometry">
<rect>
<x>0</x>
@@ -15,9 +15,9 @@
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTreeWidget" name="watchpointsTreeWidget">
<widget class="QTreeWidget" name="catchpointsTreeWidget">
<property name="columnCount">
<number>15</number>
<number>10</number>
</property>
<column>
<property name="text">
@@ -41,27 +41,17 @@
</column>
<column>
<property name="text">
<string>Address</string>
<string>What</string>
</property>
</column>
<column>
<property name="text">
<string>Function</string>
<string>Catch Type</string>
</property>
</column>
<column>
<property name="text">
<string>File</string>
</property>
</column>
<column>
<property name="text">
<string>Fullname</string>
</property>
</column>
<column>
<property name="text">
<string>Line</string>
<string>Name</string>
</property>
</column>
<column>
@@ -74,21 +64,6 @@
<string>Times</string>
</property>
</column>
<column>
<property name="text">
<string>Expression</string>
</property>
</column>
<column>
<property name="text">
<string>Value</string>
</property>
</column>
<column>
<property name="text">
<string>New Value</string>
</property>
</column>
<column>
<property name="text">
<string>Used</string>
@@ -99,9 +74,9 @@
<item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QToolButton" name="refreshWatchpointsToolButton">
<widget class="QToolButton" name="refreshCatchpointsToolButton">
<property name="toolTip">
<string>Refresh the list of watchpoints.</string>
<string>Refresh the list of catchpoints.</string>
</property>
<property name="text">
<string/>
@@ -113,9 +88,9 @@
</widget>
</item>
<item>
<widget class="QToolButton" name="addWatchpointToolButton">
<widget class="QToolButton" name="addCatchpointToolButton">
<property name="toolTip">
<string>Add a new watchpoint.</string>
<string>Add a new catchpoint.</string>
</property>
<property name="text">
<string>...</string>
@@ -127,9 +102,9 @@
</widget>
</item>
<item>
<widget class="QToolButton" name="deleteWatchpointsToolButton">
<widget class="QToolButton" name="deleteCatchpointsToolButton">
<property name="toolTip">
<string>Delete selected watchpoints.</string>
<string>Delete selected catchpoints.</string>
</property>
<property name="text">
<string>...</string>
@@ -141,9 +116,9 @@
</widget>
</item>
<item>
<widget class="QToolButton" name="enableWatchpointsToolButton">
<widget class="QToolButton" name="enableCatchpointsToolButton">
<property name="toolTip">
<string>Enable selected watchpoints.</string>
<string>Enable selected catchpoints.</string>
</property>
<property name="text">
<string>...</string>
@@ -155,9 +130,9 @@
</widget>
</item>
<item>
<widget class="QToolButton" name="disableWatchpointsToolButton">
<widget class="QToolButton" name="disableCatchpointsToolButton">
<property name="toolTip">
<string>Disable selected watchpoints.</string>
<string>Disable selected catchpoints.</string>
</property>
<property name="text">
<string>...</string>
+69 -12
View File
@@ -26,6 +26,7 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) {
_consoleWidget = 0;
_breakpointsBrowserWidget = 0;
_watchpointsBrowserWidget = 0;
_catchpointsBrowserWidget = 0;
_gdbOutputLog = 0;
_seerOutputLog = 0;
_gdbProgram = "/usr/bin/gdb";
@@ -44,11 +45,13 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) {
_breakpointsBrowserWidget = new SeerBreakpointsBrowserWidget(this);
_watchpointsBrowserWidget = new SeerWatchpointsBrowserWidget(this);
_catchpointsBrowserWidget = new SeerCatchpointsBrowserWidget(this);
_gdbOutputLog = new SeerTildeEqualAmpersandLogWidget(this);
_seerOutputLog = new SeerCaretAsteriskLogWidget(this);
logsTabWidget->addTab(_breakpointsBrowserWidget, "Breakpoints");
logsTabWidget->addTab(_watchpointsBrowserWidget, "Watchpoints");
logsTabWidget->addTab(_catchpointsBrowserWidget, "Catchpoints");
logsTabWidget->addTab(_gdbOutputLog, "GDB output");
logsTabWidget->addTab(_seerOutputLog, "Seer output");
logsTabWidget->setCurrentIndex(0);
@@ -91,6 +94,7 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) {
QObject::connect(_gdbMonitor, &GdbMonitor::caretTextOutput, threadManagerWidget->threadFramesBrowserWidget(), &SeerThreadFramesBrowserWidget::handleText);
QObject::connect(_gdbMonitor, &GdbMonitor::caretTextOutput, _breakpointsBrowserWidget, &SeerBreakpointsBrowserWidget::handleText);
QObject::connect(_gdbMonitor, &GdbMonitor::caretTextOutput, _watchpointsBrowserWidget, &SeerWatchpointsBrowserWidget::handleText);
QObject::connect(_gdbMonitor, &GdbMonitor::caretTextOutput, _catchpointsBrowserWidget, &SeerCatchpointsBrowserWidget::handleText);
QObject::connect(_gdbMonitor, &GdbMonitor::caretTextOutput, variableManagerWidget->registerValuesBrowserWidget(), &SeerRegisterValuesBrowserWidget::handleText);
QObject::connect(_gdbMonitor, &GdbMonitor::caretTextOutput, variableManagerWidget->variableTrackerBrowserWidget(), &SeerVariableTrackerBrowserWidget::handleText);
QObject::connect(_gdbMonitor, &GdbMonitor::caretTextOutput, variableManagerWidget->variableLoggerBrowserWidget(), &SeerVariableLoggerBrowserWidget::handleText);
@@ -98,7 +102,7 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) {
QObject::connect(_gdbMonitor, &GdbMonitor::astrixTextOutput, this, &SeerGdbWidget::handleText);
QObject::connect(_gdbMonitor, &GdbMonitor::equalTextOutput, this, &SeerGdbWidget::handleText);
QObject::connect(editorManagerWidget, &SeerEditorManagerWidget::refreshBreakpointsList, this, &SeerGdbWidget::handleGdbBreakpointWatchpointList);
QObject::connect(editorManagerWidget, &SeerEditorManagerWidget::refreshBreakpointsList, this, &SeerGdbWidget::handleGdbBreakpointWatchpointCatchpointList);
QObject::connect(editorManagerWidget, &SeerEditorManagerWidget::refreshStackFrames, this, &SeerGdbWidget::handleGdbStackListFrames);
QObject::connect(editorManagerWidget, &SeerEditorManagerWidget::insertBreakpoint, this, &SeerGdbWidget::handleGdbBreakpointInsert);
QObject::connect(editorManagerWidget, &SeerEditorManagerWidget::deleteBreakpoints, this, &SeerGdbWidget::handleGdbBreakpointDelete);
@@ -137,20 +141,26 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) {
QObject::connect(threadManagerWidget->threadFramesBrowserWidget(), &SeerThreadFramesBrowserWidget::refreshThreadFrames, this, &SeerGdbWidget::handleGdbThreadListFrames);
QObject::connect(threadManagerWidget->threadFramesBrowserWidget(), &SeerThreadFramesBrowserWidget::selectedFile, editorManagerWidget, &SeerEditorManagerWidget::handleOpenFile);
QObject::connect(_breakpointsBrowserWidget, &SeerBreakpointsBrowserWidget::refreshBreakpointsList, this, &SeerGdbWidget::handleGdbBreakpointWatchpointList);
QObject::connect(_breakpointsBrowserWidget, &SeerBreakpointsBrowserWidget::refreshBreakpointsList, this, &SeerGdbWidget::handleGdbBreakpointWatchpointCatchpointList);
QObject::connect(_breakpointsBrowserWidget, &SeerBreakpointsBrowserWidget::deleteBreakpoints, this, &SeerGdbWidget::handleGdbBreakpointDelete);
QObject::connect(_breakpointsBrowserWidget, &SeerBreakpointsBrowserWidget::enableBreakpoints, this, &SeerGdbWidget::handleGdbBreakpointEnable);
QObject::connect(_breakpointsBrowserWidget, &SeerBreakpointsBrowserWidget::disableBreakpoints, this, &SeerGdbWidget::handleGdbBreakpointDisable);
QObject::connect(_breakpointsBrowserWidget, &SeerBreakpointsBrowserWidget::insertBreakpoint, this, &SeerGdbWidget::handleGdbBreakpointInsert);
QObject::connect(_breakpointsBrowserWidget, &SeerBreakpointsBrowserWidget::selectedFile, editorManagerWidget, &SeerEditorManagerWidget::handleOpenFile);
QObject::connect(_watchpointsBrowserWidget, &SeerWatchpointsBrowserWidget::refreshWatchpointsList, this, &SeerGdbWidget::handleGdbBreakpointWatchpointList);
QObject::connect(_watchpointsBrowserWidget, &SeerWatchpointsBrowserWidget::refreshWatchpointsList, this, &SeerGdbWidget::handleGdbBreakpointWatchpointCatchpointList);
QObject::connect(_watchpointsBrowserWidget, &SeerWatchpointsBrowserWidget::deleteWatchpoints, this, &SeerGdbWidget::handleGdbWatchpointDelete);
QObject::connect(_watchpointsBrowserWidget, &SeerWatchpointsBrowserWidget::enableWatchpoints, this, &SeerGdbWidget::handleGdbWatchpointEnable);
QObject::connect(_watchpointsBrowserWidget, &SeerWatchpointsBrowserWidget::disableWatchpoints, this, &SeerGdbWidget::handleGdbWatchpointDisable);
QObject::connect(_watchpointsBrowserWidget, &SeerWatchpointsBrowserWidget::insertWatchpoint, this, &SeerGdbWidget::handleGdbWatchpointInsert);
QObject::connect(_watchpointsBrowserWidget, &SeerWatchpointsBrowserWidget::selectedFile, editorManagerWidget, &SeerEditorManagerWidget::handleOpenFile);
QObject::connect(_catchpointsBrowserWidget, &SeerCatchpointsBrowserWidget::refreshCatchpointsList, this, &SeerGdbWidget::handleGdbBreakpointWatchpointCatchpointList);
QObject::connect(_catchpointsBrowserWidget, &SeerCatchpointsBrowserWidget::deleteCatchpoints, this, &SeerGdbWidget::handleGdbCatchpointDelete);
QObject::connect(_catchpointsBrowserWidget, &SeerCatchpointsBrowserWidget::enableCatchpoints, this, &SeerGdbWidget::handleGdbCatchpointEnable);
QObject::connect(_catchpointsBrowserWidget, &SeerCatchpointsBrowserWidget::disableCatchpoints, this, &SeerGdbWidget::handleGdbCatchpointDisable);
QObject::connect(_catchpointsBrowserWidget, &SeerCatchpointsBrowserWidget::insertCatchpoint, this, &SeerGdbWidget::handleGdbCatchpointInsert);
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, stackManagerWidget->stackFramesBrowserWidget(), &SeerStackFramesBrowserWidget::handleStoppingPointReached);
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, stackManagerWidget->stackLocalsBrowserWidget(), &SeerStackLocalsBrowserWidget::handleStoppingPointReached);
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, stackManagerWidget->stackArgumentsBrowserWidget(), &SeerStackArgumentsBrowserWidget::handleStoppingPointReached);
@@ -160,6 +170,7 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) {
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, variableManagerWidget->variableTrackerBrowserWidget(), &SeerVariableTrackerBrowserWidget::handleStoppingPointReached);
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, _breakpointsBrowserWidget, &SeerBreakpointsBrowserWidget::handleStoppingPointReached);
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, _watchpointsBrowserWidget, &SeerWatchpointsBrowserWidget::handleStoppingPointReached);
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, _catchpointsBrowserWidget, &SeerCatchpointsBrowserWidget::handleStoppingPointReached);
QObject::connect(this, &SeerGdbWidget::stoppingPointReached, stackManagerWidget, &SeerStackManagerWidget::handleStoppingPointReached);
QObject::connect(leftCenterRightSplitter, &QSplitter::splitterMoved, this, &SeerGdbWidget::handleSplitterMoved);
@@ -302,6 +313,7 @@ void SeerGdbWidget::handleText (const QString& text) {
if (text.startsWith("*running,thread-id=\"all\"")) {
// Probably a better way to handle all these types of stops.
}else if (text.startsWith("*stopped,reason=\"breakpoint-hit\"")) {
emit stoppingPointReached();
@@ -344,6 +356,11 @@ void SeerGdbWidget::handleText (const QString& text) {
}else if (text.startsWith("*stopped,frame=")) {
emit stoppingPointReached();
}else if (text.startsWith("*stopped,bkptno=")) {
if (text.contains("reason=\"breakpoint-hit\"")) {
emit stoppingPointReached();
}
}else if (text.startsWith("=thread-group-started,")) {
// =thread-group-started,id="i1",pid="30916"
@@ -827,7 +844,7 @@ void SeerGdbWidget::handleGdbStackListArguments () {
handleGdbCommand("-stack-list-arguments --all-values");
}
void SeerGdbWidget::handleGdbBreakpointWatchpointList () {
void SeerGdbWidget::handleGdbBreakpointWatchpointCatchpointList () {
if (executableLaunchMode() == "") {
return;
@@ -843,7 +860,7 @@ void SeerGdbWidget::handleGdbBreakpointDelete (QString breakpoints) {
}
handleGdbCommand("-break-delete " + breakpoints);
handleGdbBreakpointWatchpointList();
handleGdbBreakpointWatchpointCatchpointList();
}
void SeerGdbWidget::handleGdbBreakpointEnable (QString breakpoints) {
@@ -853,7 +870,7 @@ void SeerGdbWidget::handleGdbBreakpointEnable (QString breakpoints) {
}
handleGdbCommand("-break-enable " + breakpoints);
handleGdbBreakpointWatchpointList();
handleGdbBreakpointWatchpointCatchpointList();
}
void SeerGdbWidget::handleGdbBreakpointDisable (QString breakpoints) {
@@ -863,7 +880,7 @@ void SeerGdbWidget::handleGdbBreakpointDisable (QString breakpoints) {
}
handleGdbCommand("-break-disable " + breakpoints);
handleGdbBreakpointWatchpointList();
handleGdbBreakpointWatchpointCatchpointList();
}
void SeerGdbWidget::handleGdbBreakpointInsert (QString breakpoint) {
@@ -873,7 +890,7 @@ void SeerGdbWidget::handleGdbBreakpointInsert (QString breakpoint) {
}
handleGdbCommand("-break-insert " + breakpoint);
handleGdbBreakpointWatchpointList();
handleGdbBreakpointWatchpointCatchpointList();
}
void SeerGdbWidget::handleGdbBreakpointReload (QStringList breakpointsText) {
@@ -890,7 +907,7 @@ void SeerGdbWidget::handleGdbWatchpointDelete (QString watchpoints) {
}
handleGdbCommand("-break-delete " + watchpoints);
handleGdbBreakpointWatchpointList();
handleGdbBreakpointWatchpointCatchpointList();
}
void SeerGdbWidget::handleGdbWatchpointEnable (QString watchpoints) {
@@ -900,7 +917,7 @@ void SeerGdbWidget::handleGdbWatchpointEnable (QString watchpoints) {
}
handleGdbCommand("-break-enable " + watchpoints);
handleGdbBreakpointWatchpointList();
handleGdbBreakpointWatchpointCatchpointList();
}
void SeerGdbWidget::handleGdbWatchpointDisable (QString watchpoints) {
@@ -910,7 +927,7 @@ void SeerGdbWidget::handleGdbWatchpointDisable (QString watchpoints) {
}
handleGdbCommand("-break-disable " + watchpoints);
handleGdbBreakpointWatchpointList();
handleGdbBreakpointWatchpointCatchpointList();
}
void SeerGdbWidget::handleGdbWatchpointInsert (QString watchpoint) {
@@ -920,7 +937,47 @@ void SeerGdbWidget::handleGdbWatchpointInsert (QString watchpoint) {
}
handleGdbCommand("-break-watch " + watchpoint);
handleGdbBreakpointWatchpointList();
handleGdbBreakpointWatchpointCatchpointList();
}
void SeerGdbWidget::handleGdbCatchpointDelete (QString catchpoints) {
if (executableLaunchMode() == "") {
return;
}
handleGdbCommand("-break-delete " + catchpoints);
handleGdbBreakpointWatchpointCatchpointList();
}
void SeerGdbWidget::handleGdbCatchpointEnable (QString catchpoints) {
if (executableLaunchMode() == "") {
return;
}
handleGdbCommand("-break-enable " + catchpoints);
handleGdbBreakpointWatchpointCatchpointList();
}
void SeerGdbWidget::handleGdbCatchpointDisable (QString catchpoints) {
if (executableLaunchMode() == "") {
return;
}
handleGdbCommand("-break-disable " + catchpoints);
handleGdbBreakpointWatchpointCatchpointList();
}
void SeerGdbWidget::handleGdbCatchpointInsert (QString catchpoint) {
if (executableLaunchMode() == "") {
return;
}
handleGdbCommand("-catch-" + catchpoint); // A little bit different than break insert or watch insert.
handleGdbBreakpointWatchpointCatchpointList();
}
void SeerGdbWidget::handleGdbThreadListIds () {
+7 -1
View File
@@ -5,6 +5,7 @@
#include "SeerCaretAsteriskLogWidget.h"
#include "SeerBreakpointsBrowserWidget.h"
#include "SeerWatchpointsBrowserWidget.h"
#include "SeerCatchpointsBrowserWidget.h"
#include "GdbMonitor.h"
#include <QtCore/QProcess>
#include <QtCore/QVector>
@@ -92,7 +93,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm {
void handleGdbStackSelectFrame (int frameno);
void handleGdbStackListLocals ();
void handleGdbStackListArguments ();
void handleGdbBreakpointWatchpointList ();
void handleGdbBreakpointWatchpointCatchpointList ();
void handleGdbBreakpointDelete (QString breakpoints);
void handleGdbBreakpointEnable (QString breakpoints);
void handleGdbBreakpointDisable (QString breakpoints);
@@ -102,6 +103,10 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm {
void handleGdbWatchpointEnable (QString watchpoints);
void handleGdbWatchpointDisable (QString watchpoints);
void handleGdbWatchpointInsert (QString watchpoint);
void handleGdbCatchpointDelete (QString catchpoints);
void handleGdbCatchpointEnable (QString catchpoints);
void handleGdbCatchpointDisable (QString catchpoints);
void handleGdbCatchpointInsert (QString catchpoint);
void handleGdbThreadListIds ();
void handleGdbThreadListFrames ();
void handleGdbThreadSelectId (int threadid);
@@ -153,6 +158,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm {
SeerConsoleWidget* _consoleWidget;
SeerBreakpointsBrowserWidget* _breakpointsBrowserWidget;
SeerWatchpointsBrowserWidget* _watchpointsBrowserWidget;
SeerCatchpointsBrowserWidget* _catchpointsBrowserWidget;
SeerTildeEqualAmpersandLogWidget* _gdbOutputLog;
SeerCaretAsteriskLogWidget* _seerOutputLog;
+3
View File
@@ -444,6 +444,9 @@ void SeerMainWindow::handleText (const QString& text) {
//*stopped,frame={addr="0x00007ff831151329",func="cfft",args=[{name="a",value="..."},{name="n",value="512"},{name="iflg",value="1"}],file="sssMathlib.f",fullname="/home/erniep/Development/Peak/src/Core/Math/sssMathlib.f",line="767",arch="i386:x86-64"},thread-id="1",stopped-threads="all",core="3"
return;
}else if (text.startsWith("*stopped,bkptno=")) {
return;
}else if (text.startsWith("^connected,frame=")) {
//^connected,frame={level=\"0\",addr=\"0x00007f48351f80c1\",func=\"read\",args=[],from=\"/lib64/libc.so.6\",arch=\"i386:x86-64\"}"
return;
+5
View File
@@ -92,6 +92,11 @@ void SeerRunStatusIndicator::handleText (const QString& text) {
}else if (text.startsWith("*stopped,reason=\"signal-received\"")) {
setRunStatus(SeerRunStatusIndicator::Stopped);
}else if (text.startsWith("*stopped,bkptno=")) {
if (text.contains("reason=\"breakpoint-hit\"")) {
setRunStatus(SeerRunStatusIndicator::Stopped);
}
}else if (text.startsWith("*stopped,frame=")) {
//*stopped,frame={addr=\"0x00007f0ee0d2d954\",func=\"rfft\",args=[{name=\"a\",value=\"...\"},...
//*stopped,frame={addr="0x00007f608ec49fc0",func="__pthread_clockjoin_ex",args=[],from="/lib64/libpthread.so.0",arch="i386:x86-64"},thread-id="1",stopped-threads="all",core="3"