Merge pull request #361 from epasveer/350-display-objective-c-variables

350 display objective c variables
This commit is contained in:
Ernie Pasveer
2025-09-27 11:13:40 -05:00
committed by GitHub
15 changed files with 268 additions and 66 deletions
+1
View File
@@ -28,6 +28,7 @@
the next time the Debug dialog is used. Kind of a default project.
* RR: When using the Debug dialog, check a couple standard locations for
the RR trace directory.
* ObjectiveC: Add support for printing ObjectiveC object via a '(objc)' pretext.
## [2.5] - 2024-12-24
* Console now supports a subset of ANSI color codes.
+51 -20
View File
@@ -928,10 +928,12 @@ void SeerEditorWidgetSourceArea::showContextMenu (const QPoint& pos, const QPoin
QAction* addVariableLoggerAsteriskExpressionAction;
QAction* addVariableLoggerAmpersandExpressionAction;
QAction* addVariableLoggerAsteriskAmpersandExpressionAction;
QAction* addVariableLoggerObjcExpressionAction;
QAction* addVariableTrackerExpressionAction;
QAction* addVariableTrackerAsteriskExpressionAction;
QAction* addVariableTrackerAmpersandExpressionAction;
QAction* addVariableTrackerAsteriskAmpersandExpressionAction;
QAction* addVariableTrackerObjcExpressionAction;
QAction* addMemoryVisualizerAction;
QAction* addMemoryAsteriskVisualizerAction;
QAction* addMemoryAmpersandVisualizerAction;
@@ -984,26 +986,28 @@ void SeerEditorWidgetSourceArea::showContextMenu (const QPoint& pos, const QPoin
openExternalEditor->setEnabled(true);
}
addVariableLoggerExpressionAction = new QAction(QString("\"%1\"").arg(textCursor().selectedText()));
addVariableLoggerAsteriskExpressionAction = new QAction(QString("\"*%1\"").arg(textCursor().selectedText()));
addVariableLoggerAmpersandExpressionAction = new QAction(QString("\"&&%1\"").arg(textCursor().selectedText()));
addVariableLoggerAsteriskAmpersandExpressionAction = new QAction(QString("\"*&&%1\"").arg(textCursor().selectedText()));
addVariableTrackerExpressionAction = new QAction(QString("\"%1\"").arg(textCursor().selectedText()));
addVariableTrackerAsteriskExpressionAction = new QAction(QString("\"*%1\"").arg(textCursor().selectedText()));
addVariableTrackerAmpersandExpressionAction = new QAction(QString("\"&&%1\"").arg(textCursor().selectedText()));
addVariableTrackerAsteriskAmpersandExpressionAction = new QAction(QString("\"*&&%1\"").arg(textCursor().selectedText()));
addMemoryVisualizerAction = new QAction(QString("\"%1\"").arg(textCursor().selectedText()));
addMemoryAsteriskVisualizerAction = new QAction(QString("\"*%1\"").arg(textCursor().selectedText()));
addMemoryAmpersandVisualizerAction = new QAction(QString("\"&&%1\"").arg(textCursor().selectedText()));
addArrayVisualizerAction = new QAction(QString("\"%1\"").arg(textCursor().selectedText()));
addArrayAsteriskVisualizerAction = new QAction(QString("\"*%1\"").arg(textCursor().selectedText()));
addArrayAmpersandVisualizerAction = new QAction(QString("\"&&%1\"").arg(textCursor().selectedText()));
addMatrixVisualizerAction = new QAction(QString("\"%1\"").arg(textCursor().selectedText()));
addMatrixAsteriskVisualizerAction = new QAction(QString("\"*%1\"").arg(textCursor().selectedText()));
addMatrixAmpersandVisualizerAction = new QAction(QString("\"&&%1\"").arg(textCursor().selectedText()));
addStructVisualizerAction = new QAction(QString("\"%1\"").arg(textCursor().selectedText()));
addStructAsteriskVisualizerAction = new QAction(QString("\"*%1\"").arg(textCursor().selectedText()));
addStructAmpersandVisualizerAction = new QAction(QString("\"&&%1\"").arg(textCursor().selectedText()));
addVariableLoggerExpressionAction = new QAction(QString("%1").arg(textCursor().selectedText()));
addVariableLoggerAsteriskExpressionAction = new QAction(QString("*%1").arg(textCursor().selectedText()));
addVariableLoggerAmpersandExpressionAction = new QAction(QString("&&%1").arg(textCursor().selectedText()));
addVariableLoggerAsteriskAmpersandExpressionAction = new QAction(QString("*&&%1").arg(textCursor().selectedText()));
addVariableLoggerObjcExpressionAction = new QAction(QString("(objc)%1").arg(textCursor().selectedText()));
addVariableTrackerExpressionAction = new QAction(QString("%1").arg(textCursor().selectedText()));
addVariableTrackerAsteriskExpressionAction = new QAction(QString("*%1").arg(textCursor().selectedText()));
addVariableTrackerAmpersandExpressionAction = new QAction(QString("&&%1").arg(textCursor().selectedText()));
addVariableTrackerAsteriskAmpersandExpressionAction = new QAction(QString("*&&%1").arg(textCursor().selectedText()));
addVariableTrackerObjcExpressionAction = new QAction(QString("(objc)%1").arg(textCursor().selectedText()));
addMemoryVisualizerAction = new QAction(QString("%1").arg(textCursor().selectedText()));
addMemoryAsteriskVisualizerAction = new QAction(QString("*%1").arg(textCursor().selectedText()));
addMemoryAmpersandVisualizerAction = new QAction(QString("&&%1").arg(textCursor().selectedText()));
addArrayVisualizerAction = new QAction(QString("%1").arg(textCursor().selectedText()));
addArrayAsteriskVisualizerAction = new QAction(QString("*%1").arg(textCursor().selectedText()));
addArrayAmpersandVisualizerAction = new QAction(QString("&&%1").arg(textCursor().selectedText()));
addMatrixVisualizerAction = new QAction(QString("%1").arg(textCursor().selectedText()));
addMatrixAsteriskVisualizerAction = new QAction(QString("*%1").arg(textCursor().selectedText()));
addMatrixAmpersandVisualizerAction = new QAction(QString("&&%1").arg(textCursor().selectedText()));
addStructVisualizerAction = new QAction(QString("%1").arg(textCursor().selectedText()));
addStructAsteriskVisualizerAction = new QAction(QString("*%1").arg(textCursor().selectedText()));
addStructAmpersandVisualizerAction = new QAction(QString("&&%1").arg(textCursor().selectedText()));
QMenu menu("Breakpoints", this);
menu.setTitle("Breakpoints");
@@ -1020,6 +1024,7 @@ void SeerEditorWidgetSourceArea::showContextMenu (const QPoint& pos, const QPoin
loggerMenu.addAction(addVariableLoggerAsteriskExpressionAction);
loggerMenu.addAction(addVariableLoggerAmpersandExpressionAction);
loggerMenu.addAction(addVariableLoggerAsteriskAmpersandExpressionAction);
loggerMenu.addAction(addVariableLoggerObjcExpressionAction);
menu.addMenu(&loggerMenu);
QMenu trackerMenu("Add variable to Tracker");
@@ -1027,6 +1032,7 @@ void SeerEditorWidgetSourceArea::showContextMenu (const QPoint& pos, const QPoin
trackerMenu.addAction(addVariableTrackerAsteriskExpressionAction);
trackerMenu.addAction(addVariableTrackerAmpersandExpressionAction);
trackerMenu.addAction(addVariableTrackerAsteriskAmpersandExpressionAction);
trackerMenu.addAction(addVariableTrackerObjcExpressionAction);
menu.addMenu(&trackerMenu);
QMenu memoryVisualizerMenu("Add variable to a Memory Visualizer");
@@ -1059,6 +1065,7 @@ void SeerEditorWidgetSourceArea::showContextMenu (const QPoint& pos, const QPoin
addVariableLoggerAsteriskExpressionAction->setEnabled(false);
addVariableLoggerAmpersandExpressionAction->setEnabled(false);
addVariableLoggerAsteriskAmpersandExpressionAction->setEnabled(false);
addVariableLoggerObjcExpressionAction->setEnabled(false);
addVariableTrackerExpressionAction->setEnabled(false);
addVariableTrackerAsteriskExpressionAction->setEnabled(false);
addVariableTrackerAmpersandExpressionAction->setEnabled(false);
@@ -1080,6 +1087,7 @@ void SeerEditorWidgetSourceArea::showContextMenu (const QPoint& pos, const QPoin
addVariableLoggerAsteriskExpressionAction->setEnabled(true);
addVariableLoggerAmpersandExpressionAction->setEnabled(true);
addVariableLoggerAsteriskAmpersandExpressionAction->setEnabled(true);
addVariableLoggerObjcExpressionAction->setEnabled(true);
addVariableTrackerExpressionAction->setEnabled(true);
addVariableTrackerAsteriskExpressionAction->setEnabled(true);
addVariableTrackerAmpersandExpressionAction->setEnabled(true);
@@ -1274,6 +1282,17 @@ void SeerEditorWidgetSourceArea::showContextMenu (const QPoint& pos, const QPoin
return;
}
// Handle adding a variable to log.
if (action == addVariableLoggerObjcExpressionAction) {
// Emit the signals.
if (textCursor().selectedText() != "") {
emit addVariableLoggerExpression(QString("(objc)") + textCursor().selectedText());
}
return;
}
// Handle adding a variable to track.
if (action == addVariableTrackerExpressionAction) {
@@ -1322,6 +1341,18 @@ void SeerEditorWidgetSourceArea::showContextMenu (const QPoint& pos, const QPoin
return;
}
// Handle adding a variable to track.
if (action == addVariableTrackerObjcExpressionAction) {
// Emit the signals.
if (textCursor().selectedText() != "") {
emit addVariableTrackerExpression(QString("(objc)") + textCursor().selectedText());
emit refreshVariableTrackerValues();
}
return;
}
// Handle adding memory to visualize.
if (action == addMemoryVisualizerAction) {
+16 -2
View File
@@ -2640,7 +2640,16 @@ void SeerGdbWidget::handleGdbDataEvaluateExpression (int expressionid, QString e
return;
}
handleGdbCommand(QString::number(expressionid) + "-data-evaluate-expression \"" + expression + "\"");
// Check if there's a ObjectiveC pretext.
QString token("(objc)");
if (expression.startsWith(token)) {
handleGdbCommand(QString::number(expressionid) + "-objc-evaluate-expression \"" + expression.mid(token.length()) + "\"");
// Otherwise handle normally.
}else{
handleGdbCommand(QString::number(expressionid) + "-data-evaluate-expression \"" + expression + "\"");
}
}
void SeerGdbWidget::handleGdbVarObjCreate (int expressionid, QString expression) {
@@ -2716,7 +2725,7 @@ void SeerGdbWidget::handleGdbDataListValues () {
}
for (int i=0; i<_dataExpressionId.size(); i++) {
handleGdbCommand(QString::number(_dataExpressionId[i]) + "-data-evaluate-expression \"" + _dataExpressionName[i] + "\"");
handleGdbDataEvaluateExpression(_dataExpressionId[i], _dataExpressionName[i]);
}
}
@@ -2777,6 +2786,11 @@ void SeerGdbWidget::handleGdbDataAddExpression (QString expression) {
void SeerGdbWidget::handleGdbDataDeleteExpressions (QString expressionids) {
if (executableLaunchMode() == "") {
// Clear expression list.
_dataExpressionId.clear();
_dataExpressionName.clear();
return;
}
+49 -20
View File
@@ -187,10 +187,12 @@ void SeerStackArgumentsBrowserWidget::handleContextMenu (const QPoint& pos) {
QAction* addVariableLoggerAsteriskExpressionAction;
QAction* addVariableLoggerAmpersandExpressionAction;
QAction* addVariableLoggerAsteriskAmpersandExpressionAction;
QAction* addVariableLoggerObjcExpressionAction;
QAction* addVariableTrackerExpressionAction;
QAction* addVariableTrackerAsteriskExpressionAction;
QAction* addVariableTrackerAmpersandExpressionAction;
QAction* addVariableTrackerAsteriskAmpersandExpressionAction;
QAction* addVariableTrackerObjcExpressionAction;
QAction* addMemoryVisualizerAction;
QAction* addMemoryAsteriskVisualizerAction;
QAction* addMemoryAmpersandVisualizerAction;
@@ -204,26 +206,28 @@ void SeerStackArgumentsBrowserWidget::handleContextMenu (const QPoint& pos) {
QAction* addStructAsteriskVisualizerAction;
QAction* addStructAmpersandVisualizerAction;
addVariableLoggerExpressionAction = new QAction(QString("\"%1\"").arg(item->text(1)));
addVariableLoggerAsteriskExpressionAction = new QAction(QString("\"*%1\"").arg(item->text(1)));
addVariableLoggerAmpersandExpressionAction = new QAction(QString("\"&&%1\"").arg(item->text(1)));
addVariableLoggerAsteriskAmpersandExpressionAction = new QAction(QString("\"*&&%1\"").arg(item->text(1)));
addVariableTrackerExpressionAction = new QAction(QString("\"%1\"").arg(item->text(1)));
addVariableTrackerAsteriskExpressionAction = new QAction(QString("\"*%1\"").arg(item->text(1)));
addVariableTrackerAmpersandExpressionAction = new QAction(QString("\"&&%1\"").arg(item->text(1)));
addVariableTrackerAsteriskAmpersandExpressionAction = new QAction(QString("\"*&&%1\"").arg(item->text(1)));
addMemoryVisualizerAction = new QAction(QString("\"%1\"").arg(item->text(1)));
addMemoryAsteriskVisualizerAction = new QAction(QString("\"*%1\"").arg(item->text(1)));
addMemoryAmpersandVisualizerAction = new QAction(QString("\"&&%1\"").arg(item->text(1)));
addArrayVisualizerAction = new QAction(QString("\"%1\"").arg(item->text(1)));
addArrayAsteriskVisualizerAction = new QAction(QString("\"*%1\"").arg(item->text(1)));
addArrayAmpersandVisualizerAction = new QAction(QString("\"&&%1\"").arg(item->text(1)));
addMatrixVisualizerAction = new QAction(QString("\"%1\"").arg(item->text(1)));
addMatrixAsteriskVisualizerAction = new QAction(QString("\"*%1\"").arg(item->text(1)));
addMatrixAmpersandVisualizerAction = new QAction(QString("\"&&%1\"").arg(item->text(1)));
addStructVisualizerAction = new QAction(QString("\"%1\"").arg(item->text(1)));
addStructAsteriskVisualizerAction = new QAction(QString("\"*%1\"").arg(item->text(1)));
addStructAmpersandVisualizerAction = new QAction(QString("\"&&%1\"").arg(item->text(1)));
addVariableLoggerExpressionAction = new QAction(QString("%1").arg(item->text(1)));
addVariableLoggerAsteriskExpressionAction = new QAction(QString("*%1").arg(item->text(1)));
addVariableLoggerAmpersandExpressionAction = new QAction(QString("&&%1").arg(item->text(1)));
addVariableLoggerAsteriskAmpersandExpressionAction = new QAction(QString("*&&%1").arg(item->text(1)));
addVariableLoggerObjcExpressionAction = new QAction(QString("(objc)%1").arg(item->text(0)));
addVariableTrackerExpressionAction = new QAction(QString("%1").arg(item->text(1)));
addVariableTrackerAsteriskExpressionAction = new QAction(QString("*%1").arg(item->text(1)));
addVariableTrackerAmpersandExpressionAction = new QAction(QString("&&%1").arg(item->text(1)));
addVariableTrackerAsteriskAmpersandExpressionAction = new QAction(QString("*&&%1").arg(item->text(1)));
addVariableTrackerObjcExpressionAction = new QAction(QString("(objc)%1").arg(item->text(0)));
addMemoryVisualizerAction = new QAction(QString("%1").arg(item->text(1)));
addMemoryAsteriskVisualizerAction = new QAction(QString("*%1").arg(item->text(1)));
addMemoryAmpersandVisualizerAction = new QAction(QString("&&%1").arg(item->text(1)));
addArrayVisualizerAction = new QAction(QString("%1").arg(item->text(1)));
addArrayAsteriskVisualizerAction = new QAction(QString("*%1").arg(item->text(1)));
addArrayAmpersandVisualizerAction = new QAction(QString("&&%1").arg(item->text(1)));
addMatrixVisualizerAction = new QAction(QString("%1").arg(item->text(1)));
addMatrixAsteriskVisualizerAction = new QAction(QString("*%1").arg(item->text(1)));
addMatrixAmpersandVisualizerAction = new QAction(QString("&&%1").arg(item->text(1)));
addStructVisualizerAction = new QAction(QString("%1").arg(item->text(1)));
addStructAsteriskVisualizerAction = new QAction(QString("*%1").arg(item->text(1)));
addStructAmpersandVisualizerAction = new QAction(QString("&&%1").arg(item->text(1)));
QMenu menu("Visualizers", this);
menu.setTitle("Visualizers");
@@ -233,6 +237,7 @@ void SeerStackArgumentsBrowserWidget::handleContextMenu (const QPoint& pos) {
loggerMenu.addAction(addVariableLoggerAsteriskExpressionAction);
loggerMenu.addAction(addVariableLoggerAmpersandExpressionAction);
loggerMenu.addAction(addVariableLoggerAsteriskAmpersandExpressionAction);
loggerMenu.addAction(addVariableLoggerObjcExpressionAction);
menu.addMenu(&loggerMenu);
QMenu trackerMenu("Add variable to Tracker");
@@ -240,6 +245,7 @@ void SeerStackArgumentsBrowserWidget::handleContextMenu (const QPoint& pos) {
trackerMenu.addAction(addVariableTrackerAsteriskExpressionAction);
trackerMenu.addAction(addVariableTrackerAmpersandExpressionAction);
trackerMenu.addAction(addVariableTrackerAsteriskAmpersandExpressionAction);
trackerMenu.addAction(addVariableTrackerObjcExpressionAction);
menu.addMenu(&trackerMenu);
QMenu memoryVisualizerMenu("Add variable to a Memory Visualizer");
@@ -318,6 +324,17 @@ void SeerStackArgumentsBrowserWidget::handleContextMenu (const QPoint& pos) {
return;
}
// Handle adding a variable to log.
if (action == addVariableLoggerObjcExpressionAction) {
// Emit the signals.
if (item->text(1) != "") {
emit addVariableLoggerExpression(QString("(objc)") + item->text(1));
}
return;
}
// Handle adding a variable to track.
if (action == addVariableTrackerExpressionAction) {
@@ -366,6 +383,18 @@ void SeerStackArgumentsBrowserWidget::handleContextMenu (const QPoint& pos) {
return;
}
// Handle adding a variable to track.
if (action == addVariableTrackerObjcExpressionAction) {
// Emit the signals.
if (item->text(1) != "") {
emit addVariableTrackerExpression(QString("(objc)") + item->text(1));
emit refreshVariableTrackerValues();
}
return;
}
// Handle adding memory to visualize.
if (action == addMemoryVisualizerAction) {
+49 -20
View File
@@ -155,10 +155,12 @@ void SeerStackLocalsBrowserWidget::handleContextMenu (const QPoint& pos) {
QAction* addVariableLoggerAsteriskExpressionAction;
QAction* addVariableLoggerAmpersandExpressionAction;
QAction* addVariableLoggerAsteriskAmpersandExpressionAction;
QAction* addVariableLoggerObjcExpressionAction;
QAction* addVariableTrackerExpressionAction;
QAction* addVariableTrackerAsteriskExpressionAction;
QAction* addVariableTrackerAmpersandExpressionAction;
QAction* addVariableTrackerAsteriskAmpersandExpressionAction;
QAction* addVariableTrackerObjcExpressionAction;
QAction* addMemoryVisualizerAction;
QAction* addMemoryAsteriskVisualizerAction;
QAction* addMemoryAmpersandVisualizerAction;
@@ -172,26 +174,28 @@ void SeerStackLocalsBrowserWidget::handleContextMenu (const QPoint& pos) {
QAction* addStructAsteriskVisualizerAction;
QAction* addStructAmpersandVisualizerAction;
addVariableLoggerExpressionAction = new QAction(QString("\"%1\"").arg(item->text(0)));
addVariableLoggerAsteriskExpressionAction = new QAction(QString("\"*%1\"").arg(item->text(0)));
addVariableLoggerAmpersandExpressionAction = new QAction(QString("\"&&%1\"").arg(item->text(0)));
addVariableLoggerAsteriskAmpersandExpressionAction = new QAction(QString("\"*&&%1\"").arg(item->text(0)));
addVariableTrackerExpressionAction = new QAction(QString("\"%1\"").arg(item->text(0)));
addVariableTrackerAsteriskExpressionAction = new QAction(QString("\"*%1\"").arg(item->text(0)));
addVariableTrackerAmpersandExpressionAction = new QAction(QString("\"&&%1\"").arg(item->text(0)));
addVariableTrackerAsteriskAmpersandExpressionAction = new QAction(QString("\"*&&%1\"").arg(item->text(0)));
addMemoryVisualizerAction = new QAction(QString("\"%1\"").arg(item->text(0)));
addMemoryAsteriskVisualizerAction = new QAction(QString("\"*%1\"").arg(item->text(0)));
addMemoryAmpersandVisualizerAction = new QAction(QString("\"&&%1\"").arg(item->text(0)));
addArrayVisualizerAction = new QAction(QString("\"%1\"").arg(item->text(0)));
addArrayAsteriskVisualizerAction = new QAction(QString("\"*%1\"").arg(item->text(0)));
addArrayAmpersandVisualizerAction = new QAction(QString("\"&&%1\"").arg(item->text(0)));
addMatrixVisualizerAction = new QAction(QString("\"%1\"").arg(item->text(0)));
addMatrixAsteriskVisualizerAction = new QAction(QString("\"*%1\"").arg(item->text(0)));
addMatrixAmpersandVisualizerAction = new QAction(QString("\"&&%1\"").arg(item->text(0)));
addStructVisualizerAction = new QAction(QString("\"%1\"").arg(item->text(0)));
addStructAsteriskVisualizerAction = new QAction(QString("\"*%1\"").arg(item->text(0)));
addStructAmpersandVisualizerAction = new QAction(QString("\"&&%1\"").arg(item->text(0)));
addVariableLoggerExpressionAction = new QAction(QString("%1").arg(item->text(0)));
addVariableLoggerAsteriskExpressionAction = new QAction(QString("*%1").arg(item->text(0)));
addVariableLoggerAmpersandExpressionAction = new QAction(QString("&&%1").arg(item->text(0)));
addVariableLoggerAsteriskAmpersandExpressionAction = new QAction(QString("*&&%1").arg(item->text(0)));
addVariableLoggerObjcExpressionAction = new QAction(QString("(objc)%1").arg(item->text(0)));
addVariableTrackerExpressionAction = new QAction(QString("%1").arg(item->text(0)));
addVariableTrackerAsteriskExpressionAction = new QAction(QString("*%1").arg(item->text(0)));
addVariableTrackerAmpersandExpressionAction = new QAction(QString("&&%1").arg(item->text(0)));
addVariableTrackerAsteriskAmpersandExpressionAction = new QAction(QString("*&&%1").arg(item->text(0)));
addVariableTrackerObjcExpressionAction = new QAction(QString("(objc)%1").arg(item->text(0)));
addMemoryVisualizerAction = new QAction(QString("%1").arg(item->text(0)));
addMemoryAsteriskVisualizerAction = new QAction(QString("*%1").arg(item->text(0)));
addMemoryAmpersandVisualizerAction = new QAction(QString("&&%1").arg(item->text(0)));
addArrayVisualizerAction = new QAction(QString("%1").arg(item->text(0)));
addArrayAsteriskVisualizerAction = new QAction(QString("*%1").arg(item->text(0)));
addArrayAmpersandVisualizerAction = new QAction(QString("&&%1").arg(item->text(0)));
addMatrixVisualizerAction = new QAction(QString("%1").arg(item->text(0)));
addMatrixAsteriskVisualizerAction = new QAction(QString("*%1").arg(item->text(0)));
addMatrixAmpersandVisualizerAction = new QAction(QString("&&%1").arg(item->text(0)));
addStructVisualizerAction = new QAction(QString("%1").arg(item->text(0)));
addStructAsteriskVisualizerAction = new QAction(QString("*%1").arg(item->text(0)));
addStructAmpersandVisualizerAction = new QAction(QString("&&%1").arg(item->text(0)));
QMenu menu("Visualizers", this);
menu.setTitle("Visualizers");
@@ -201,6 +205,7 @@ void SeerStackLocalsBrowserWidget::handleContextMenu (const QPoint& pos) {
loggerMenu.addAction(addVariableLoggerAsteriskExpressionAction);
loggerMenu.addAction(addVariableLoggerAmpersandExpressionAction);
loggerMenu.addAction(addVariableLoggerAsteriskAmpersandExpressionAction);
loggerMenu.addAction(addVariableLoggerObjcExpressionAction);
menu.addMenu(&loggerMenu);
QMenu trackerMenu("Add variable to Tracker");
@@ -208,6 +213,7 @@ void SeerStackLocalsBrowserWidget::handleContextMenu (const QPoint& pos) {
trackerMenu.addAction(addVariableTrackerAsteriskExpressionAction);
trackerMenu.addAction(addVariableTrackerAmpersandExpressionAction);
trackerMenu.addAction(addVariableTrackerAsteriskAmpersandExpressionAction);
trackerMenu.addAction(addVariableTrackerObjcExpressionAction);
menu.addMenu(&trackerMenu);
QMenu memoryVisualizerMenu("Add variable to a Memory Visualizer");
@@ -294,6 +300,17 @@ void SeerStackLocalsBrowserWidget::handleContextMenu (const QPoint& pos) {
return;
}
// Handle adding a variable to log.
if (action == addVariableLoggerObjcExpressionAction) {
// Emit the signals.
if (variable != "") {
emit addVariableLoggerExpression(QString("(objc)") + variable);
}
return;
}
// Handle adding a variable to track.
if (action == addVariableTrackerExpressionAction) {
@@ -342,6 +359,18 @@ void SeerStackLocalsBrowserWidget::handleContextMenu (const QPoint& pos) {
return;
}
// Handle adding a variable to track.
if (action == addVariableTrackerObjcExpressionAction) {
// Emit the signals.
if (variable != "") {
emit addVariableTrackerExpression(QString("(objc)") + variable);
emit refreshVariableTrackerValues();
}
return;
}
// Handle adding memory to visualize.
if (action == addMemoryVisualizerAction) {
+3
View File
@@ -224,6 +224,9 @@ void SeerVariableTrackerBrowserWidget::handleSessionTerminated () {
// Delete previous contents.
variablesTreeWidget->clear();
// Tell the GdbWidget to forget all tracked expressions.
emit deleteVariableExpressions("*");
}
void SeerVariableTrackerBrowserWidget::refresh () {
+1
View File
@@ -86,6 +86,7 @@
<file>resources/mi-python/MIKill.py</file>
<file>resources/mi-python/MICheckpoint.py</file>
<file>resources/mi-python/MICatchpoint.py</file>
<file>resources/mi-python/MIObjectiveC.py</file>
</qresource>
</RCC>
+37
View File
@@ -0,0 +1,37 @@
# SPDX-FileCopyrightText: 2025 Ernie Pasveer <epasveer@att.net>
#
# SPDX-License-Identifier: MIT
import re
#
# Python MI command to manage gdb's Objective-C commands.
#
# https://sourceware.org/gdb/current/onlinedocs/gdb.html/Objective_002dC.html#Objective_002dC
#
class MIObjectiveC(gdb.MICommand):
"""
Run the ObjectiveC command.
-objc-evaluate-expression Evaluate an Objective-C object via 'print-object' and '_NSPrintForDebugger'.
See: https://sourceware.org/gdb/current/onlinedocs/gdb.html/Objective_002dC.html#Objective_002dC
"""
def __init__(self, name, mode):
self._mode = mode
super(MIObjectiveC, self).__init__(name)
def invoke(self, argv):
if self._mode == "evaluate-expression":
result = gdb.execute ("print-object " + " ".join(argv), to_string=True)
return { "value": result.rstrip('\n')}
else:
raise gdb.GdbError("objectivec: Invalid parameter: %s" % self._mode)
MIObjectiveC("-objc-evaluate-expression", "evaluate-expression")
+1
View File
@@ -1,2 +1,3 @@
hellotictactoe
hellodays
*.d
+6 -3
View File
@@ -1,10 +1,13 @@
.PHONY: all
all: hellotictactoe
all: hellotictactoe hellodays
hellotictactoe: hellotictactoe.m
clang hellotictactoe.m -g `gnustep-config --objc-flags` -std=c99 -lobjc -lgnustep-base -o hellotictactoe
clang hellotictactoe.m `gnustep-config --objc-flags` -O0 -std=c99 -lobjc -lgnustep-base -o hellotictactoe
hellodays: hellodays.m
clang hellodays.m `gnustep-config --objc-flags` -O0 -std=c99 -lobjc -lgnustep-base -o hellodays
.PHONY: clean
clean:
rm -f hellotictactoe *.d
rm -f hellotictactoe hellodays *.d
+8
View File
@@ -0,0 +1,8 @@
Setup the GNUStep environment.
$ source /usr/share/GNUstep/Makefiles/GNUstep.sh
$ export CC=/usr/bin/clang
$ export CXX=/usr/bin/clang++
+20
View File
@@ -0,0 +1,20 @@
#import <Foundation/Foundation.h>
int main(void) {
@autoreleasepool {
NSString* name = @"test string!!!";
float myval = 3.75;
NSArray* weekArray;
weekArray = [NSArray arrayWithObjects: @"Sun", @"Mon" @"Tue", @"Wed", @"Thr", @"Fri", @"Sat", nil];
NSLog(@"name = %@", name);
NSLog(@"myval = %f", myval);
NSLog(@"weekArray = %@", weekArray);
}
return 0;
}
+24
View File
@@ -0,0 +1,24 @@
{
"seerproject": {
"executable": "/nas/erniep/Development/seer/tests/helloobjectivec/hellodays",
"postgdbcommands": [
""
],
"pregdbcommands": [
""
],
"startmode": {
"arguments": "",
"breakinfunction": false,
"breakinfunctionname": "",
"breakinmain": true,
"breakpointsfile": "/nas/erniep/Development/seer/tests/helloobjectivec/hellodays_breakpoints.seer",
"nobreak": false,
"nonstopmode": false,
"randomizestartaddress": false,
"showassemblytab": false
},
"symbolfile": "",
"workingdirectory": ""
}
}
@@ -0,0 +1 @@
break -source /nas/erniep/Development/seer/tests/helloobjectivec/hellodays.m -line 15
+1 -1
View File
@@ -130,7 +130,7 @@
- (int)getPlayerInput {
int input;
printf("Player %c, enter your move (1-9): ", currentPlayer);
scanf("%d", &input);
(void)scanf("%d", &input);
// Clear input buffer
int c;