- enhancement: Add option in the debug settings, to limit the length of the ouput generated by gdb for arrays.

This commit is contained in:
Roy Qu 2023-03-17 08:47:05 +08:00
parent 626217f856
commit b4b41e43a1
6 changed files with 240 additions and 152 deletions

View File

@ -8,9 +8,9 @@ Red Panda C++ Version 2.18
- enhancement: Warn user and stop compile if project has missing files.
- enhancement: Warn user when exit and save settings failed.
- change: Remove compiler set options that's rarely used.
- enhancement: Options in compiler set settings, to generate syntax error for large stack objects. Enable for Debug settings by default)
- enhancement: Options in compiler set settings, to generate protection code for stack smashing attack. Enable for Debug settings by default)
- enhancement: Options in compiler set settings, to enable address sanitizer. Not available in windows.Enable for Debug settings by default)
- enhancement: Add option in the compiler set settings, to generate syntax error for large stack objects. Enable for Debug settings by default)
- enhancement: Add option in the compiler set settings, to generate protection code for stack smashing attack. Enable for Debug settings by default)
- enhancement: Add option in the compiler set settings, to enable address sanitizer. Not available in windows.Enable for Debug settings by default)
- fix: The comboxbox to input search keyword in the search dialog is case insensitive.
- fix: The comboxbox to input replace text in the search dialog is case insensitive.
- fix: The comboxbox to input search keyword in the search in files dialog is case insensitive.
@ -20,6 +20,7 @@ Red Panda C++ Version 2.18
- fix: None initialized std::vector is not correctly displayed in the gdb of the gcc distributed with redpanda-c++ (Windows 64bit).
- fix: Don't show completion info when input parameters for function definitions.
- fix: Don't show function info tips when typing class variable definitions.
- enhancement: Add option in the debug settings, to limit the length of the ouput generated by gdb for arrays.
Red Panda C++ Version 2.17

View File

@ -2395,7 +2395,7 @@ void MainWindow::debug()
mDebugger->sendCommand("-gdb-set", "width 0"); // don't wrap output, very annoying
mDebugger->sendCommand("-gdb-set", "confirm off");
mDebugger->sendCommand("-gdb-set", "print repeats 0"); // don't repeat elements
mDebugger->sendCommand("-gdb-set", "print elements 500"); // limit array elements to 500
mDebugger->sendCommand("-gdb-set", QString("print elements %1").arg(pSettings->debugger().arrayElements())); // limit array elements to 500
mDebugger->sendCommand("-environment-cd", QString("\"%1\"").arg(extractFileDir(filePath))); // restore working directory
if (pSettings->debugger().useGDBServer()) {
mDebugger->sendCommand("-target-select",QString("remote localhost:%1").arg(pSettings->debugger().GDBServerPort()));

View File

@ -4020,6 +4020,16 @@ void Settings::Debugger::setAutosave(bool newAutosave)
mAutosave = newAutosave;
}
int Settings::Debugger::arrayElements() const
{
return mArrayElements;
}
void Settings::Debugger::setArrayElements(int newArrayElements)
{
mArrayElements = newArrayElements;
}
bool Settings::Debugger::useIntelStyle() const
{
return mUseIntelStyle;
@ -4068,6 +4078,7 @@ void Settings::Debugger::doSave()
saveValue("gdb_server_port",mGDBServerPort);
saveValue("memory_view_rows",mMemoryViewRows);
saveValue("memory_view_columns",mMemoryViewColumns);
saveValue("array_elements",mArrayElements);
}
void Settings::Debugger::doLoad()
@ -4096,6 +4107,7 @@ void Settings::Debugger::doLoad()
mGDBServerPort = intValue("gdb_server_port",41234);
mMemoryViewRows = intValue("memory_view_rows",16);
mMemoryViewColumns = intValue("memory_view_columns",16);
mArrayElements = intValue("array_elements",300);
}
Settings::CodeCompletion::CodeCompletion(Settings *settings):_Base(settings, SETTING_CODE_COMPLETION)

View File

@ -1281,6 +1281,9 @@ public:
bool autosave() const;
void setAutosave(bool newAutosave);
int arrayElements() const;
void setArrayElements(int newArrayElements);
private:
bool mEnableDebugConsole;
bool mShowDetailLog;
@ -1298,6 +1301,7 @@ public:
int mGDBServerPort;
int mMemoryViewRows;
int mMemoryViewColumns;
int mArrayElements;
// _Base interface
protected:

View File

