Show breakpoint info as a tooltip if the breakpoint icon is clicked with LMB and held down.

This commit is contained in:
Ernie Pasveer
2024-09-11 17:34:46 -05:00
parent 4a235631b6
commit f3144f3fe0
5 changed files with 55 additions and 5 deletions
+2
View File
@@ -9,6 +9,8 @@
- Detached and minimized
- Attached in Seer's tab view (with gdb logs and seer logs).
* Improved handling of \n \t and other escaped characters in gdb log window.
* Show breakpoint info as a tooltip if the breakpoint icon is clicked with
LMB and held down.
## [2.4] - 2024-03-18
* Changed main icon to a more license friendly one.
+1 -1
View File
@@ -121,7 +121,7 @@ void SeerBreakpointsBrowserWidget::handleText (const QString& text) {
QStringList bkpt_list = Seer::parse(newtext, "bkpt=", '{', '}', false);
for ( const auto& bkpt_text : bkpt_list ) {
for (const auto& bkpt_text : bkpt_list) {
//
// A different way (better?) of parsing the table output
+50 -3
View File
@@ -1739,7 +1739,7 @@ void SeerEditorWidgetSourceArea::handleText (const QString& text) {
}else if (text.contains(QRegularExpression("^([0-9]+)\\^done,BreakpointTable="))) {
// 11^7^done,BreakpointTable={...}
// 11^done,BreakpointTable={...}
QString id_text = text.section('^', 0,0);
@@ -1816,9 +1816,56 @@ void SeerEditorWidgetSourceArea::handleWatchFileModified (const QString& path) {
void SeerEditorWidgetSourceArea::handleBreakpointToolTip (QPoint pos, const QString& text) {
QString str = text;
// 11^7^done,BreakpointTable={...}
// 7^done,BreakpointTable={
// nr_rows="1",
// nr_cols="6",
// hdr=[],
// body=[
// bkpt={
// number="2",
// type="breakpoint",
// disp="keep",
// enabled="y",
// addr="0x0000000000400ccd",
// func="main(int, char**)",
// file="helloworld.cpp",
// fullname="/nas/erniep/Development/seer/tests/helloworld/helloworld.cpp",
// line="30",
// thread-groups=["i1"],
// times="1",
// original-location="-source /nas/erniep/Development/seer/tests/helloworld/helloworld.cpp -line 30"
// }
// ]
// }
QToolTip::showText(mapToGlobal(pos), str);
QString newtext = Seer::filterEscapes(text); // Filter escaped characters.
QString tooltiptext;
//
// Parse 'body' text.
//
QString body_text = Seer::parseFirst(newtext, "body=", '[', ']', false);
if (body_text != "") {
QStringList bkpt_list = Seer::parse(body_text, "bkpt=", '{', '}', false);
// Construct the tooltip.
tooltiptext += "Breakpoint information\n\n";
for (const auto& bkpt_text : bkpt_list) {
QStringList item_list = Seer::parseCommaList(bkpt_text);
for (const auto& item_text : item_list) {
tooltiptext += item_text + "\n";
}
break; // Take the first breakpoint in case, somehow, more are returned.
}
}
QToolTip::showText(mapToGlobal(pos), tooltiptext);
}
//
+1 -1
View File
@@ -1982,7 +1982,7 @@ void SeerGdbWidget::handleGdbBreakpointInfo (int breakpointid, QString breakpoin
return;
}
QString str = QString("%1-break-list %2").arg(breakpointid).arg(breakpoint);
QString str = QString("%1-break-info %2").arg(breakpointid).arg(breakpoint);
handleGdbCommand(str);
}
+1
View File
@@ -9,6 +9,7 @@
#include <QtWidgets/QMenu>
#include <QtWidgets/QStyleFactory>
#include <QtWidgets/QToolButton>
#include <QtWidgets/QToolTip>
#include <QtGui/QKeySequence>
#include <QtGui/QPalette>
#include <QtCore/QCoreApplication>