@ -56,6 +56,7 @@ void DebugGeneralWidget::doLoad()
ui->spinGDBServerPort->setValue(pSettings->debugger().GDBServerPort());
ui->spinMemoryViewRows->setValue(pSettings->debugger().memoryViewRows());
ui->spinMemoryViewColumns->setValue(pSettings->debugger().memoryViewColumns());
ui->spinArrayElements->setValue(pSettings->debugger().arrayElements());
}
void DebugGeneralWidget::doSave()
@ -78,6 +79,8 @@ void DebugGeneralWidget::doSave()
pSettings->debugger().setGDBServerPort(ui->spinGDBServerPort->value());
pSettings->debugger().setMemoryViewRows(ui->spinMemoryViewRows->value());
pSettings->debugger().setMemoryViewColumns(ui->spinMemoryViewColumns->value());
pSettings->debugger().setArrayElements(ui->spinArrayElements->value());
pSettings->debugger().save();
pMainWindow->updateDebuggerSettings();
}

View File

@ -14,6 +14,58 @@
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="chkAutosave">
<property name="text">
<string>Autosave watches</string>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_5" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Max number of array elements displayed</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinArrayElements">
<property name="maximum">
<number>99999999</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<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="grpUseGDBServer">
<property name="title">
@ -23,6 +75,18 @@
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>7</number>
</property>
<property name="topMargin">
<number>7</number>
</property>
<property name="rightMargin">
<number>7</number>
</property>
<property name="bottomMargin">
<number>7</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
@ -57,24 +121,58 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkSkipSystemLib">
<property name="text">
<string>Skip system header and library files when step into</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkSkipProjectLib">
<property name="text">
<string>Skip project header and library files when step into</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkSkipCustomLib">
<property name="text">
<string>Skip custom header and library files when step into</string>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Skip header files when step into</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="leftMargin">
<number>7</number>
</property>
<property name="topMargin">
<number>7</number>
</property>
<property name="rightMargin">
<number>7</number>
</property>
<property name="bottomMargin">
<number>7</number>
</property>
<item>
<widget class="QCheckBox" name="chkSkipSystemLib">
<property name="text">
<string>System library</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkSkipProjectLib">
<property name="text">
<string>Project library</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkSkipCustomLib">
<property name="text">
<string>Custom library</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<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>
@ -87,16 +185,16 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>11</number>
<number>7</number>
</property>
<property name="topMargin">
<number>11</number>
<number>7</number>
</property>
<property name="rightMargin">
<number>11</number>
<number>7</number>
</property>
<property name="bottomMargin">
<number>11</number>
<number>7</number>
</property>
<item>
<widget class="QWidget" name="widget" native="true">
@ -169,7 +267,11 @@
</widget>
</item>
<item>
<widget class="QSpinBox" name="sbFontSize"/>
<widget class="QSpinBox" name="sbFontSize">
<property name="maximum">
<number>999</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
@ -202,128 +304,69 @@
<property name="title">
<string>Memory View</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin">
<number>7</number>
</property>
<property name="topMargin">
<number>7</number>
</property>
<property name="rightMargin">
<number>7</number>
</property>
<property name="bottomMargin">
<number>7</number>
</property>
<item>
<widget class="QWidget" name="widget_5" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Memory View Rows</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinMemoryViewRows">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="value">
<number>8</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<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="QWidget" name="widget_6" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Memory View Columns</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinMemoryViewColumns">
<property name="minimum">
<number>1</number>
</property>
<property name="value">
<number>8</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>437</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Autosave</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="chkAutosave">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Autosave breakpoints and watches</string>
<string>Rows</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinMemoryViewRows">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="value">
<number>8</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Columns</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinMemoryViewColumns">
<property name="minimum">
<number>1</number>
</property>
<property name="value">
<number>8</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<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>
@ -333,6 +376,18 @@
<string>CPU Window</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="leftMargin">
<number>7</number>
</property>
<property name="topMargin">
<number>7</number>
</property>
<property name="rightMargin">
<number>7</number>
</property>
<property name="bottomMargin">
<number>7</number>
</property>
<item>
<widget class="QCheckBox" name="chkShowCPUWhenSignaled">
<property name="text">
@ -340,6 +395,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkBlendMode">
<property name="text">
<string>Show disassembly code in blend mode</string>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_3" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_3">
@ -373,7 +435,7 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<property name="leftMargin">
<number>0</number>
</property>
@ -386,6 +448,16 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QRadioButton" name="rbATT">
<property name="text">
<string>AT&amp;&amp;T</string>
</property>
<attribute name="buttonGroup">
<string notr="true">grpCPUDisassembly</string>
</attribute>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbIntel">
<property name="text">
@ -397,14 +469,17 @@
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbATT">
<property name="text">
<string>AT&amp;&amp;T</string>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<attribute name="buttonGroup">
<string notr="true">grpCPUDisassembly</string>
</attribute>
</widget>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
@ -412,13 +487,6 @@
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkBlendMode">
<property name="text">
<string>Show disassembly code in blend mode</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>