forked from qt-creator/qt-creator
Debugger: Aspectify settings
Change-Id: I527be79965250b82a0928171b17aa93bac9fa2a0 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -17,7 +17,6 @@ add_qtc_plugin(Debugger
|
||||
breakpoint.cpp breakpoint.h
|
||||
cdb/cdbengine.cpp cdb/cdbengine.h
|
||||
cdb/cdboptionspage.cpp cdb/cdboptionspage.h
|
||||
cdb/cdboptionspagewidget.ui
|
||||
cdb/cdbparsehelpers.cpp cdb/cdbparsehelpers.h
|
||||
cdb/stringinputstream.cpp cdb/stringinputstream.h
|
||||
commonoptionspage.cpp commonoptionspage.h
|
||||
|
@@ -51,7 +51,6 @@
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/savedaction.h>
|
||||
#include <utils/theme/theme.h>
|
||||
|
||||
#if USE_BREAK_MODEL_TEST
|
||||
@@ -1121,7 +1120,7 @@ QVariant BreakpointItem::data(int column, int role) const
|
||||
break;
|
||||
}
|
||||
|
||||
if (role == Qt::ToolTipRole && boolSetting(UseToolTipsInBreakpointsView))
|
||||
if (role == Qt::ToolTipRole && debuggerSettings()->useToolTipsInBreakpointsView.value())
|
||||
return toolTip();
|
||||
|
||||
return QVariant();
|
||||
@@ -1698,8 +1697,8 @@ bool BreakHandler::contextMenuEvent(const ItemViewEvent &ev)
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
menu->addAction(action(UseToolTipsInBreakpointsView)->action());
|
||||
menu->addAction(action(SettingsDialog)->action());
|
||||
menu->addAction(debuggerSettings()->useToolTipsInBreakpointsView.action());
|
||||
menu->addAction(debuggerSettings()->settingsDialog.action());
|
||||
|
||||
menu->popup(ev.globalPos());
|
||||
|
||||
@@ -2225,7 +2224,7 @@ QVariant GlobalBreakpointItem::data(int column, int role) const
|
||||
break;
|
||||
}
|
||||
|
||||
if (role == Qt::ToolTipRole && boolSetting(UseToolTipsInBreakpointsView))
|
||||
if (role == Qt::ToolTipRole && debuggerSettings()->useToolTipsInBreakpointsView.value())
|
||||
return toolTip();
|
||||
|
||||
return QVariant();
|
||||
@@ -2502,7 +2501,7 @@ void BreakpointManager::toggleBreakpoint(const ContextData &location, const QStr
|
||||
BreakpointParameters data;
|
||||
if (location.type == LocationByFile) {
|
||||
data.type = BreakpointByFileAndLine;
|
||||
if (boolSetting(BreakpointsFullPathByDefault))
|
||||
if (debuggerSettings()->breakpointsFullPathByDefault.value())
|
||||
data.pathUsage = BreakpointUseFullPath;
|
||||
data.tracepoint = !tracePointMessage.isEmpty();
|
||||
data.message = tracePointMessage;
|
||||
@@ -2684,8 +2683,8 @@ bool BreakpointManager::contextMenuEvent(const ItemViewEvent &ev)
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
menu->addAction(action(UseToolTipsInBreakpointsView)->action());
|
||||
menu->addAction(action(SettingsDialog)->action());
|
||||
menu->addAction(debuggerSettings()->useToolTipsInBreakpointsView.action());
|
||||
menu->addAction(debuggerSettings()->settingsDialog.action());
|
||||
|
||||
menu->popup(ev.globalPos());
|
||||
|
||||
|
@@ -7,6 +7,3 @@ SOURCES += $$PWD/cdbengine.cpp \
|
||||
cdb/cdbparsehelpers.cpp \
|
||||
cdb/cdboptionspage.cpp \
|
||||
cdb/stringinputstream.cpp
|
||||
|
||||
FORMS += cdb/cdboptionspagewidget.ui
|
||||
|
||||
|
@@ -64,7 +64,6 @@
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/savedaction.h>
|
||||
#include <utils/stringutils.h>
|
||||
#include <utils/synchronousprocess.h>
|
||||
#include <utils/winutils.h>
|
||||
@@ -204,7 +203,8 @@ CdbEngine::CdbEngine() :
|
||||
wh->addTypeFormats("QImage", imageFormats);
|
||||
wh->addTypeFormats("QImage *", imageFormats);
|
||||
|
||||
connect(action(CreateFullBacktrace)->action(), &QAction::triggered,
|
||||
DebuggerSettings *s = debuggerSettings();
|
||||
connect(s->createFullBacktrace.action(), &QAction::triggered,
|
||||
this, &CdbEngine::createFullBacktrace);
|
||||
connect(&m_process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
||||
this, &CdbEngine::processFinished);
|
||||
@@ -213,10 +213,10 @@ CdbEngine::CdbEngine() :
|
||||
this, &CdbEngine::readyReadStandardOut);
|
||||
connect(&m_process, &QProcess::readyReadStandardError,
|
||||
this, &CdbEngine::readyReadStandardOut);
|
||||
connect(action(UseDebuggingHelpers), &SavedAction::valueChanged,
|
||||
connect(&s->useDebuggingHelpers, &BaseAspect::changed,
|
||||
this, &CdbEngine::updateLocals);
|
||||
|
||||
if (action(UseCodeModel)->action()->isChecked())
|
||||
if (s->useCodeModel.value())
|
||||
m_codeModelSnapshot = CppTools::CppModelManager::instance()->snapshot();
|
||||
}
|
||||
|
||||
@@ -389,16 +389,17 @@ void CdbEngine::setupEngine()
|
||||
if (sp.useTerminal) // Separate console
|
||||
debugger.addArg("-2");
|
||||
|
||||
if (boolSetting(IgnoreFirstChanceAccessViolation))
|
||||
const DebuggerSettings &s = *debuggerSettings();
|
||||
if (s.ignoreFirstChanceAccessViolation.value())
|
||||
debugger.addArg("-x");
|
||||
|
||||
const QStringList &sourcePaths = stringListSetting(CdbSourcePaths);
|
||||
const QStringList &sourcePaths = s.cdbSourcePaths.value();
|
||||
if (!sourcePaths.isEmpty())
|
||||
debugger.addArgs({"-srcpath", sourcePaths.join(';')});
|
||||
|
||||
debugger.addArgs({"-y", QChar('"') + stringListSetting(CdbSymbolPaths).join(';') + '"'});
|
||||
debugger.addArgs({"-y", QChar('"') + s.cdbSymbolPaths.value().join(';') + '"'});
|
||||
|
||||
debugger.addArgs(expand(stringSetting(CdbAdditionalArguments)), CommandLine::Raw);
|
||||
debugger.addArgs(expand(s.cdbAdditionalArguments.value()), CommandLine::Raw);
|
||||
|
||||
switch (sp.startMode) {
|
||||
case StartInternal:
|
||||
@@ -500,7 +501,8 @@ void CdbEngine::handleInitialSessionIdle()
|
||||
// Take ownership of the breakpoint. Requests insertion. TODO: Cpp only?
|
||||
BreakpointManager::claimBreakpointsForEngine(this);
|
||||
|
||||
QStringList symbolPaths = stringListSetting(CdbSymbolPaths);
|
||||
const DebuggerSettings &s = *debuggerSettings();
|
||||
QStringList symbolPaths = s.cdbSymbolPaths.value();
|
||||
QString symbolPath = rp.inferior.environment.expandedValueForKey("_NT_ALT_SYMBOL_PATH");
|
||||
if (!symbolPath.isEmpty())
|
||||
symbolPaths += symbolPath;
|
||||
@@ -514,13 +516,13 @@ void CdbEngine::handleInitialSessionIdle()
|
||||
runCommand({"sxn ibp", NoFlags}); // Do not break on initial breakpoints.
|
||||
runCommand({".asm source_line", NoFlags}); // Source line in assembly
|
||||
runCommand({m_extensionCommandPrefix
|
||||
+ "setparameter maxStringLength=" + action(MaximalStringLength)->value().toString()
|
||||
+ " maxStackDepth=" + action(MaximalStackDepth)->value().toString()
|
||||
+ " firstChance=" + (action(FirstChanceExceptionTaskEntry)->value().toBool() ? "1" : "0")
|
||||
+ " secondChance=" + (action(SecondChanceExceptionTaskEntry)->value().toBool() ? "1" : "0")
|
||||
+ "setparameter maxStringLength=" + QString::number(s.maximalStringLength.value())
|
||||
+ " maxStackDepth=" + QString::number(s.maximalStackDepth.value())
|
||||
+ " firstChance=" + (s.firstChanceExceptionTaskEntry.value() ? "1" : "0")
|
||||
+ " secondChance=" + (s.secondChanceExceptionTaskEntry.value() ? "1" : "0")
|
||||
, NoFlags});
|
||||
|
||||
if (boolSetting(CdbUsePythonDumper))
|
||||
if (s.cdbUsePythonDumper.value())
|
||||
runCommand({"print(sys.version)", ScriptCommand, CB(setupScripting)});
|
||||
|
||||
runCommand({"pid", ExtensionCommand, [this](const DebuggerResponse &response) {
|
||||
@@ -578,30 +580,30 @@ void CdbEngine::runEngine()
|
||||
if (debug)
|
||||
qDebug("runEngine");
|
||||
|
||||
const QStringList breakEvents = stringListSetting(CdbBreakEvents);
|
||||
const QStringList breakEvents = debuggerSettings()->cdbBreakEvents.value();
|
||||
for (const QString &breakEvent : breakEvents)
|
||||
runCommand({"sxe " + breakEvent, NoFlags});
|
||||
// Break functions: each function must be fully qualified,
|
||||
// else the debugger will slow down considerably.
|
||||
const auto cb = [this](const DebuggerResponse &r) { handleBreakInsert(r, Breakpoint()); };
|
||||
if (boolSetting(CdbBreakOnCrtDbgReport)) {
|
||||
if (debuggerSettings()->cdbBreakOnCrtDbgReport.value()) {
|
||||
Abi::OSFlavor flavor = runParameters().toolChainAbi.osFlavor();
|
||||
// CrtDebugReport cannot be safely resolved for vc 19
|
||||
if ((flavor > Abi::WindowsMsvc2005Flavor && flavor <= Abi::WindowsMsvc2013Flavor) ||
|
||||
flavor > Abi::WindowsMSysFlavor || flavor <= Abi::WindowsCEFlavor) {
|
||||
const QString module = msvcRunTime(flavor);
|
||||
const QString debugModule = module + 'D';
|
||||
const QString wideFunc = QString::fromLatin1(CdbOptionsPage::crtDbgReport).append('W');
|
||||
runCommand({breakAtFunctionCommand(QLatin1String(CdbOptionsPage::crtDbgReport), module), BuiltinCommand, cb});
|
||||
const QString wideFunc = QString(Constants::CRT_DEBUG_REPORT).append('W');
|
||||
runCommand({breakAtFunctionCommand(Constants::CRT_DEBUG_REPORT, module), BuiltinCommand, cb});
|
||||
runCommand({breakAtFunctionCommand(wideFunc, module), BuiltinCommand, cb});
|
||||
runCommand({breakAtFunctionCommand(QLatin1String(CdbOptionsPage::crtDbgReport), debugModule), BuiltinCommand, cb});
|
||||
runCommand({breakAtFunctionCommand(Constants::CRT_DEBUG_REPORT, debugModule), BuiltinCommand, cb});
|
||||
}
|
||||
}
|
||||
// if (boolSetting(BreakOnWarning)) {
|
||||
// if (debuggerSettings()->breakOnWarning.value())) {
|
||||
// runCommand({"bm /( QtCored4!qWarning", BuiltinCommand}); // 'bm': All overloads.
|
||||
// runCommand({"bm /( Qt5Cored!QMessageLogger::warning", BuiltinCommand});
|
||||
// }
|
||||
// if (boolSetting(BreakOnFatal)) {
|
||||
// if (debuggerSettion()->breakOnFatal.value()) {
|
||||
// runCommand({"bm /( QtCored4!qFatal", BuiltinCommand}); // 'bm': All overloads.
|
||||
// runCommand({"bm /( Qt5Cored!QMessageLogger::fatal", BuiltinCommand});
|
||||
// }
|
||||
@@ -1089,6 +1091,7 @@ void CdbEngine::activateFrame(int index)
|
||||
|
||||
void CdbEngine::doUpdateLocals(const UpdateParameters &updateParameters)
|
||||
{
|
||||
const DebuggerSettings &s = *debuggerSettings();
|
||||
if (m_pythonVersion > 0x030000) {
|
||||
watchHandler()->notifyUpdateStarted(updateParameters);
|
||||
|
||||
@@ -1098,21 +1101,21 @@ void CdbEngine::doUpdateLocals(const UpdateParameters &updateParameters)
|
||||
|
||||
const static bool alwaysVerbose = qEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE");
|
||||
cmd.arg("passexceptions", alwaysVerbose);
|
||||
cmd.arg("fancy", boolSetting(UseDebuggingHelpers));
|
||||
cmd.arg("autoderef", boolSetting(AutoDerefPointers));
|
||||
cmd.arg("dyntype", boolSetting(UseDynamicType));
|
||||
cmd.arg("fancy", s.useDebuggingHelpers.value());
|
||||
cmd.arg("autoderef", s.autoDerefPointers.value());
|
||||
cmd.arg("dyntype", s.useDynamicType.value());
|
||||
cmd.arg("partialvar", updateParameters.partialVariable);
|
||||
cmd.arg("qobjectnames", boolSetting(ShowQObjectNames));
|
||||
cmd.arg("timestamps", boolSetting(LogTimeStamps));
|
||||
cmd.arg("qobjectnames", s.showQObjectNames.value());
|
||||
cmd.arg("timestamps", s.logTimeStamps.value());
|
||||
|
||||
StackFrame frame = stackHandler()->currentFrame();
|
||||
cmd.arg("context", frame.context);
|
||||
cmd.arg("nativemixed", isNativeMixedActive());
|
||||
|
||||
cmd.arg("stringcutoff", action(MaximalStringLength)->value().toString());
|
||||
cmd.arg("displaystringlimit", action(DisplayStringLimit)->value().toString());
|
||||
cmd.arg("stringcutoff", s.maximalStringLength.value());
|
||||
cmd.arg("displaystringlimit", s.displayStringLimit.value());
|
||||
|
||||
if (boolSetting(UseCodeModel)) {
|
||||
if (s.useCodeModel.value()) {
|
||||
QStringList variables = getUninitializedVariables(m_codeModelSnapshot,
|
||||
frame.function, frame.file, frame.line);
|
||||
cmd.arg("uninitialized", variables);
|
||||
@@ -1171,9 +1174,9 @@ void CdbEngine::doUpdateLocals(const UpdateParameters &updateParameters)
|
||||
}
|
||||
}
|
||||
str << blankSeparator << "-v";
|
||||
if (boolSetting(UseDebuggingHelpers))
|
||||
if (s.useDebuggingHelpers.value())
|
||||
str << blankSeparator << "-c";
|
||||
if (boolSetting(SortStructMembers))
|
||||
if (s.sortStructMembers.value())
|
||||
str << blankSeparator << "-a";
|
||||
const QString typeFormats = watchHandler()->typeFormatRequests();
|
||||
if (!typeFormats.isEmpty())
|
||||
@@ -1183,7 +1186,7 @@ void CdbEngine::doUpdateLocals(const UpdateParameters &updateParameters)
|
||||
str << blankSeparator << "-I " << individualFormats;
|
||||
// Uninitialized variables if desired. Quote as safeguard against shadowed
|
||||
// variables in case of errors in uninitializedVariables().
|
||||
if (boolSetting(UseCodeModel)) {
|
||||
if (s.useCodeModel.value()) {
|
||||
const QStringList variables = getUninitializedVariables(m_codeModelSnapshot,
|
||||
frame.function, frame.file, frame.line);
|
||||
if (!variables.isEmpty()) {
|
||||
@@ -2487,7 +2490,7 @@ void CdbEngine::insertBreakpoint(const Breakpoint &bp)
|
||||
new BreakpointCorrectionContext(m_codeModelSnapshot, CppTools::CppModelManager::instance()->workingCopy()));
|
||||
if (!m_autoBreakPointCorrection
|
||||
&& parameters.type == BreakpointByFileAndLine
|
||||
&& boolSetting(CdbBreakPointCorrection)) {
|
||||
&& debuggerSettings()->cdbBreakPointCorrection.value()) {
|
||||
response.lineNumber = int(lineCorrection->fixLineNumber(parameters.fileName.toString(),
|
||||
unsigned(parameters.lineNumber)));
|
||||
QString cmd = cdbAddBreakpointCommand(response, m_sourcePathMappings, responseId);
|
||||
@@ -2759,13 +2762,13 @@ void CdbEngine::setupScripting(const DebuggerResponse &response)
|
||||
runCommand({"print(dir())", ScriptCommand});
|
||||
runCommand({"theDumper = Dumper()", ScriptCommand});
|
||||
|
||||
const QString path = stringSetting(ExtraDumperFile);
|
||||
const QString path = debuggerSettings()->extraDumperFile.value();
|
||||
if (!path.isEmpty() && QFileInfo(path).isReadable()) {
|
||||
DebuggerCommand cmd("theDumper.addDumperModule", ScriptCommand);
|
||||
cmd.arg("path", path);
|
||||
runCommand(cmd);
|
||||
}
|
||||
const QString commands = stringSetting(ExtraDumperCommands);
|
||||
const QString commands = debuggerSettings()->extraDumperCommands.value();
|
||||
if (!commands.isEmpty()) {
|
||||
for (const auto &command : commands.split('\n', Qt::SkipEmptyParts))
|
||||
runCommand({command, ScriptCommand});
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include "cdboptionspage.h"
|
||||
|
||||
#include "cdbengine.h"
|
||||
#include "ui_cdboptionspagewidget.h"
|
||||
|
||||
#include <debugger/commonoptionspage.h>
|
||||
#include <debugger/debuggeractions.h>
|
||||
#include <debugger/debuggercore.h>
|
||||
@@ -35,16 +35,18 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <utils/savedaction.h>
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
#include <QCheckBox>
|
||||
#include <QFormLayout>
|
||||
#include <QTextStream>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
const char *CdbOptionsPage::crtDbgReport = "CrtDbgReport";
|
||||
|
||||
struct EventsDescription {
|
||||
const char *abbreviation;
|
||||
bool hasParameter;
|
||||
@@ -192,56 +194,59 @@ private:
|
||||
void apply() final;
|
||||
void finish() final;
|
||||
|
||||
Utils::SavedActionSet m_group;
|
||||
Ui::CdbOptionsPageWidget m_ui;
|
||||
Utils::AspectContainer &m_group = debuggerSettings()->page5;
|
||||
CdbBreakEventWidget *m_breakEventWidget;
|
||||
};
|
||||
|
||||
CdbOptionsPageWidget::CdbOptionsPageWidget()
|
||||
: m_breakEventWidget(new CdbBreakEventWidget)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
// Squeeze the groupbox layouts vertically to
|
||||
// accommodate all options. This page only shows on
|
||||
// Windows, which has large margins by default.
|
||||
using namespace Layouting;
|
||||
DebuggerSettings &s = *debuggerSettings();
|
||||
|
||||
int left, top, right, bottom;
|
||||
layout()->getContentsMargins(&left, &top, &right, &bottom);
|
||||
const QMargins margins(left, top / 3, right, bottom / 3);
|
||||
m_breakEventWidget->setBreakEvents(debuggerSettings()->cdbBreakEvents.value());
|
||||
|
||||
m_ui.startupFormLayout->setContentsMargins(margins);
|
||||
Column {
|
||||
Row {
|
||||
Group {
|
||||
Title(tr("Startup")),
|
||||
s.cdbAdditionalArguments,
|
||||
s.useCdbConsole,
|
||||
Stretch()
|
||||
},
|
||||
|
||||
auto eventLayout = new QVBoxLayout;
|
||||
eventLayout->setContentsMargins(margins);
|
||||
eventLayout->addWidget(m_breakEventWidget);
|
||||
m_ui.eventGroupBox->setLayout(eventLayout);
|
||||
m_ui.breakCrtDbgReportCheckBox
|
||||
->setText(CommonOptionsPage::msgSetBreakpointAtFunction(CdbOptionsPage::crtDbgReport));
|
||||
const QString hint = tr("This is useful to catch runtime error messages, for example caused by assert().");
|
||||
m_ui.breakCrtDbgReportCheckBox
|
||||
->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(CdbOptionsPage::crtDbgReport, hint));
|
||||
Group {
|
||||
Title(tr("Various")),
|
||||
s.ignoreFirstChanceAccessViolation,
|
||||
s.cdbBreakOnCrtDbgReport,
|
||||
s.cdbBreakPointCorrection,
|
||||
s.cdbUsePythonDumper
|
||||
}
|
||||
},
|
||||
|
||||
m_group.insert(action(CdbAdditionalArguments), m_ui.additionalArgumentsLineEdit);
|
||||
m_group.insert(action(CdbBreakOnCrtDbgReport), m_ui.breakCrtDbgReportCheckBox);
|
||||
m_group.insert(action(UseCdbConsole), m_ui.consoleCheckBox);
|
||||
m_group.insert(action(CdbBreakPointCorrection), m_ui.breakpointCorrectionCheckBox);
|
||||
m_group.insert(action(CdbUsePythonDumper), m_ui.usePythonDumper);
|
||||
m_group.insert(action(FirstChanceExceptionTaskEntry), m_ui.firstChance);
|
||||
m_group.insert(action(SecondChanceExceptionTaskEntry), m_ui.secondChance);
|
||||
m_group.insert(action(IgnoreFirstChanceAccessViolation),
|
||||
m_ui.ignoreFirstChanceAccessViolationCheckBox);
|
||||
Group {
|
||||
Title(tr("Break on")),
|
||||
m_breakEventWidget
|
||||
},
|
||||
|
||||
m_breakEventWidget->setBreakEvents(stringListSetting(CdbBreakEvents));
|
||||
Group {
|
||||
Title(tr("Add Exceptions to Issues View")),
|
||||
s.firstChanceExceptionTaskEntry,
|
||||
s.secondChanceExceptionTaskEntry
|
||||
}
|
||||
|
||||
}.attachTo(this);
|
||||
}
|
||||
|
||||
void CdbOptionsPageWidget::apply()
|
||||
{
|
||||
m_group.apply(Core::ICore::settings());
|
||||
action(CdbBreakEvents)->setValue(m_breakEventWidget->breakEvents());
|
||||
m_group.apply(); m_group.writeSettings(Core::ICore::settings());
|
||||
debuggerSettings()->cdbBreakEvents.setValue(m_breakEventWidget->breakEvents());
|
||||
}
|
||||
|
||||
void CdbOptionsPageWidget::finish()
|
||||
{
|
||||
m_breakEventWidget->setBreakEvents(debuggerSettings()->cdbBreakEvents.value());
|
||||
m_group.finish();
|
||||
}
|
||||
|
||||
@@ -263,33 +268,40 @@ class CdbPathsPageWidget : public Core::IOptionsPageWidget
|
||||
public:
|
||||
CdbPathsPageWidget();
|
||||
|
||||
void apply() final { m_group.apply(Core::ICore::settings()); }
|
||||
void finish() final { m_group.finish(); }
|
||||
void apply() final;
|
||||
void finish() final;
|
||||
|
||||
Utils::SavedActionSet m_group;
|
||||
AspectContainer &m_group = debuggerSettings()->page6;
|
||||
|
||||
private:
|
||||
PathListEditor *m_symbolPaths = nullptr;
|
||||
PathListEditor *m_sourcePaths = nullptr;
|
||||
};
|
||||
|
||||
CdbPathsPageWidget::CdbPathsPageWidget()
|
||||
: m_symbolPaths(new CdbSymbolPathListEditor)
|
||||
, m_sourcePaths(new PathListEditor)
|
||||
{
|
||||
auto layout = new QVBoxLayout(this);
|
||||
using namespace Layouting;
|
||||
|
||||
auto gbSymbolPath = new QGroupBox(tr("Symbol Paths"), this);
|
||||
auto gbSymbolPathLayout = new QVBoxLayout(gbSymbolPath);
|
||||
finish();
|
||||
Column {
|
||||
Group { Title(tr("Symbol Paths")), m_symbolPaths },
|
||||
Group { Title(tr("Source Paths")), m_sourcePaths }
|
||||
}.attachTo(this, false);
|
||||
}
|
||||
|
||||
auto symbolPathListEditor = new CdbSymbolPathListEditor(gbSymbolPath);
|
||||
gbSymbolPathLayout->addWidget(symbolPathListEditor);
|
||||
void CdbPathsPageWidget::apply()
|
||||
{
|
||||
debuggerSettings()->cdbSymbolPaths.setValue(m_symbolPaths->pathList());
|
||||
debuggerSettings()->cdbSourcePaths.setValue(m_sourcePaths->pathList());
|
||||
m_group.writeSettings(Core::ICore::settings());
|
||||
}
|
||||
|
||||
auto gbSourcePath = new QGroupBox(tr("Source Paths"), this);
|
||||
|
||||
auto gbSourcePathLayout = new QVBoxLayout(gbSourcePath);
|
||||
auto sourcePathListEditor = new Utils::PathListEditor(gbSourcePath);
|
||||
gbSourcePathLayout->addWidget(sourcePathListEditor);
|
||||
|
||||
layout->addWidget(gbSymbolPath);
|
||||
layout->addWidget(gbSourcePath);
|
||||
|
||||
m_group.insert(action(CdbSymbolPaths), symbolPathListEditor);
|
||||
m_group.insert(action(CdbSourcePaths), sourcePathListEditor);
|
||||
void CdbPathsPageWidget::finish()
|
||||
{
|
||||
m_symbolPaths->setPathList(debuggerSettings()->cdbSymbolPaths.value());
|
||||
m_sourcePaths->setPathList(debuggerSettings()->cdbSourcePaths.value());
|
||||
}
|
||||
|
||||
CdbPathsPage::CdbPathsPage()
|
||||
|
@@ -34,8 +34,6 @@ class CdbOptionsPage final : public Core::IOptionsPage
|
||||
{
|
||||
public:
|
||||
CdbOptionsPage();
|
||||
|
||||
static const char *crtDbgReport;
|
||||
};
|
||||
|
||||
class CdbPathsPage final : public Core::IOptionsPage
|
||||
|
@@ -1,152 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Debugger::Internal::CdbOptionsPageWidget</class>
|
||||
<widget class="QWidget" name="Debugger::Internal::CdbOptionsPageWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>629</width>
|
||||
<height>807</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="cdbPathGroupBox">
|
||||
<property name="title">
|
||||
<string extracomment="Placeholder">Startup</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="startupFormLayout">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="additionalArgumentsLabel">
|
||||
<property name="text">
|
||||
<string>Additional &arguments:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>additionalArgumentsLineEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="additionalArgumentsLineEdit"/>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="consoleCheckBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Uses CDB's native console for console applications. This overrides the setting in Environment > System. The native console does not prompt on application exit. It is suitable for diagnosing cases in which the application does not start up properly in the configured console and the subsequent attach fails.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use CDB &console</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="eventGroupBox">
|
||||
<property name="title">
|
||||
<string>Break on:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="variousGroupBox">
|
||||
<property name="title">
|
||||
<string>Various</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="ignoreFirstChanceAccessViolationCheckBox">
|
||||
<property name="text">
|
||||
<string>Ignore first chance access violations</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="breakCrtDbgReportCheckBox"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="breakpointCorrectionCheckBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Attempts to correct the location of a breakpoint based on file and line number should it be in a comment or in a line for which no code is generated. The correction is based on the code model.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Correct breakpoint location</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="usePythonDumper">
|
||||
<property name="text">
|
||||
<string>Use Python dumper</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="exceptions">
|
||||
<property name="title">
|
||||
<string>Add Exceptions to Issues View</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="firstChance">
|
||||
<property name="text">
|
||||
<string>First chance exceptions</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="secondChance">
|
||||
<property name="text">
|
||||
<string>Second chance exceptions</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@@ -35,18 +35,13 @@
|
||||
#include <app/app_version.h>
|
||||
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/savedaction.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QCoreApplication>
|
||||
#include <QFormLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QSpinBox>
|
||||
#include <QTextEdit>
|
||||
#include <QTextStream>
|
||||
|
||||
using namespace Core;
|
||||
@@ -54,6 +49,9 @@ using namespace Debugger::Constants;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace Utils {
|
||||
}
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
@@ -70,169 +68,57 @@ class CommonOptionsPageWidget : public Core::IOptionsPageWidget
|
||||
public:
|
||||
explicit CommonOptionsPageWidget()
|
||||
{
|
||||
auto behaviorBox = new QGroupBox(this);
|
||||
behaviorBox->setTitle(tr("Behavior"));
|
||||
|
||||
auto checkBoxUseAlternatingRowColors = new QCheckBox(behaviorBox);
|
||||
checkBoxUseAlternatingRowColors->setText(tr("Use alternating row colors in debug views"));
|
||||
|
||||
auto checkBoxFontSizeFollowsEditor = new QCheckBox(behaviorBox);
|
||||
checkBoxFontSizeFollowsEditor->setToolTip(tr("Changes the font size in the debugger views when the font size in the main editor changes."));
|
||||
checkBoxFontSizeFollowsEditor->setText(tr("Debugger font size follows main editor"));
|
||||
|
||||
auto checkBoxUseToolTipsInMainEditor = new QCheckBox(behaviorBox);
|
||||
checkBoxUseToolTipsInMainEditor->setText(tr("Use tooltips in main editor while debugging"));
|
||||
|
||||
auto checkBoxUseAnnotationsInMainEditor = new QCheckBox(behaviorBox);
|
||||
checkBoxUseAnnotationsInMainEditor->setText(tr("Use annotations in main editor while debugging"));
|
||||
|
||||
QString t = tr("Stopping and stepping in the debugger "
|
||||
"will automatically open views associated with the current location.") + '\n';
|
||||
auto checkBoxCloseSourceBuffersOnExit = new QCheckBox(behaviorBox);
|
||||
checkBoxCloseSourceBuffersOnExit->setText(tr("Close temporary source views on debugger exit"));
|
||||
checkBoxCloseSourceBuffersOnExit->setToolTip(t + tr("Closes automatically opened source views when the debugger exits."));
|
||||
|
||||
auto checkBoxCloseMemoryBuffersOnExit = new QCheckBox(behaviorBox);
|
||||
checkBoxCloseMemoryBuffersOnExit->setText(tr("Close temporary memory views on debugger exit"));
|
||||
checkBoxCloseMemoryBuffersOnExit->setToolTip(t + tr("Closes automatically opened memory views when the debugger exits."));
|
||||
|
||||
auto checkBoxSwitchModeOnExit = new QCheckBox(behaviorBox);
|
||||
checkBoxSwitchModeOnExit->setText(tr("Switch to previous mode on debugger exit"));
|
||||
|
||||
auto checkBoxBringToForegroundOnInterrrupt = new QCheckBox(behaviorBox);
|
||||
checkBoxBringToForegroundOnInterrrupt->setText(
|
||||
tr("Bring %1 to foreground when application interrupts")
|
||||
.arg(Core::Constants::IDE_DISPLAY_NAME));
|
||||
|
||||
auto checkBoxShowQmlObjectTree = new QCheckBox(behaviorBox);
|
||||
checkBoxShowQmlObjectTree->setToolTip(tr("Shows QML object tree in Locals and Expressions when connected and not stepping."));
|
||||
checkBoxShowQmlObjectTree->setText(tr("Show QML object tree"));
|
||||
|
||||
auto checkBoxBreakpointsFullPath = new QCheckBox(behaviorBox);
|
||||
checkBoxBreakpointsFullPath->setToolTip(tr("Enables a full file path in breakpoints by default also for GDB."));
|
||||
checkBoxBreakpointsFullPath->setText(tr("Set breakpoints using a full absolute path"));
|
||||
|
||||
auto checkBoxRegisterForPostMortem = new QCheckBox(behaviorBox);
|
||||
checkBoxRegisterForPostMortem->setToolTip(
|
||||
tr("Registers %1 for debugging crashed applications.")
|
||||
.arg(Core::Constants::IDE_DISPLAY_NAME));
|
||||
checkBoxRegisterForPostMortem->setText(
|
||||
tr("Use %1 for post-mortem debugging")
|
||||
.arg(Core::Constants::IDE_DISPLAY_NAME));
|
||||
|
||||
auto checkBoxWarnOnReleaseBuilds = new QCheckBox(behaviorBox);
|
||||
checkBoxWarnOnReleaseBuilds->setText(tr("Warn when debugging \"Release\" builds"));
|
||||
checkBoxWarnOnReleaseBuilds->setToolTip(tr("Shows a warning when starting the debugger "
|
||||
"on a binary with insufficient debug information."));
|
||||
|
||||
auto checkBoxKeepEditorStationaryWhileStepping = new QCheckBox(behaviorBox);
|
||||
checkBoxKeepEditorStationaryWhileStepping->setText(tr("Keep editor stationary when stepping"));
|
||||
checkBoxKeepEditorStationaryWhileStepping->setToolTip(tr("Scrolls the editor only when it is necessary "
|
||||
"to keep the current line in view, "
|
||||
"instead of keeping the next statement centered at "
|
||||
"all times."));
|
||||
|
||||
auto labelMaximalStackDepth = new QLabel(tr("Maximum stack depth:"), behaviorBox);
|
||||
|
||||
auto spinBoxMaximalStackDepth = new QSpinBox(behaviorBox);
|
||||
spinBoxMaximalStackDepth->setSpecialValueText(tr("<unlimited>"));
|
||||
spinBoxMaximalStackDepth->setMaximum(999);
|
||||
spinBoxMaximalStackDepth->setSingleStep(5);
|
||||
spinBoxMaximalStackDepth->setValue(10);
|
||||
|
||||
m_sourceMappingWidget = new DebuggerSourcePathMappingWidget(this);
|
||||
|
||||
auto horizontalLayout = new QHBoxLayout;
|
||||
horizontalLayout->addWidget(labelMaximalStackDepth);
|
||||
horizontalLayout->addWidget(spinBoxMaximalStackDepth);
|
||||
horizontalLayout->addStretch();
|
||||
|
||||
auto gridLayout = new QGridLayout(behaviorBox);
|
||||
gridLayout->addWidget(checkBoxUseAlternatingRowColors, 0, 0, 1, 1);
|
||||
gridLayout->addWidget(checkBoxUseAnnotationsInMainEditor, 1, 0, 1, 1);
|
||||
gridLayout->addWidget(checkBoxUseToolTipsInMainEditor, 2, 0, 1, 1);
|
||||
gridLayout->addWidget(checkBoxCloseSourceBuffersOnExit, 3, 0, 1, 1);
|
||||
gridLayout->addWidget(checkBoxCloseMemoryBuffersOnExit, 4, 0, 1, 1);
|
||||
gridLayout->addWidget(checkBoxBringToForegroundOnInterrrupt, 5, 0, 1, 1);
|
||||
gridLayout->addWidget(checkBoxBreakpointsFullPath, 6, 0, 1, 1);
|
||||
gridLayout->addWidget(checkBoxWarnOnReleaseBuilds, 7, 0, 1, 1);
|
||||
gridLayout->addLayout(horizontalLayout, 8, 0, 1, 2);
|
||||
|
||||
gridLayout->addWidget(checkBoxFontSizeFollowsEditor, 0, 1, 1, 1);
|
||||
gridLayout->addWidget(checkBoxSwitchModeOnExit, 1, 1, 1, 1);
|
||||
gridLayout->addWidget(checkBoxShowQmlObjectTree, 2, 1, 1, 1);
|
||||
gridLayout->addWidget(checkBoxKeepEditorStationaryWhileStepping, 3, 1, 1, 1);
|
||||
gridLayout->addWidget(checkBoxRegisterForPostMortem, 4, 1, 1, 1);
|
||||
|
||||
auto verticalLayout = new QVBoxLayout(this);
|
||||
verticalLayout->addWidget(behaviorBox);
|
||||
verticalLayout->addWidget(m_sourceMappingWidget);
|
||||
verticalLayout->addStretch();
|
||||
|
||||
m_group.insert(action(UseAlternatingRowColors),
|
||||
checkBoxUseAlternatingRowColors);
|
||||
m_group.insert(action(UseAnnotationsInMainEditor),
|
||||
checkBoxUseAnnotationsInMainEditor);
|
||||
m_group.insert(action(UseToolTipsInMainEditor),
|
||||
checkBoxUseToolTipsInMainEditor);
|
||||
m_group.insert(action(CloseSourceBuffersOnExit),
|
||||
checkBoxCloseSourceBuffersOnExit);
|
||||
m_group.insert(action(CloseMemoryBuffersOnExit),
|
||||
checkBoxCloseMemoryBuffersOnExit);
|
||||
m_group.insert(action(SwitchModeOnExit),
|
||||
checkBoxSwitchModeOnExit);
|
||||
m_group.insert(action(BreakpointsFullPathByDefault),
|
||||
checkBoxBreakpointsFullPath);
|
||||
m_group.insert(action(RaiseOnInterrupt),
|
||||
checkBoxBringToForegroundOnInterrrupt);
|
||||
m_group.insert(action(ShowQmlObjectTree),
|
||||
checkBoxShowQmlObjectTree);
|
||||
m_group.insert(action(WarnOnReleaseBuilds),
|
||||
checkBoxWarnOnReleaseBuilds);
|
||||
m_group.insert(action(StationaryEditorWhileStepping),
|
||||
checkBoxKeepEditorStationaryWhileStepping);
|
||||
m_group.insert(action(FontSizeFollowsEditor),
|
||||
checkBoxFontSizeFollowsEditor);
|
||||
m_group.insert(action(AutoDerefPointers), nullptr);
|
||||
m_group.insert(action(UseToolTipsInLocalsView), nullptr);
|
||||
m_group.insert(action(AlwaysAdjustColumnWidths), nullptr);
|
||||
m_group.insert(action(UseToolTipsInBreakpointsView), nullptr);
|
||||
m_group.insert(action(UseToolTipsInStackView), nullptr);
|
||||
m_group.insert(action(MaximalStackDepth), spinBoxMaximalStackDepth);
|
||||
m_group.insert(action(ShowStdNamespace), nullptr);
|
||||
m_group.insert(action(ShowQtNamespace), nullptr);
|
||||
m_group.insert(action(ShowQObjectNames), nullptr);
|
||||
m_group.insert(action(SortStructMembers), nullptr);
|
||||
m_group.insert(action(LogTimeStamps), nullptr);
|
||||
m_group.insert(action(BreakOnThrow), nullptr);
|
||||
m_group.insert(action(BreakOnCatch), nullptr);
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
SavedAction *registerAction = action(RegisterForPostMortem);
|
||||
m_group.insert(registerAction, checkBoxRegisterForPostMortem);
|
||||
connect(registerAction->action(), &QAction::toggled,
|
||||
checkBoxRegisterForPostMortem, &QAbstractButton::setChecked);
|
||||
} else {
|
||||
checkBoxRegisterForPostMortem->setVisible(false);
|
||||
}
|
||||
|
||||
GlobalDebuggerOptions *options = Internal::globalDebuggerOptions();
|
||||
SourcePathMap allPathMap = options->sourcePathMap;
|
||||
for (const auto ®ExpMap : qAsConst(options->sourcePathRegExpMap))
|
||||
allPathMap.insert(regExpMap.first.pattern(), regExpMap.second);
|
||||
m_sourceMappingWidget->setSourcePathMap(allPathMap);
|
||||
|
||||
DebuggerSettings &s = *debuggerSettings();
|
||||
using namespace Layouting;
|
||||
|
||||
Column col1 {
|
||||
s.useAlternatingRowColors,
|
||||
s.useAnnotationsInMainEditor,
|
||||
s.useToolTipsInMainEditor,
|
||||
s.closeSourceBuffersOnExit,
|
||||
s.closeMemoryBuffersOnExit,
|
||||
s.raiseOnInterrupt,
|
||||
s.breakpointsFullPathByDefault,
|
||||
s.warnOnReleaseBuilds,
|
||||
Row { s.maximalStackDepth, Stretch() }
|
||||
};
|
||||
|
||||
Column col2 {
|
||||
s.fontSizeFollowsEditor,
|
||||
s.switchModeOnExit,
|
||||
s.showQmlObjectTree,
|
||||
s.stationaryEditorWhileStepping,
|
||||
s.registerForPostMortem,
|
||||
Stretch()
|
||||
};
|
||||
|
||||
Column {
|
||||
Group { Title("Behavior"), Row { col1, col2, Stretch() } },
|
||||
m_sourceMappingWidget,
|
||||
Stretch()
|
||||
}.attachTo(this);
|
||||
}
|
||||
|
||||
void apply() final;
|
||||
void finish() final { m_group.finish(); }
|
||||
|
||||
private:
|
||||
SavedActionSet m_group;
|
||||
AspectContainer &m_group = debuggerSettings()->page1;
|
||||
DebuggerSourcePathMappingWidget *m_sourceMappingWidget = nullptr;
|
||||
};
|
||||
|
||||
void CommonOptionsPageWidget::apply()
|
||||
{
|
||||
m_group.apply(ICore::settings());
|
||||
m_group.apply();
|
||||
m_group.writeSettings(ICore::settings());
|
||||
|
||||
GlobalDebuggerOptions *options = Internal::globalDebuggerOptions();
|
||||
options->sourcePathMap.clear();
|
||||
@@ -292,11 +178,10 @@ class LocalsAndExpressionsOptionsPageWidget : public IOptionsPageWidget
|
||||
public:
|
||||
LocalsAndExpressionsOptionsPageWidget()
|
||||
{
|
||||
auto debuggingHelperGroupBox = new QGroupBox(this);
|
||||
debuggingHelperGroupBox->setTitle(tr("Use Debugging Helper"));
|
||||
debuggingHelperGroupBox->setCheckable(true);
|
||||
using namespace Layouting;
|
||||
DebuggerSettings &s = *debuggerSettings();
|
||||
|
||||
auto label = new QLabel(debuggingHelperGroupBox);
|
||||
auto label = new QLabel; //(useHelperGroup);
|
||||
label->setTextFormat(Qt::AutoText);
|
||||
label->setWordWrap(true);
|
||||
label->setText("<html><head/><body>\n<p>"
|
||||
@@ -305,97 +190,44 @@ public:
|
||||
"std::map in the "Locals" and "Expressions" views.")
|
||||
+ "</p></body></html>");
|
||||
|
||||
auto groupBoxCustomDumperCommands = new QGroupBox(debuggingHelperGroupBox);
|
||||
groupBoxCustomDumperCommands->setTitle(tr("Debugging Helper Customization"));
|
||||
groupBoxCustomDumperCommands->setToolTip("<html><head/><body><p>"
|
||||
+ tr("Python commands entered here will be executed after built-in "
|
||||
"debugging helpers have been loaded and fully initialized. You can "
|
||||
"load additional debugging helpers or modify existing ones here.")
|
||||
+ "</p></body></html>");
|
||||
Column left {
|
||||
label,
|
||||
s.useCodeModel,
|
||||
s.showThreadNames,
|
||||
Group { Title(tr("Extra Debugging Helper")), s.extraDumperFile }
|
||||
};
|
||||
|
||||
auto textEditCustomDumperCommands = new QTextEdit(groupBoxCustomDumperCommands);
|
||||
textEditCustomDumperCommands->setAcceptRichText(false);
|
||||
textEditCustomDumperCommands->setToolTip(groupBoxCustomDumperCommands->toolTip());
|
||||
Group useHelper {
|
||||
Row {
|
||||
left,
|
||||
Group { Title(tr("Debugging Helper Customization")), s.extraDumperCommands }
|
||||
}
|
||||
};
|
||||
|
||||
auto groupBoxExtraDumperFile = new QGroupBox(debuggingHelperGroupBox);
|
||||
groupBoxExtraDumperFile->setTitle(tr("Extra Debugging Helpers"));
|
||||
groupBoxExtraDumperFile->setToolTip(tr(
|
||||
"Path to a Python file containing additional data dumpers."));
|
||||
Grid limits {
|
||||
s.maximalStringLength,
|
||||
Break(),
|
||||
s.displayStringLimit
|
||||
};
|
||||
|
||||
auto pathChooserExtraDumperFile = new Utils::PathChooser(groupBoxExtraDumperFile);
|
||||
pathChooserExtraDumperFile->setExpectedKind(Utils::PathChooser::File);
|
||||
|
||||
auto checkBoxUseCodeModel = new QCheckBox(debuggingHelperGroupBox);
|
||||
auto checkBoxShowThreadNames = new QCheckBox(debuggingHelperGroupBox);
|
||||
auto checkBoxShowStdNamespace = new QCheckBox(this);
|
||||
auto checkBoxShowQtNamespace = new QCheckBox(this);
|
||||
auto checkBoxShowQObjectNames = new QCheckBox(this);
|
||||
|
||||
auto spinBoxMaximalStringLength = new QSpinBox(this);
|
||||
spinBoxMaximalStringLength->setSpecialValueText(tr("<unlimited>"));
|
||||
spinBoxMaximalStringLength->setMaximum(10000000);
|
||||
spinBoxMaximalStringLength->setSingleStep(1000);
|
||||
spinBoxMaximalStringLength->setValue(10000);
|
||||
|
||||
auto spinBoxDisplayStringLimit = new QSpinBox(this);
|
||||
spinBoxDisplayStringLimit->setSpecialValueText(tr("<unlimited>"));
|
||||
spinBoxDisplayStringLimit->setMaximum(10000);
|
||||
spinBoxDisplayStringLimit->setSingleStep(10);
|
||||
spinBoxDisplayStringLimit->setValue(100);
|
||||
|
||||
auto chooser = new VariableChooser(this);
|
||||
chooser->addSupportedWidget(textEditCustomDumperCommands);
|
||||
chooser->addSupportedWidget(pathChooserExtraDumperFile->lineEdit());
|
||||
|
||||
auto gridLayout = new QGridLayout(debuggingHelperGroupBox);
|
||||
gridLayout->addWidget(label, 0, 0, 1, 1);
|
||||
gridLayout->addWidget(checkBoxUseCodeModel, 1, 0, 1, 1);
|
||||
gridLayout->addWidget(checkBoxShowThreadNames, 2, 0, 1, 1);
|
||||
gridLayout->addWidget(groupBoxExtraDumperFile, 3, 0, 1, 1);
|
||||
gridLayout->addWidget(groupBoxCustomDumperCommands, 0, 1, 4, 1);
|
||||
|
||||
auto layout1 = new QFormLayout;
|
||||
layout1->addItem(new QSpacerItem(10, 10));
|
||||
layout1->addRow(checkBoxShowStdNamespace);
|
||||
layout1->addRow(checkBoxShowQtNamespace);
|
||||
layout1->addRow(checkBoxShowQObjectNames);
|
||||
layout1->addItem(new QSpacerItem(10, 10));
|
||||
layout1->addRow(tr("Maximum string length:"), spinBoxMaximalStringLength);
|
||||
layout1->addRow(tr("Display string length:"), spinBoxDisplayStringLimit);
|
||||
|
||||
auto lowerLayout = new QHBoxLayout;
|
||||
lowerLayout->addLayout(layout1);
|
||||
lowerLayout->addStretch();
|
||||
|
||||
auto layout = new QVBoxLayout(this);
|
||||
layout->addWidget(debuggingHelperGroupBox);
|
||||
layout->addLayout(lowerLayout);
|
||||
layout->addStretch();
|
||||
|
||||
auto customDumperLayout = new QGridLayout(groupBoxCustomDumperCommands);
|
||||
customDumperLayout->addWidget(textEditCustomDumperCommands, 0, 0, 1, 1);
|
||||
|
||||
auto extraDumperLayout = new QGridLayout(groupBoxExtraDumperFile);
|
||||
extraDumperLayout->addWidget(pathChooserExtraDumperFile, 0, 0, 1, 1);
|
||||
|
||||
m_group.clear();
|
||||
m_group.insert(action(UseDebuggingHelpers), debuggingHelperGroupBox);
|
||||
m_group.insert(action(ExtraDumperFile), pathChooserExtraDumperFile);
|
||||
m_group.insert(action(ExtraDumperCommands), textEditCustomDumperCommands);
|
||||
m_group.insert(action(UseCodeModel), checkBoxUseCodeModel);
|
||||
m_group.insert(action(ShowThreadNames), checkBoxShowThreadNames);
|
||||
m_group.insert(action(ShowStdNamespace), checkBoxShowStdNamespace);
|
||||
m_group.insert(action(ShowQtNamespace), checkBoxShowQtNamespace);
|
||||
m_group.insert(action(ShowQObjectNames), checkBoxShowQObjectNames);
|
||||
m_group.insert(action(DisplayStringLimit), spinBoxDisplayStringLimit);
|
||||
m_group.insert(action(MaximalStringLength), spinBoxMaximalStringLength);
|
||||
Column {
|
||||
s.useDebuggingHelpers,
|
||||
useHelper,
|
||||
Space(10),
|
||||
s.showStdNamespace,
|
||||
s.showQtNamespace,
|
||||
s.showQObjectNames,
|
||||
Space(10),
|
||||
Row { limits, Stretch() },
|
||||
Stretch()
|
||||
}.attachTo(this);
|
||||
}
|
||||
|
||||
void apply() final { m_group.apply(ICore::settings()); }
|
||||
void apply() final { m_group.apply(); m_group.writeSettings(ICore::settings()); }
|
||||
void finish() final { m_group.finish(); }
|
||||
|
||||
private:
|
||||
Utils::SavedActionSet m_group;
|
||||
AspectContainer &m_group = debuggerSettings()->page4;
|
||||
};
|
||||
|
||||
LocalsAndExpressionsOptionsPage::LocalsAndExpressionsOptionsPage()
|
||||
|
@@ -31,11 +31,11 @@
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/findplaceholder.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <utils/savedaction.h>
|
||||
#include <utils/utilsicons.h>
|
||||
#include <aggregation/aggregate.h>
|
||||
#include <coreplugin/find/itemviewfind.h>
|
||||
|
||||
#include <QAction>
|
||||
#include <QCoreApplication>
|
||||
#include <QToolButton>
|
||||
#include <QLabel>
|
||||
@@ -101,42 +101,39 @@ Console::Console()
|
||||
|
||||
m_showDebugButton = new QToolButton(m_consoleWidget);
|
||||
|
||||
m_showDebugButtonAction = new Utils::SavedAction(this);
|
||||
m_showDebugButtonAction->setDefaultValue(true);
|
||||
m_showDebugButtonAction->setSettingsKey(CONSOLE, SHOW_LOG);
|
||||
m_showDebugButtonAction->setToolTip(tr("Show debug, log, and info messages."));
|
||||
m_showDebugButtonAction->setCheckable(true);
|
||||
m_showDebugButtonAction->setChecked(true);
|
||||
m_showDebugButtonAction->setIcon(Utils::Icons::INFO_TOOLBAR.icon());
|
||||
connect(m_showDebugButtonAction->action(), &QAction::toggled,
|
||||
m_showDebug.setDefaultValue(true);
|
||||
m_showDebug.setSettingsKey(CONSOLE, SHOW_LOG);
|
||||
m_showDebug.setLabelText(tr("Show debug, log, and info messages."));
|
||||
m_showDebug.setToolTip(tr("Show debug, log, and info messages."));
|
||||
m_showDebug.setValue(true);
|
||||
m_showDebug.action()->setIcon(Utils::Icons::INFO_TOOLBAR.icon());
|
||||
connect(&m_showDebug, &Utils::BoolAspect::valueChanged,
|
||||
proxyModel, &ConsoleProxyModel::setShowLogs);
|
||||
m_showDebugButton->setDefaultAction(m_showDebugButtonAction->action());
|
||||
m_showDebugButton->setDefaultAction(m_showDebug.action());
|
||||
|
||||
m_showWarningButton = new QToolButton(m_consoleWidget);
|
||||
|
||||
m_showWarningButtonAction = new Utils::SavedAction(this);
|
||||
m_showWarningButtonAction->setDefaultValue(true);
|
||||
m_showWarningButtonAction->setSettingsKey(CONSOLE, SHOW_WARNING);
|
||||
m_showWarningButtonAction->setToolTip(tr("Show warning messages."));
|
||||
m_showWarningButtonAction->setCheckable(true);
|
||||
m_showWarningButtonAction->setChecked(true);
|
||||
m_showWarningButtonAction->setIcon(Utils::Icons::WARNING_TOOLBAR.icon());
|
||||
connect(m_showWarningButtonAction->action(), &QAction::toggled,
|
||||
m_showWarning.setDefaultValue(true);
|
||||
m_showWarning.setSettingsKey(CONSOLE, SHOW_WARNING);
|
||||
m_showWarning.setLabelText(tr("Show warning messages."));
|
||||
m_showWarning.setToolTip(tr("Show warning messages."));
|
||||
m_showWarning.setValue(true);
|
||||
m_showWarning.action()->setIcon(Utils::Icons::WARNING_TOOLBAR.icon());
|
||||
connect(m_showWarning.action(), &QAction::toggled,
|
||||
proxyModel, &ConsoleProxyModel::setShowWarnings);
|
||||
m_showWarningButton->setDefaultAction(m_showWarningButtonAction->action());
|
||||
m_showWarningButton->setDefaultAction(m_showWarning.action());
|
||||
|
||||
m_showErrorButton = new QToolButton(m_consoleWidget);
|
||||
|
||||
m_showErrorButtonAction = new Utils::SavedAction(this);
|
||||
m_showErrorButtonAction->setDefaultValue(true);
|
||||
m_showErrorButtonAction->setSettingsKey(CONSOLE, SHOW_ERROR);
|
||||
m_showErrorButtonAction->setToolTip(tr("Show error messages."));
|
||||
m_showErrorButtonAction->setCheckable(true);
|
||||
m_showErrorButtonAction->setChecked(true);
|
||||
m_showErrorButtonAction->setIcon(Utils::Icons::CRITICAL_TOOLBAR.icon());
|
||||
connect(m_showErrorButtonAction->action(), &QAction::toggled,
|
||||
m_showError.setDefaultValue(true);
|
||||
m_showError.setSettingsKey(CONSOLE, SHOW_ERROR);
|
||||
m_showError.setLabelText(tr("Show error messages."));
|
||||
m_showError.setToolTip(tr("Show error messages."));
|
||||
m_showError.setValue(true);
|
||||
m_showError.action()->setIcon(Utils::Icons::CRITICAL_TOOLBAR.icon());
|
||||
connect(m_showError.action(), &QAction::toggled,
|
||||
proxyModel, &ConsoleProxyModel::setShowErrors);
|
||||
m_showErrorButton->setDefaultAction(m_showErrorButtonAction->action());
|
||||
m_showErrorButton->setDefaultAction(m_showError.action());
|
||||
|
||||
m_spacer = new QWidget(m_consoleWidget);
|
||||
m_spacer->setMinimumWidth(30);
|
||||
@@ -221,9 +218,9 @@ bool Console::canNavigate() const
|
||||
void Console::readSettings()
|
||||
{
|
||||
QSettings *settings = Core::ICore::settings();
|
||||
m_showDebugButtonAction->readSettings(settings);
|
||||
m_showWarningButtonAction->readSettings(settings);
|
||||
m_showErrorButtonAction->readSettings(settings);
|
||||
m_showDebug.readSettings(settings);
|
||||
m_showWarning.readSettings(settings);
|
||||
m_showError.readSettings(settings);
|
||||
}
|
||||
|
||||
void Console::setContext(const QString &context)
|
||||
@@ -234,9 +231,9 @@ void Console::setContext(const QString &context)
|
||||
void Console::writeSettings() const
|
||||
{
|
||||
QSettings *settings = Core::ICore::settings();
|
||||
m_showDebugButtonAction->writeSettings(settings);
|
||||
m_showWarningButtonAction->writeSettings(settings);
|
||||
m_showErrorButtonAction->writeSettings(settings);
|
||||
m_showDebug.writeSettings(settings);
|
||||
m_showWarning.writeSettings(settings);
|
||||
m_showError.writeSettings(settings);
|
||||
}
|
||||
|
||||
void Console::setScriptEvaluator(const ScriptEvaluator &evaluator)
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include "consoleitem.h"
|
||||
|
||||
#include <coreplugin/ioutputpane.h>
|
||||
#include <utils/aspects.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
@@ -38,7 +39,7 @@ class QToolButton;
|
||||
class QLabel;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils { class SavedAction; }
|
||||
namespace Utils { class BoolAspect; }
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
@@ -87,9 +88,9 @@ private:
|
||||
QToolButton *m_showDebugButton;
|
||||
QToolButton *m_showWarningButton;
|
||||
QToolButton *m_showErrorButton;
|
||||
Utils::SavedAction *m_showDebugButtonAction;
|
||||
Utils::SavedAction *m_showWarningButtonAction;
|
||||
Utils::SavedAction *m_showErrorButtonAction;
|
||||
Utils::BoolAspect m_showDebug;
|
||||
Utils::BoolAspect m_showWarning;
|
||||
Utils::BoolAspect m_showError;
|
||||
QWidget *m_spacer;
|
||||
QLabel *m_statusLabel;
|
||||
ConsoleItemModel *m_consoleItemModel;
|
||||
|
@@ -95,7 +95,6 @@ Project {
|
||||
files: [
|
||||
"cdbengine.cpp", "cdbengine.h",
|
||||
"cdboptionspage.cpp", "cdboptionspage.h",
|
||||
"cdboptionspagewidget.ui",
|
||||
"cdbparsehelpers.cpp", "cdbparsehelpers.h",
|
||||
"stringinputstream.cpp", "stringinputstream.h",
|
||||
]
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -31,7 +31,7 @@
|
||||
#include <QRegularExpression>
|
||||
#include <QVector>
|
||||
|
||||
namespace Utils { class SavedAction; }
|
||||
#include <utils/aspects.h>
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
@@ -50,6 +50,12 @@ public:
|
||||
SourcePathRegExpMap sourcePathRegExpMap;
|
||||
};
|
||||
|
||||
class GeneralSettings
|
||||
{
|
||||
GeneralSettings();
|
||||
~GeneralSettings();
|
||||
};
|
||||
|
||||
class DebuggerSettings
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::DebuggerSettings)
|
||||
@@ -58,119 +64,125 @@ public:
|
||||
explicit DebuggerSettings();
|
||||
~DebuggerSettings();
|
||||
|
||||
void insertItem(int code, Utils::SavedAction *item);
|
||||
Utils::SavedAction *item(int code) const;
|
||||
|
||||
static QString dump();
|
||||
|
||||
// Page 1: General
|
||||
Utils::BoolAspect useAlternatingRowColors;
|
||||
Utils::BoolAspect useAnnotationsInMainEditor;
|
||||
Utils::BoolAspect useToolTipsInMainEditor;
|
||||
Utils::BoolAspect closeSourceBuffersOnExit;
|
||||
Utils::BoolAspect closeMemoryBuffersOnExit;
|
||||
Utils::BoolAspect raiseOnInterrupt;
|
||||
Utils::BoolAspect breakpointsFullPathByDefault;
|
||||
Utils::BoolAspect warnOnReleaseBuilds;
|
||||
Utils::IntegerAspect maximalStackDepth;
|
||||
|
||||
Utils::BoolAspect fontSizeFollowsEditor;
|
||||
Utils::BoolAspect switchModeOnExit;
|
||||
Utils::BoolAspect showQmlObjectTree;
|
||||
Utils::BoolAspect stationaryEditorWhileStepping;
|
||||
|
||||
// Page 2: GDB
|
||||
Utils::IntegerAspect gdbWatchdogTimeout;
|
||||
Utils::BoolAspect skipKnownFrames;
|
||||
Utils::BoolAspect useMessageBoxForSignals;
|
||||
Utils::BoolAspect adjustBreakpointLocations;
|
||||
Utils::BoolAspect useDynamicType;
|
||||
Utils::BoolAspect loadGdbInit;
|
||||
Utils::BoolAspect loadGdbDumpers;
|
||||
Utils::BoolAspect intelFlavor;
|
||||
Utils::BoolAspect usePseudoTracepoints;
|
||||
Utils::StringAspect gdbStartupCommands;
|
||||
Utils::StringAspect gdbPostAttachCommands;
|
||||
|
||||
// Page 3: GDB Extended
|
||||
Utils::BoolAspect targetAsync;
|
||||
Utils::BoolAspect autoEnrichParameters;
|
||||
Utils::BoolAspect breakOnThrow;
|
||||
Utils::BoolAspect breakOnCatch;
|
||||
Utils::BoolAspect breakOnWarning;
|
||||
Utils::BoolAspect breakOnFatal;
|
||||
Utils::BoolAspect breakOnAbort;
|
||||
Utils::BoolAspect enableReverseDebugging;
|
||||
Utils::BoolAspect multiInferior;
|
||||
|
||||
// Page 4: Locals and expressions
|
||||
Utils::BoolAspect useDebuggingHelpers;
|
||||
Utils::BoolAspect useCodeModel;
|
||||
Utils::BoolAspect showThreadNames;
|
||||
Utils::StringAspect extraDumperFile; // For loading a file. Recommended.
|
||||
Utils::StringAspect extraDumperCommands; // To modify an existing setup.
|
||||
|
||||
Utils::BoolAspect showStdNamespace;
|
||||
Utils::BoolAspect showQtNamespace;
|
||||
Utils::BoolAspect showQObjectNames;
|
||||
|
||||
// Page 5: CDB
|
||||
Utils::StringAspect cdbAdditionalArguments;
|
||||
Utils::StringListAspect cdbBreakEvents;
|
||||
Utils::BoolAspect cdbBreakOnCrtDbgReport;
|
||||
Utils::BoolAspect useCdbConsole;
|
||||
Utils::BoolAspect cdbBreakPointCorrection;
|
||||
Utils::BoolAspect cdbUsePythonDumper;
|
||||
Utils::BoolAspect firstChanceExceptionTaskEntry;
|
||||
Utils::BoolAspect secondChanceExceptionTaskEntry;
|
||||
Utils::BoolAspect ignoreFirstChanceAccessViolation;
|
||||
|
||||
Utils::BoolAspect *registerForPostMortem = nullptr;
|
||||
|
||||
// Page 6: CDB Paths
|
||||
Utils::StringListAspect cdbSymbolPaths;
|
||||
Utils::StringListAspect cdbSourcePaths;
|
||||
|
||||
// Without pages
|
||||
Utils::BoolAspect alwaysAdjustColumnWidths;
|
||||
Utils::BaseAspect settingsDialog;
|
||||
Utils::BoolAspect autoQuit;
|
||||
Utils::BoolAspect lockView;
|
||||
Utils::BoolAspect logTimeStamps;
|
||||
|
||||
// Stack
|
||||
Utils::BaseAspect expandStack;
|
||||
Utils::BaseAspect createFullBacktrace;
|
||||
Utils::BoolAspect useToolTipsInStackView;
|
||||
|
||||
// Watchers & Locals
|
||||
Utils::BoolAspect autoDerefPointers;
|
||||
Utils::IntegerAspect maximalStringLength;
|
||||
Utils::IntegerAspect displayStringLimit;
|
||||
Utils::BoolAspect sortStructMembers;
|
||||
Utils::BoolAspect useToolTipsInLocalsView;
|
||||
|
||||
// Breakpoints
|
||||
Utils::BoolAspect synchronizeBreakpoints; // ?
|
||||
Utils::BoolAspect allPluginBreakpoints;
|
||||
Utils::BoolAspect selectedPluginBreakpoints;
|
||||
Utils::BoolAspect noPluginBreakpoints;
|
||||
Utils::StringAspect selectedPluginBreakpointsPattern;
|
||||
Utils::BoolAspect useToolTipsInBreakpointsView;
|
||||
|
||||
// QML Tools
|
||||
Utils::BoolAspect showAppOnTop;
|
||||
|
||||
Utils::AspectContainer all; // All
|
||||
Utils::AspectContainer page1; // General
|
||||
Utils::AspectContainer page2; // GDB
|
||||
Utils::AspectContainer page3; // GDB Extended
|
||||
Utils::AspectContainer page4; // Locals & Expressions
|
||||
Utils::AspectContainer page5; // CDB
|
||||
Utils::AspectContainer page6; // CDB Paths
|
||||
|
||||
void readSettings();
|
||||
void writeSettings() const;
|
||||
|
||||
private:
|
||||
DebuggerSettings(const DebuggerSettings &) = delete;
|
||||
DebuggerSettings &operator=(const DebuggerSettings &) = delete;
|
||||
|
||||
QHash<int, Utils::SavedAction *> m_items;
|
||||
};
|
||||
|
||||
DebuggerSettings *debuggerSettings();
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
enum DebuggerActionCode
|
||||
{
|
||||
// General
|
||||
SettingsDialog,
|
||||
UseAlternatingRowColors,
|
||||
FontSizeFollowsEditor,
|
||||
UseMessageBoxForSignals,
|
||||
AutoQuit,
|
||||
LockView,
|
||||
LogTimeStamps,
|
||||
CloseSourceBuffersOnExit,
|
||||
CloseMemoryBuffersOnExit,
|
||||
SwitchModeOnExit,
|
||||
BreakpointsFullPathByDefault,
|
||||
RaiseOnInterrupt,
|
||||
StationaryEditorWhileStepping,
|
||||
|
||||
UseDebuggingHelpers,
|
||||
|
||||
UseCodeModel,
|
||||
ShowThreadNames,
|
||||
|
||||
UseToolTipsInMainEditor,
|
||||
UseAnnotationsInMainEditor,
|
||||
UseToolTipsInLocalsView,
|
||||
UseToolTipsInBreakpointsView,
|
||||
UseToolTipsInStackView,
|
||||
|
||||
RegisterForPostMortem,
|
||||
AlwaysAdjustColumnWidths,
|
||||
|
||||
ExtraDumperFile, // For loading a file. Recommended.
|
||||
ExtraDumperCommands, // To modify an existing setup.
|
||||
|
||||
// Cdb
|
||||
CdbAdditionalArguments,
|
||||
CdbSymbolPaths,
|
||||
CdbSourcePaths,
|
||||
CdbBreakEvents,
|
||||
CdbBreakOnCrtDbgReport,
|
||||
UseCdbConsole,
|
||||
CdbBreakPointCorrection,
|
||||
CdbUsePythonDumper,
|
||||
FirstChanceExceptionTaskEntry,
|
||||
SecondChanceExceptionTaskEntry,
|
||||
IgnoreFirstChanceAccessViolation,
|
||||
|
||||
// Gdb
|
||||
LoadGdbInit,
|
||||
LoadGdbDumpers,
|
||||
GdbStartupCommands,
|
||||
GdbPostAttachCommands,
|
||||
GdbWatchdogTimeout,
|
||||
AutoEnrichParameters,
|
||||
UseDynamicType,
|
||||
TargetAsync,
|
||||
WarnOnReleaseBuilds,
|
||||
MultiInferior,
|
||||
IntelFlavor,
|
||||
UsePseudoTracepoints,
|
||||
|
||||
// Stack
|
||||
MaximalStackDepth,
|
||||
ExpandStack,
|
||||
CreateFullBacktrace,
|
||||
|
||||
// Watchers & Locals
|
||||
ShowStdNamespace,
|
||||
ShowQtNamespace,
|
||||
ShowQObjectNames,
|
||||
SortStructMembers,
|
||||
AutoDerefPointers,
|
||||
MaximalStringLength,
|
||||
DisplayStringLimit,
|
||||
|
||||
// Running
|
||||
SkipKnownFrames,
|
||||
EnableReverseDebugging,
|
||||
|
||||
// Breakpoints
|
||||
SynchronizeBreakpoints,
|
||||
AllPluginBreakpoints,
|
||||
SelectedPluginBreakpoints,
|
||||
AdjustBreakpointLocations,
|
||||
NoPluginBreakpoints,
|
||||
SelectedPluginBreakpointsPattern,
|
||||
BreakOnThrow,
|
||||
BreakOnCatch,
|
||||
BreakOnWarning,
|
||||
BreakOnFatal,
|
||||
BreakOnAbort,
|
||||
|
||||
// QML Tools
|
||||
ShowQmlObjectTree,
|
||||
ShowAppOnTop
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
@@ -37,10 +37,7 @@ class QMenu;
|
||||
class QAction;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils {
|
||||
class BaseTreeView;
|
||||
class SavedAction;
|
||||
}
|
||||
namespace Utils { class BaseTreeView; }
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
@@ -60,12 +57,6 @@ GlobalDebuggerOptions *globalDebuggerOptions();
|
||||
|
||||
bool isTestRun();
|
||||
|
||||
Utils::SavedAction *action(int code);
|
||||
|
||||
bool boolSetting(int code);
|
||||
QString stringSetting(int code);
|
||||
QStringList stringListSetting(int code);
|
||||
|
||||
QAction *addAction(QMenu *menu, const QString &display, bool on,
|
||||
const std::function<void()> &onTriggered = {});
|
||||
QAction *addAction(QMenu *menu, const QString &d1, const QString &d2, bool on,
|
||||
|
@@ -78,7 +78,6 @@
|
||||
#include <utils/processhandle.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/savedaction.h>
|
||||
#include <utils/styledbar.h>
|
||||
#include <utils/utilsicons.h>
|
||||
|
||||
@@ -286,7 +285,7 @@ public:
|
||||
m_logWindow = new LogWindow(m_engine); // Needed before start()
|
||||
m_logWindow->setObjectName("Debugger.Dock.Output");
|
||||
|
||||
connect(action(EnableReverseDebugging), &SavedAction::valueChanged, this, [this] {
|
||||
connect(&debuggerSettings()->enableReverseDebugging, &BaseAspect::changed, this, [this] {
|
||||
updateState();
|
||||
if (m_companionEngine)
|
||||
m_companionEngine->d->updateState();
|
||||
@@ -427,7 +426,7 @@ public:
|
||||
m_watchHandler.cleanup();
|
||||
m_engine->showMessage(tr("Debugger finished."), StatusBar);
|
||||
m_engine->setState(DebuggerFinished); // Also destroys views.
|
||||
if (boolSetting(SwitchModeOnExit))
|
||||
if (debuggerSettings()->switchModeOnExit.value())
|
||||
EngineManager::deactivateDebugMode();
|
||||
}
|
||||
|
||||
@@ -831,7 +830,7 @@ void DebuggerEnginePrivate::setupViews()
|
||||
|
||||
connect(TextEditorSettings::instance(), &TextEditorSettings::fontSettingsChanged,
|
||||
this, [this](const FontSettings &settings) {
|
||||
if (!boolSetting(FontSizeFollowsEditor))
|
||||
if (!debuggerSettings()->fontSizeFollowsEditor.value())
|
||||
return;
|
||||
const qreal size = settings.fontZoom() * settings.fontSize() / 100.;
|
||||
QFont font = m_breakWindow->font();
|
||||
@@ -1102,7 +1101,7 @@ void DebuggerEngine::gotoLocation(const Location &loc)
|
||||
&newEditor);
|
||||
QTC_ASSERT(editor, return); // Unreadable file?
|
||||
|
||||
editor->gotoLine(line, 0, !boolSetting(StationaryEditorWhileStepping));
|
||||
editor->gotoLine(line, 0, !debuggerSettings()->stationaryEditorWhileStepping.value());
|
||||
|
||||
if (newEditor)
|
||||
editor->document()->setProperty(Constants::OPENED_BY_DEBUGGER, true);
|
||||
@@ -1364,7 +1363,7 @@ void DebuggerEngine::notifyInferiorSpontaneousStop()
|
||||
d->m_perspective->select();
|
||||
showMessage(tr("Stopped."), StatusBar);
|
||||
setState(InferiorStopOk);
|
||||
if (boolSetting(RaiseOnInterrupt))
|
||||
if (debuggerSettings()->raiseOnInterrupt.value())
|
||||
ICore::raiseWindow(DebuggerMainWindow::instance());
|
||||
}
|
||||
|
||||
@@ -1422,8 +1421,8 @@ void DebuggerEnginePrivate::setInitialActionStates()
|
||||
m_jumpToLineAction.setVisible(false);
|
||||
m_stepOverAction.setEnabled(true);
|
||||
|
||||
action(AutoDerefPointers)->setEnabled(true);
|
||||
action(ExpandStack)->setEnabled(false);
|
||||
debuggerSettings()->autoDerefPointers.setEnabled(true);
|
||||
debuggerSettings()->expandStack.setEnabled(false);
|
||||
|
||||
m_threadLabel->setEnabled(false);
|
||||
}
|
||||
@@ -1561,9 +1560,9 @@ void DebuggerEnginePrivate::updateState()
|
||||
|
||||
const bool actionsEnabled = m_engine->debuggerActionsEnabled();
|
||||
const bool canDeref = actionsEnabled && m_engine->hasCapability(AutoDerefPointersCapability);
|
||||
action(AutoDerefPointers)->setEnabled(canDeref);
|
||||
action(AutoDerefPointers)->setEnabled(true);
|
||||
action(ExpandStack)->setEnabled(actionsEnabled);
|
||||
debuggerSettings()->autoDerefPointers.setEnabled(canDeref);
|
||||
debuggerSettings()->autoDerefPointers.setEnabled(true);
|
||||
debuggerSettings()->expandStack.setEnabled(actionsEnabled);
|
||||
|
||||
const bool notbusy = state == InferiorStopOk
|
||||
|| state == DebuggerNotReady
|
||||
@@ -1575,7 +1574,7 @@ void DebuggerEnginePrivate::updateState()
|
||||
void DebuggerEnginePrivate::updateReverseActions()
|
||||
{
|
||||
const bool stopped = m_state == InferiorStopOk;
|
||||
const bool reverseEnabled = boolSetting(EnableReverseDebugging);
|
||||
const bool reverseEnabled = debuggerSettings()->enableReverseDebugging.value();
|
||||
const bool canReverse = reverseEnabled && m_engine->hasCapability(ReverseSteppingCapability);
|
||||
const bool doesRecord = m_recordForReverseOperationAction.isChecked();
|
||||
|
||||
@@ -1593,8 +1592,8 @@ void DebuggerEnginePrivate::updateReverseActions()
|
||||
|
||||
void DebuggerEnginePrivate::cleanupViews()
|
||||
{
|
||||
const bool closeSource = boolSetting(CloseSourceBuffersOnExit);
|
||||
const bool closeMemory = boolSetting(CloseMemoryBuffersOnExit);
|
||||
const bool closeSource = debuggerSettings()->closeSourceBuffersOnExit.value();
|
||||
const bool closeMemory = debuggerSettings()->closeMemoryBuffersOnExit.value();
|
||||
|
||||
QList<IDocument *> toClose;
|
||||
foreach (IDocument *document, DocumentModel::openedDocuments()) {
|
||||
@@ -1880,7 +1879,7 @@ QString DebuggerEngine::expand(const QString &string) const
|
||||
|
||||
QString DebuggerEngine::nativeStartupCommands() const
|
||||
{
|
||||
return expand(QStringList({stringSetting(GdbStartupCommands),
|
||||
return expand(QStringList({debuggerSettings()->gdbStartupCommands.value(),
|
||||
runParameters().additionalStartupCommands}).join('\n'));
|
||||
}
|
||||
|
||||
@@ -2718,7 +2717,8 @@ Context CppDebuggerEngine::languageContext() const
|
||||
|
||||
void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp)
|
||||
{
|
||||
const bool warnOnRelease = boolSetting(WarnOnReleaseBuilds) && rp.toolChainAbi.osFlavor() != Abi::AndroidLinuxFlavor;
|
||||
const bool warnOnRelease = debuggerSettings()->warnOnReleaseBuilds.value()
|
||||
&& rp.toolChainAbi.osFlavor() != Abi::AndroidLinuxFlavor;
|
||||
bool warnOnInappropriateDebugger = false;
|
||||
QString detailedWarning;
|
||||
switch (rp.toolChainAbi.binaryFormat()) {
|
||||
|
@@ -74,6 +74,8 @@ const char OPENED_BY_DEBUGGER[] = "OpenedByDebugger";
|
||||
const char OPENED_WITH_DISASSEMBLY[] = "DisassemblerView";
|
||||
const char DISASSEMBLER_SOURCE_FILE[] = "DisassemblerSourceFile";
|
||||
|
||||
const char CRT_DEBUG_REPORT[] = "CrtDbgReport";
|
||||
|
||||
} // namespace Constants
|
||||
|
||||
enum ModelRoles
|
||||
|
@@ -116,7 +116,6 @@
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/proxyaction.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/savedaction.h>
|
||||
#include <utils/statuslabel.h>
|
||||
#include <utils/styledbar.h>
|
||||
#include <utils/temporarydirectory.h>
|
||||
@@ -657,7 +656,6 @@ public:
|
||||
void parseCommandLineArguments();
|
||||
|
||||
void updatePresetState();
|
||||
SavedAction *action(int code);
|
||||
QWidget *addSearch(BaseTreeView *treeView);
|
||||
|
||||
public:
|
||||
@@ -796,7 +794,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
|
||||
const auto addFontSizeAdaptation = [this](QWidget *widget) {
|
||||
QObject::connect(TextEditorSettings::instance(), &TextEditorSettings::fontSettingsChanged,
|
||||
[widget](const FontSettings &settings) {
|
||||
if (!boolSetting(FontSizeFollowsEditor))
|
||||
if (!debuggerSettings()->fontSizeFollowsEditor.value())
|
||||
return;
|
||||
qreal size = settings.fontZoom() * settings.fontSize() / 100.;
|
||||
QFont font = widget->font();
|
||||
@@ -1173,7 +1171,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
|
||||
this, &DebuggerPluginPrivate::updateBreakMenuItem);
|
||||
|
||||
// Application interaction
|
||||
connect(action(SettingsDialog)->action(), &QAction::triggered,
|
||||
connect(debuggerSettings()->settingsDialog.action(), &QAction::triggered,
|
||||
[] { ICore::showOptionsDialog(DEBUGGER_COMMON_SETTINGS_ID); });
|
||||
|
||||
m_perspective.useSubPerspectiveSwitcher(EngineManager::engineChooser());
|
||||
@@ -1478,9 +1476,10 @@ void DebuggerPluginPrivate::updatePresetState()
|
||||
// FIXME: Decentralize the actions below
|
||||
const bool actionsEnabled = currentEngine->debuggerActionsEnabled();
|
||||
const bool canDeref = actionsEnabled && currentEngine->hasCapability(AutoDerefPointersCapability);
|
||||
action(AutoDerefPointers)->setEnabled(canDeref);
|
||||
action(AutoDerefPointers)->setEnabled(true);
|
||||
action(ExpandStack)->setEnabled(actionsEnabled);
|
||||
DebuggerSettings *s = debuggerSettings();
|
||||
s->autoDerefPointers.setEnabled(canDeref);
|
||||
s->autoDerefPointers.setEnabled(true);
|
||||
s->expandStack.setEnabled(actionsEnabled);
|
||||
|
||||
m_startAndDebugApplicationAction.setEnabled(true);
|
||||
m_attachToQmlPortAction.setEnabled(true);
|
||||
@@ -1924,8 +1923,8 @@ void DebuggerPluginPrivate::setInitialState()
|
||||
m_breakAction.setEnabled(false);
|
||||
//m_snapshotAction.setEnabled(false);
|
||||
|
||||
action(AutoDerefPointers)->setEnabled(true);
|
||||
action(ExpandStack)->setEnabled(false);
|
||||
debuggerSettings()->autoDerefPointers.setEnabled(true);
|
||||
debuggerSettings()->expandStack.setEnabled(false);
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::updateDebugWithoutDeployMenu()
|
||||
@@ -2016,17 +2015,14 @@ void DebuggerPluginPrivate::extensionsInitialized()
|
||||
DebuggerMainWindow::ensureMainWindowExists();
|
||||
}
|
||||
|
||||
SavedAction *DebuggerPluginPrivate::action(int code)
|
||||
{
|
||||
return m_debuggerSettings.item(code);
|
||||
}
|
||||
|
||||
QWidget *DebuggerPluginPrivate::addSearch(BaseTreeView *treeView)
|
||||
{
|
||||
QAction *act = action(UseAlternatingRowColors)->action();
|
||||
treeView->setAlternatingRowColors(act->isChecked());
|
||||
BoolAspect &act = debuggerSettings()->useAlternatingRowColors;
|
||||
treeView->setAlternatingRowColors(act.value());
|
||||
treeView->setProperty(PerspectiveState::savesHeaderKey(), true);
|
||||
connect(act, &QAction::toggled, treeView, &BaseTreeView::setAlternatingRowColors);
|
||||
connect(&act, &BaseAspect::changed, treeView, [treeView] {
|
||||
treeView->setAlternatingRowColors(debuggerSettings()->useAlternatingRowColors.value());
|
||||
});
|
||||
|
||||
return ItemViewFind::createSearchableWrapper(treeView);
|
||||
}
|
||||
@@ -2036,31 +2032,11 @@ Console *debuggerConsole()
|
||||
return &dd->m_console;
|
||||
}
|
||||
|
||||
SavedAction *action(int code)
|
||||
{
|
||||
return dd->action(code);
|
||||
}
|
||||
|
||||
QWidget *addSearch(BaseTreeView *treeView)
|
||||
{
|
||||
return dd->addSearch(treeView);
|
||||
}
|
||||
|
||||
bool boolSetting(int code)
|
||||
{
|
||||
return action(code)->value().toBool();
|
||||
}
|
||||
|
||||
QString stringSetting(int code)
|
||||
{
|
||||
return action(code)->value().toString();
|
||||
}
|
||||
|
||||
QStringList stringListSetting(int code)
|
||||
{
|
||||
return action(code)->value().toStringList();
|
||||
}
|
||||
|
||||
void openTextEditor(const QString &titlePattern0, const QString &contents)
|
||||
{
|
||||
if (dd->m_shuttingDown)
|
||||
|
@@ -391,7 +391,7 @@ void DebuggerRunTool::setUseTerminal(bool on)
|
||||
bool useCdbConsole = m_runParameters.cppEngineType == CdbEngineType
|
||||
&& (m_runParameters.startMode == StartInternal
|
||||
|| m_runParameters.startMode == StartExternal)
|
||||
&& boolSetting(UseCdbConsole);
|
||||
&& debuggerSettings()->useCdbConsole.value();
|
||||
|
||||
if (on && !d->terminalRunner && !useCdbConsole) {
|
||||
d->terminalRunner = new TerminalRunner(runControl(), m_runParameters.inferior);
|
||||
@@ -856,7 +856,7 @@ bool DebuggerRunTool::fixupParameters()
|
||||
}
|
||||
}
|
||||
|
||||
if (!boolSetting(AutoEnrichParameters)) {
|
||||
if (!debuggerSettings()->autoEnrichParameters.value()) {
|
||||
const QString sysroot = rp.sysRoot.toString();
|
||||
if (rp.debugInfoLocation.isEmpty())
|
||||
rp.debugInfoLocation = sysroot + "/usr/lib/debug";
|
||||
|
@@ -1188,7 +1188,7 @@ void DebuggerToolTipManagerPrivate::slotTooltipOverrideRequested
|
||||
QTC_ASSERT(handled, return);
|
||||
QTC_ASSERT(editorWidget, return);
|
||||
|
||||
if (!boolSetting(UseToolTipsInMainEditor))
|
||||
if (!debuggerSettings()->useToolTipsInMainEditor.value())
|
||||
return;
|
||||
|
||||
const TextDocument *document = editorWidget->textDocument();
|
||||
|
@@ -42,9 +42,9 @@
|
||||
#include <texteditor/textdocument.h>
|
||||
#include <texteditor/texteditor.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/mimetypes/mimedatabase.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/savedaction.h>
|
||||
|
||||
#include <QTextBlock>
|
||||
#include <QDir>
|
||||
@@ -181,7 +181,7 @@ int DisassemblerAgentPrivate::lineForAddress(quint64 address) const
|
||||
DisassemblerAgent::DisassemblerAgent(DebuggerEngine *engine)
|
||||
: d(new DisassemblerAgentPrivate(engine))
|
||||
{
|
||||
connect(action(IntelFlavor), &Utils::SavedAction::valueChanged,
|
||||
connect(&debuggerSettings()->intelFlavor, &Utils::BaseAspect::changed,
|
||||
this, &DisassemblerAgent::reload);
|
||||
}
|
||||
|
||||
|
@@ -63,7 +63,6 @@
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/savedaction.h>
|
||||
#include <utils/stringutils.h>
|
||||
#include <utils/synchronousprocess.h>
|
||||
#include <utils/temporaryfile.h>
|
||||
@@ -158,13 +157,14 @@ GdbEngine::GdbEngine()
|
||||
connect(&m_commandTimer, &QTimer::timeout,
|
||||
this, &GdbEngine::commandTimeout);
|
||||
|
||||
connect(action(AutoDerefPointers), &SavedAction::valueChanged,
|
||||
DebuggerSettings &s = *debuggerSettings();
|
||||
connect(&s.autoDerefPointers, &BaseAspect::changed,
|
||||
this, &GdbEngine::reloadLocals);
|
||||
connect(action(CreateFullBacktrace)->action(), &QAction::triggered,
|
||||
connect(s.createFullBacktrace.action(), &QAction::triggered,
|
||||
this, &GdbEngine::createFullBacktrace);
|
||||
connect(action(UseDebuggingHelpers), &SavedAction::valueChanged,
|
||||
connect(&s.useDebuggingHelpers, &BaseAspect::changed,
|
||||
this, &GdbEngine::reloadLocals);
|
||||
connect(action(UseDynamicType), &SavedAction::valueChanged,
|
||||
connect(&s.useDynamicType, &BaseAspect::changed,
|
||||
this, &GdbEngine::reloadLocals);
|
||||
|
||||
connect(&m_gdbProc, &QProcess::errorOccurred,
|
||||
@@ -804,7 +804,7 @@ void GdbEngine::runCommand(const DebuggerCommand &command)
|
||||
|
||||
int GdbEngine::commandTimeoutTime() const
|
||||
{
|
||||
int time = action(GdbWatchdogTimeout)->value().toInt();
|
||||
const int time = debuggerSettings()->gdbWatchdogTimeout.value();
|
||||
return 1000 * qMax(20, time);
|
||||
}
|
||||
|
||||
@@ -946,7 +946,7 @@ void GdbEngine::handleResultRecord(DebuggerResponse *response)
|
||||
|
||||
DebuggerCommand cmd = m_commandForToken.take(token);
|
||||
const int flags = m_flagsForToken.take(token);
|
||||
if (boolSetting(LogTimeStamps)) {
|
||||
if (debuggerSettings()->logTimeStamps.value()) {
|
||||
showMessage(QString("Response time: %1: %2 s")
|
||||
.arg(cmd.function)
|
||||
.arg(QTime::fromMSecsSinceStartOfDay(cmd.postTime).msecsTo(QTime::currentTime()) / 1000.),
|
||||
@@ -1020,7 +1020,7 @@ void GdbEngine::updateAll()
|
||||
{
|
||||
//PENDING_DEBUG("UPDATING ALL\n");
|
||||
QTC_CHECK(state() == InferiorUnrunnable || state() == InferiorStopOk);
|
||||
DebuggerCommand cmd(stackCommand(action(MaximalStackDepth)->value().toInt()));
|
||||
DebuggerCommand cmd(stackCommand(debuggerSettings()->maximalStackDepth.value()));
|
||||
cmd.callback = [this](const DebuggerResponse &r) { handleStackListFrames(r, false); };
|
||||
runCommand(cmd);
|
||||
stackHandler()->setCurrentIndex(0);
|
||||
@@ -1293,7 +1293,7 @@ void GdbEngine::handleStop1(const GdbMi &data)
|
||||
|
||||
// Jump over well-known frames.
|
||||
static int stepCounter = 0;
|
||||
if (boolSetting(SkipKnownFrames)) {
|
||||
if (debuggerSettings()->skipKnownFrames.value()) {
|
||||
if (reason == "end-stepping-range" || reason == "function-finished") {
|
||||
//showMessage(frame.toString());
|
||||
QString funcName = frame["function"].data();
|
||||
@@ -1330,7 +1330,7 @@ void GdbEngine::handleStop1(const GdbMi &data)
|
||||
|
||||
if (!m_systemDumpersLoaded) {
|
||||
m_systemDumpersLoaded = true;
|
||||
if (m_gdbVersion >= 70400 && boolSetting(LoadGdbDumpers))
|
||||
if (m_gdbVersion >= 70400 && debuggerSettings()->loadGdbDumpers.value())
|
||||
runCommand({"importPlainDumpers on"});
|
||||
else
|
||||
runCommand({"importPlainDumpers off"});
|
||||
@@ -1443,7 +1443,7 @@ void GdbEngine::handleStop2(const GdbMi &data)
|
||||
showMessage("SIGNAL 0 CONSIDERED BOGUS.");
|
||||
} else {
|
||||
showMessage("HANDLING SIGNAL " + name);
|
||||
if (boolSetting(UseMessageBoxForSignals) && !isStopperThread)
|
||||
if (debuggerSettings()->useMessageBoxForSignals.value() && !isStopperThread)
|
||||
if (!showStoppedBySignalMessageBox(meaning, name)) {
|
||||
showMessage("SIGNAL RECEIVED WHILE SHOWING SIGNAL MESSAGE");
|
||||
return;
|
||||
@@ -1602,7 +1602,7 @@ QString GdbEngine::cleanupFullName(const QString &fileName)
|
||||
cleanFilePath = QDir::cleanPath(fi.absoluteFilePath());
|
||||
}
|
||||
|
||||
if (!boolSetting(AutoEnrichParameters))
|
||||
if (!debuggerSettings()->autoEnrichParameters.value())
|
||||
return cleanFilePath;
|
||||
|
||||
const QString sysroot = runParameters().sysRoot.toString();
|
||||
@@ -2057,7 +2057,7 @@ void GdbEngine::setTokenBarrier()
|
||||
QTC_ASSERT(good, return);
|
||||
PENDING_DEBUG("\n--- token barrier ---\n");
|
||||
showMessage("--- token barrier ---", LogMiscInput);
|
||||
if (boolSetting(LogTimeStamps))
|
||||
if (debuggerSettings()->logTimeStamps.value())
|
||||
showMessage(LogWindow::logTimeStamp(), LogMiscInput);
|
||||
m_oldestAcceptableToken = currentToken();
|
||||
m_stackNeeded = false;
|
||||
@@ -2179,7 +2179,7 @@ void GdbEngine::handleCatchInsert(const DebuggerResponse &response, const Breakp
|
||||
void GdbEngine::handleBkpt(const GdbMi &bkpt, const Breakpoint &bp)
|
||||
{
|
||||
QTC_ASSERT(bp, return);
|
||||
bool usePseudoTracepoints = boolSetting(UsePseudoTracepoints);
|
||||
const bool usePseudoTracepoints = debuggerSettings()->usePseudoTracepoints.value();
|
||||
const QString nr = bkpt["number"].data();
|
||||
if (nr.contains('.')) {
|
||||
// A sub-breakpoint.
|
||||
@@ -2594,7 +2594,7 @@ void GdbEngine::insertBreakpoint(const Breakpoint &bp)
|
||||
int spec = requested.threadSpec;
|
||||
if (requested.isTracepoint()) {
|
||||
|
||||
if (boolSetting(UsePseudoTracepoints)) {
|
||||
if (debuggerSettings()->usePseudoTracepoints.value()) {
|
||||
cmd.function = "createTracepoint";
|
||||
|
||||
if (requested.oneShot)
|
||||
@@ -2629,14 +2629,15 @@ void GdbEngine::insertBreakpoint(const Breakpoint &bp)
|
||||
|
||||
// for dumping of expressions
|
||||
const static bool alwaysVerbose = qEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE");
|
||||
const DebuggerSettings &s = *debuggerSettings();
|
||||
cmd.arg("passexceptions", alwaysVerbose);
|
||||
cmd.arg("fancy", boolSetting(UseDebuggingHelpers));
|
||||
cmd.arg("autoderef", boolSetting(AutoDerefPointers));
|
||||
cmd.arg("dyntype", boolSetting(UseDynamicType));
|
||||
cmd.arg("qobjectnames", boolSetting(ShowQObjectNames));
|
||||
cmd.arg("fancy", s.useDebuggingHelpers.value());
|
||||
cmd.arg("autoderef", s.autoDerefPointers.value());
|
||||
cmd.arg("dyntype", s.useDynamicType.value());
|
||||
cmd.arg("qobjectnames", s.showQObjectNames.value());
|
||||
cmd.arg("nativemixed", isNativeMixedActive());
|
||||
cmd.arg("stringcutoff", action(MaximalStringLength)->value().toString());
|
||||
cmd.arg("displaystringlimit", action(DisplayStringLimit)->value().toString());
|
||||
cmd.arg("stringcutoff", s.maximalStringLength.value());
|
||||
cmd.arg("displaystringlimit", s.displayStringLimit.value());
|
||||
|
||||
cmd.arg("spec", breakpointLocation2(requested));
|
||||
cmd.callback = [this, bp](const DebuggerResponse &r) { handleTracepointInsert(r, bp); };
|
||||
@@ -3132,7 +3133,7 @@ DebuggerCommand GdbEngine::stackCommand(int depth)
|
||||
void GdbEngine::reloadStack()
|
||||
{
|
||||
PENDING_DEBUG("RELOAD STACK");
|
||||
DebuggerCommand cmd = stackCommand(action(MaximalStackDepth)->value().toInt());
|
||||
DebuggerCommand cmd = stackCommand(debuggerSettings()->maximalStackDepth.value());
|
||||
cmd.callback = [this](const DebuggerResponse &r) { handleStackListFrames(r, false); };
|
||||
cmd.flags = Discardable;
|
||||
runCommand(cmd);
|
||||
@@ -3196,8 +3197,8 @@ void GdbEngine::handleThreadInfo(const DebuggerResponse &response)
|
||||
ThreadsHandler *handler = threadsHandler();
|
||||
handler->setThreads(response.data);
|
||||
updateState(); // Adjust Threads combobox.
|
||||
if (boolSetting(ShowThreadNames)) {
|
||||
runCommand({"threadnames " + action(MaximalStackDepth)->value().toString(),
|
||||
if (debuggerSettings()->showThreadNames.value()) {
|
||||
runCommand({QString("threadnames %1").arg(debuggerSettings()->maximalStackDepth.value()),
|
||||
Discardable, CB(handleThreadNames)});
|
||||
}
|
||||
reloadStack(); // Will trigger register reload.
|
||||
@@ -3665,7 +3666,7 @@ public:
|
||||
|
||||
void GdbEngine::fetchDisassembler(DisassemblerAgent *agent)
|
||||
{
|
||||
if (boolSetting(IntelFlavor))
|
||||
if (debuggerSettings()->intelFlavor.value())
|
||||
runCommand({"set disassembly-flavor intel"});
|
||||
else
|
||||
runCommand({"set disassembly-flavor att"});
|
||||
@@ -3850,7 +3851,7 @@ void GdbEngine::setupEngine()
|
||||
}
|
||||
|
||||
gdbCommand.addArgs({"-i", "mi"});
|
||||
if (!boolSetting(LoadGdbInit))
|
||||
if (!debuggerSettings()->loadGdbInit.value())
|
||||
gdbCommand.addArg("-n");
|
||||
|
||||
Environment gdbEnv = rp.debugger.environment;
|
||||
@@ -3977,7 +3978,7 @@ void GdbEngine::setupEngine()
|
||||
//if (!ba.isEmpty())
|
||||
// runCommand("set solib-search-path " + ba);
|
||||
|
||||
if (boolSetting(MultiInferior) || runParameters().multiProcess) {
|
||||
if (debuggerSettings()->multiInferior.value() || runParameters().multiProcess) {
|
||||
//runCommand("set follow-exec-mode new");
|
||||
runCommand({"set detach-on-fork off"});
|
||||
}
|
||||
@@ -3998,14 +3999,14 @@ void GdbEngine::setupEngine()
|
||||
runCommand({"python sys.path.append('" + uninstalledData + "')"});
|
||||
runCommand({"python from gdbbridge import *"});
|
||||
|
||||
const QString path = stringSetting(ExtraDumperFile);
|
||||
const QString path = debuggerSettings()->extraDumperFile.value();
|
||||
if (!path.isEmpty() && QFileInfo(path).isReadable()) {
|
||||
DebuggerCommand cmd("addDumperModule");
|
||||
cmd.arg("path", path);
|
||||
runCommand(cmd);
|
||||
}
|
||||
|
||||
const QString commands = stringSetting(ExtraDumperCommands);
|
||||
const QString commands = debuggerSettings()->extraDumperCommands.value();
|
||||
if (!commands.isEmpty())
|
||||
runCommand({commands});
|
||||
|
||||
@@ -4213,7 +4214,7 @@ bool GdbEngine::usesExecInterrupt() const
|
||||
|
||||
bool GdbEngine::usesTargetAsync() const
|
||||
{
|
||||
return runParameters().useTargetAsync || boolSetting(TargetAsync);
|
||||
return runParameters().useTargetAsync || debuggerSettings()->targetAsync.value();
|
||||
}
|
||||
|
||||
void GdbEngine::scheduleTestResponse(int testCase, const QString &response)
|
||||
@@ -4322,9 +4323,10 @@ void GdbEngine::claimInitialBreakpoints()
|
||||
showMessage(tr("Setting breakpoints..."));
|
||||
BreakpointManager::claimBreakpointsForEngine(this);
|
||||
|
||||
const bool onAbort = boolSetting(BreakOnAbort);
|
||||
const bool onWarning = boolSetting(BreakOnWarning);
|
||||
const bool onFatal = boolSetting(BreakOnFatal);
|
||||
const DebuggerSettings &s = *debuggerSettings();
|
||||
const bool onAbort = s.breakOnAbort.value();
|
||||
const bool onWarning = s.breakOnWarning.value();
|
||||
const bool onFatal = s.breakOnFatal.value();
|
||||
if (onAbort || onWarning || onFatal) {
|
||||
DebuggerCommand cmd("createSpecialBreakpoints");
|
||||
cmd.arg("breakonabort", onAbort);
|
||||
@@ -4782,7 +4784,7 @@ void GdbEngine::handleTargetRemote(const DebuggerResponse &response)
|
||||
// gdb server will stop the remote application itself.
|
||||
showMessage("INFERIOR STARTED");
|
||||
showMessage(msgAttachedToStoppedInferior(), StatusBar);
|
||||
QString commands = expand(stringSetting(GdbPostAttachCommands));
|
||||
QString commands = expand(debuggerSettings()->gdbPostAttachCommands.value());
|
||||
if (!commands.isEmpty())
|
||||
runCommand({commands, NativeCommand});
|
||||
handleInferiorPrepared();
|
||||
@@ -4798,7 +4800,7 @@ void GdbEngine::handleTargetExtendedRemote(const DebuggerResponse &response)
|
||||
if (response.resultClass == ResultDone) {
|
||||
showMessage("ATTACHED TO GDB SERVER STARTED");
|
||||
showMessage(msgAttachedToStoppedInferior(), StatusBar);
|
||||
QString commands = expand(stringSetting(GdbPostAttachCommands));
|
||||
QString commands = expand(debuggerSettings()->gdbPostAttachCommands.value());
|
||||
if (!commands.isEmpty())
|
||||
runCommand({commands, NativeCommand});
|
||||
if (runParameters().attachPID.isValid()) { // attach to pid if valid
|
||||
@@ -5051,19 +5053,20 @@ void GdbEngine::doUpdateLocals(const UpdateParameters ¶ms)
|
||||
watchHandler()->appendWatchersAndTooltipRequests(&cmd);
|
||||
|
||||
const static bool alwaysVerbose = qEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE");
|
||||
const DebuggerSettings &s = *debuggerSettings();
|
||||
cmd.arg("passexceptions", alwaysVerbose);
|
||||
cmd.arg("fancy", boolSetting(UseDebuggingHelpers));
|
||||
cmd.arg("autoderef", boolSetting(AutoDerefPointers));
|
||||
cmd.arg("dyntype", boolSetting(UseDynamicType));
|
||||
cmd.arg("qobjectnames", boolSetting(ShowQObjectNames));
|
||||
cmd.arg("timestamps", boolSetting(LogTimeStamps));
|
||||
cmd.arg("fancy", s.useDebuggingHelpers.value());
|
||||
cmd.arg("autoderef", s.autoDerefPointers.value());
|
||||
cmd.arg("dyntype", s.useDynamicType.value());
|
||||
cmd.arg("qobjectnames", s.showQObjectNames.value());
|
||||
cmd.arg("timestamps", s.logTimeStamps.value());
|
||||
|
||||
StackFrame frame = stackHandler()->currentFrame();
|
||||
cmd.arg("context", frame.context);
|
||||
cmd.arg("nativemixed", isNativeMixedActive());
|
||||
|
||||
cmd.arg("stringcutoff", action(MaximalStringLength)->value().toString());
|
||||
cmd.arg("displaystringlimit", action(DisplayStringLimit)->value().toString());
|
||||
cmd.arg("stringcutoff", s.maximalStringLength.value());
|
||||
cmd.arg("displaystringlimit", s.displayStringLimit.value());
|
||||
|
||||
cmd.arg("resultvarname", m_resultVarName);
|
||||
cmd.arg("partialvar", params.partialVariable);
|
||||
|
@@ -23,7 +23,6 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <debugger/commonoptionspage.h>
|
||||
#include <debugger/debuggeractions.h>
|
||||
#include <debugger/debuggercore.h>
|
||||
#include <debugger/debuggerinternalconstants.h>
|
||||
@@ -32,21 +31,7 @@
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <utils/fancylineedit.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/savedaction.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
#include <QFormLayout>
|
||||
#include <QGroupBox>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QPointer>
|
||||
#include <QSpinBox>
|
||||
#include <QTextEdit>
|
||||
#include <utils/layoutbuilder.h>
|
||||
|
||||
using namespace Core;
|
||||
using namespace Utils;
|
||||
@@ -70,196 +55,42 @@ public:
|
||||
|
||||
class GdbOptionsPageWidget : public IOptionsPageWidget
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::GdbOptionsPage)
|
||||
|
||||
public:
|
||||
GdbOptionsPageWidget();
|
||||
|
||||
void apply() final { group.apply(ICore::settings()); }
|
||||
void apply() final { group.apply(); group.writeSettings(ICore::settings()); }
|
||||
void finish() final { group.finish(); }
|
||||
|
||||
SavedActionSet group;
|
||||
AspectContainer &group = debuggerSettings()->page2;
|
||||
};
|
||||
|
||||
GdbOptionsPageWidget::GdbOptionsPageWidget()
|
||||
{
|
||||
auto groupBoxGeneral = new QGroupBox(this);
|
||||
groupBoxGeneral->setTitle(GdbOptionsPage::tr("General"));
|
||||
using namespace Layouting;
|
||||
DebuggerSettings &s = *debuggerSettings();
|
||||
|
||||
auto labelGdbWatchdogTimeout = new QLabel(groupBoxGeneral);
|
||||
labelGdbWatchdogTimeout->setText(GdbOptionsPage::tr("GDB timeout:"));
|
||||
labelGdbWatchdogTimeout->setToolTip(GdbOptionsPage::tr(
|
||||
"The number of seconds before a non-responsive GDB process is terminated.\n"
|
||||
"The default value of 20 seconds should be sufficient for most\n"
|
||||
"applications, but there are situations when loading big libraries or\n"
|
||||
"listing source files takes much longer than that on slow machines.\n"
|
||||
"In this case, the value should be increased."));
|
||||
Group general {
|
||||
Title { tr("General") },
|
||||
Row { s.gdbWatchdogTimeout, Stretch() },
|
||||
s.skipKnownFrames,
|
||||
s.useMessageBoxForSignals,
|
||||
s.adjustBreakpointLocations,
|
||||
s.useDynamicType,
|
||||
s.loadGdbInit,
|
||||
s.loadGdbDumpers,
|
||||
s.intelFlavor,
|
||||
s.usePseudoTracepoints,
|
||||
Stretch()
|
||||
};
|
||||
|
||||
auto spinBoxGdbWatchdogTimeout = new QSpinBox(groupBoxGeneral);
|
||||
spinBoxGdbWatchdogTimeout->setToolTip(labelGdbWatchdogTimeout->toolTip());
|
||||
spinBoxGdbWatchdogTimeout->setSuffix(GdbOptionsPage::tr("sec"));
|
||||
spinBoxGdbWatchdogTimeout->setLayoutDirection(Qt::LeftToRight);
|
||||
spinBoxGdbWatchdogTimeout->setMinimum(20);
|
||||
spinBoxGdbWatchdogTimeout->setMaximum(1000000);
|
||||
spinBoxGdbWatchdogTimeout->setSingleStep(20);
|
||||
spinBoxGdbWatchdogTimeout->setValue(20);
|
||||
Column commands {
|
||||
Group { Title { tr("Additional Startup Commands") }, s.gdbStartupCommands },
|
||||
Group { Title { tr("Additional Attach Commands") }, s.gdbPostAttachCommands }
|
||||
};
|
||||
|
||||
auto checkBoxSkipKnownFrames = new QCheckBox(groupBoxGeneral);
|
||||
checkBoxSkipKnownFrames->setText(GdbOptionsPage::tr("Skip known frames when stepping"));
|
||||
checkBoxSkipKnownFrames->setToolTip(GdbOptionsPage::tr(
|
||||
"<html><head/><body><p>"
|
||||
"Allows <i>Step Into</i> to compress several steps into one step\n"
|
||||
"for less noisy debugging. For example, the atomic reference\n"
|
||||
"counting code is skipped, and a single <i>Step Into</i> for a signal\n"
|
||||
"emission ends up directly in the slot connected to it."));
|
||||
|
||||
auto checkBoxUseMessageBoxForSignals = new QCheckBox(groupBoxGeneral);
|
||||
checkBoxUseMessageBoxForSignals->setText(GdbOptionsPage::tr(
|
||||
"Show a message box when receiving a signal"));
|
||||
checkBoxUseMessageBoxForSignals->setToolTip(GdbOptionsPage::tr(
|
||||
"Displays a message box as soon as your application\n"
|
||||
"receives a signal like SIGSEGV during debugging."));
|
||||
|
||||
auto checkBoxAdjustBreakpointLocations = new QCheckBox(groupBoxGeneral);
|
||||
checkBoxAdjustBreakpointLocations->setText(GdbOptionsPage::tr(
|
||||
"Adjust breakpoint locations"));
|
||||
checkBoxAdjustBreakpointLocations->setToolTip(GdbOptionsPage::tr(
|
||||
"GDB allows setting breakpoints on source lines for which no code \n"
|
||||
"was generated. In such situations the breakpoint is shifted to the\n"
|
||||
"next source code line for which code was actually generated.\n"
|
||||
"This option reflects such temporary change by moving the breakpoint\n"
|
||||
"markers in the source code editor."));
|
||||
|
||||
auto checkBoxUseDynamicType = new QCheckBox(groupBoxGeneral);
|
||||
checkBoxUseDynamicType->setText(GdbOptionsPage::tr(
|
||||
"Use dynamic object type for display"));
|
||||
checkBoxUseDynamicType->setToolTip(GdbOptionsPage::tr(
|
||||
"Specifies whether the dynamic or the static type of objects will be "
|
||||
"displayed. Choosing the dynamic type might be slower."));
|
||||
|
||||
auto checkBoxLoadGdbInit = new QCheckBox(groupBoxGeneral);
|
||||
checkBoxLoadGdbInit->setText(GdbOptionsPage::tr("Load .gdbinit file on startup"));
|
||||
checkBoxLoadGdbInit->setToolTip(GdbOptionsPage::tr(
|
||||
"Allows or inhibits reading the user's default\n"
|
||||
".gdbinit file on debugger startup."));
|
||||
|
||||
auto checkBoxLoadGdbDumpers = new QCheckBox(groupBoxGeneral);
|
||||
checkBoxLoadGdbDumpers->setText(GdbOptionsPage::tr("Load system GDB pretty printers"));
|
||||
checkBoxLoadGdbDumpers->setToolTip(GdbOptionsPage::tr(
|
||||
"Uses the default GDB pretty printers installed in your "
|
||||
"system or linked to the libraries your application uses."));
|
||||
|
||||
auto checkBoxIntelFlavor = new QCheckBox(groupBoxGeneral);
|
||||
checkBoxIntelFlavor->setText(GdbOptionsPage::tr("Use Intel style disassembly"));
|
||||
checkBoxIntelFlavor->setToolTip(GdbOptionsPage::tr(
|
||||
"<html><head/><body>GDB shows by default AT&&T style disassembly."
|
||||
"</body></html>"));
|
||||
|
||||
auto checkBoxUsePseudoTracepoints = new QCheckBox(groupBoxGeneral);
|
||||
checkBoxUsePseudoTracepoints->setText(GdbOptionsPage::tr("Use pseudo message tracepoints"));
|
||||
checkBoxUsePseudoTracepoints->setToolTip(GdbOptionsPage::tr(
|
||||
"Uses python to extend the ordinary GDB breakpoint class."));
|
||||
|
||||
QString howToUsePython = GdbOptionsPage::tr(
|
||||
"<p>To execute simple Python commands, prefix them with \"python\".</p>"
|
||||
"<p>To execute sequences of Python commands spanning multiple lines "
|
||||
"prepend the block with \"python\" on a separate line, and append "
|
||||
"\"end\" on a separate line.</p>"
|
||||
"<p>To execute arbitrary Python scripts, "
|
||||
"use <i>python execfile('/path/to/script.py')</i>.</p>");
|
||||
|
||||
auto groupBoxStartupCommands = new QGroupBox(this);
|
||||
groupBoxStartupCommands->setTitle(GdbOptionsPage::tr("Additional Startup Commands"));
|
||||
groupBoxStartupCommands->setToolTip(GdbOptionsPage::tr(
|
||||
"<html><head/><body><p>GDB commands entered here will be executed after "
|
||||
"GDB has been started, but before the debugged program is started or "
|
||||
"attached, and before the debugging helpers are initialized.</p>%1"
|
||||
"</body></html>").arg(howToUsePython));
|
||||
|
||||
auto textEditStartupCommands = new QTextEdit(groupBoxStartupCommands);
|
||||
textEditStartupCommands->setAcceptRichText(false);
|
||||
textEditStartupCommands->setToolTip(groupBoxStartupCommands->toolTip());
|
||||
|
||||
auto groupBoxPostAttachCommands = new QGroupBox(this);
|
||||
groupBoxPostAttachCommands->setTitle(GdbOptionsPage::tr("Additional Attach Commands"));
|
||||
groupBoxPostAttachCommands->setToolTip(GdbOptionsPage::tr(
|
||||
"<html><head/><body><p>GDB commands entered here will be executed after "
|
||||
"GDB has successfully attached to remote targets.</p>"
|
||||
"<p>You can add commands to further set up the target here, "
|
||||
"such as \"monitor reset\" or \"load\"."
|
||||
"</body></html>"));
|
||||
|
||||
auto textEditPostAttachCommands = new QTextEdit(groupBoxPostAttachCommands);
|
||||
textEditPostAttachCommands->setAcceptRichText(false);
|
||||
textEditPostAttachCommands->setToolTip(groupBoxPostAttachCommands->toolTip());
|
||||
|
||||
/*
|
||||
groupBoxPluginDebugging = new QGroupBox(q);
|
||||
groupBoxPluginDebugging->setTitle(GdbOptionsPage::tr(
|
||||
"Behavior of Breakpoint Setting in Plugins"));
|
||||
|
||||
radioButtonAllPluginBreakpoints = new QRadioButton(groupBoxPluginDebugging);
|
||||
radioButtonAllPluginBreakpoints->setText(GdbOptionsPage::tr(
|
||||
"Always try to set breakpoints in plugins automatically"));
|
||||
radioButtonAllPluginBreakpoints->setToolTip(GdbOptionsPage::tr(
|
||||
"This is the slowest but safest option."));
|
||||
|
||||
radioButtonSelectedPluginBreakpoints = new QRadioButton(groupBoxPluginDebugging);
|
||||
radioButtonSelectedPluginBreakpoints->setText(GdbOptionsPage::tr(
|
||||
"Try to set breakpoints in selected plugins"));
|
||||
|
||||
radioButtonNoPluginBreakpoints = new QRadioButton(groupBoxPluginDebugging);
|
||||
radioButtonNoPluginBreakpoints->setText(GdbOptionsPage::tr(
|
||||
"Never set breakpoints in plugins automatically"));
|
||||
|
||||
lineEditSelectedPluginBreakpointsPattern = new QLineEdit(groupBoxPluginDebugging);
|
||||
|
||||
labelSelectedPluginBreakpoints = new QLabel(groupBoxPluginDebugging);
|
||||
labelSelectedPluginBreakpoints->setText(GdbOptionsPage::tr(
|
||||
"Matching regular expression: "));
|
||||
*/
|
||||
|
||||
auto chooser = new VariableChooser(this);
|
||||
chooser->addSupportedWidget(textEditPostAttachCommands);
|
||||
chooser->addSupportedWidget(textEditStartupCommands);
|
||||
|
||||
auto formLayout = new QFormLayout(groupBoxGeneral);
|
||||
formLayout->addRow(labelGdbWatchdogTimeout, spinBoxGdbWatchdogTimeout);
|
||||
formLayout->addRow(checkBoxSkipKnownFrames);
|
||||
formLayout->addRow(checkBoxUseMessageBoxForSignals);
|
||||
formLayout->addRow(checkBoxAdjustBreakpointLocations);
|
||||
formLayout->addRow(checkBoxUseDynamicType);
|
||||
formLayout->addRow(checkBoxLoadGdbInit);
|
||||
formLayout->addRow(checkBoxLoadGdbDumpers);
|
||||
formLayout->addRow(checkBoxIntelFlavor);
|
||||
formLayout->addRow(checkBoxUsePseudoTracepoints);
|
||||
|
||||
auto startLayout = new QGridLayout(groupBoxStartupCommands);
|
||||
startLayout->addWidget(textEditStartupCommands, 0, 0, 1, 1);
|
||||
|
||||
auto postAttachLayout = new QGridLayout(groupBoxPostAttachCommands);
|
||||
postAttachLayout->addWidget(textEditPostAttachCommands, 0, 0, 1, 1);
|
||||
|
||||
auto gridLayout = new QGridLayout(this);
|
||||
gridLayout->addWidget(groupBoxGeneral, 0, 0, 5, 1);
|
||||
|
||||
gridLayout->addWidget(groupBoxStartupCommands, 0, 1, 2, 1);
|
||||
gridLayout->addWidget(groupBoxPostAttachCommands, 2, 1, 2, 1);
|
||||
|
||||
group.insert(action(GdbStartupCommands), textEditStartupCommands);
|
||||
group.insert(action(GdbPostAttachCommands), textEditPostAttachCommands);
|
||||
group.insert(action(LoadGdbInit), checkBoxLoadGdbInit);
|
||||
group.insert(action(LoadGdbDumpers), checkBoxLoadGdbDumpers);
|
||||
group.insert(action(UseDynamicType), checkBoxUseDynamicType);
|
||||
group.insert(action(AdjustBreakpointLocations), checkBoxAdjustBreakpointLocations);
|
||||
group.insert(action(GdbWatchdogTimeout), spinBoxGdbWatchdogTimeout);
|
||||
group.insert(action(IntelFlavor), checkBoxIntelFlavor);
|
||||
group.insert(action(UseMessageBoxForSignals), checkBoxUseMessageBoxForSignals);
|
||||
group.insert(action(SkipKnownFrames), checkBoxSkipKnownFrames);
|
||||
group.insert(action(UsePseudoTracepoints), checkBoxUsePseudoTracepoints);
|
||||
|
||||
//lineEditSelectedPluginBreakpointsPattern->
|
||||
// setEnabled(action(SelectedPluginBreakpoints)->value().toBool());
|
||||
//connect(radioButtonSelectedPluginBreakpoints, &QRadioButton::toggled,
|
||||
// lineEditSelectedPluginBreakpointsPattern, &QLineEdit::setEnabled);
|
||||
Row { general, commands }.attachTo(this);
|
||||
}
|
||||
|
||||
GdbOptionsPage::GdbOptionsPage()
|
||||
@@ -281,87 +112,33 @@ class GdbOptionsPageWidget2 : public IOptionsPageWidget
|
||||
public:
|
||||
GdbOptionsPageWidget2();
|
||||
|
||||
void apply() final { group.apply(ICore::settings()); }
|
||||
void apply() final { group.apply(); group.writeSettings(ICore::settings()); }
|
||||
void finish() final { group.finish(); }
|
||||
|
||||
Utils::SavedActionSet group;
|
||||
AspectContainer &group = debuggerSettings()->page3;
|
||||
};
|
||||
|
||||
GdbOptionsPageWidget2::GdbOptionsPageWidget2()
|
||||
{
|
||||
auto groupBoxDangerous = new QGroupBox(this);
|
||||
groupBoxDangerous->setTitle(GdbOptionsPage::tr("Extended"));
|
||||
auto labelDangerous = new QLabel("<html><head/><body><i>" +
|
||||
GdbOptionsPage::tr("The options below give access to advanced "
|
||||
"or experimental functions of GDB.<br>Enabling them may negatively "
|
||||
"impact your debugging experience.") + "</i></body></html>");
|
||||
|
||||
auto labelDangerous = new QLabel(GdbOptionsPage::tr(
|
||||
"<html><head/><body>The options below give access to advanced "
|
||||
"or experimental functions of GDB. Enabling them may negatively "
|
||||
"impact your debugging experience.</body></html>"));
|
||||
QFont f = labelDangerous->font();
|
||||
f.setItalic(true);
|
||||
labelDangerous->setFont(f);
|
||||
using namespace Layouting;
|
||||
DebuggerSettings &s = *debuggerSettings();
|
||||
|
||||
auto checkBoxTargetAsync = new QCheckBox(groupBoxDangerous);
|
||||
checkBoxTargetAsync->setText(GdbOptionsPage::tr(
|
||||
"Use asynchronous mode to control the inferior"));
|
||||
|
||||
auto checkBoxAutoEnrichParameters = new QCheckBox(groupBoxDangerous);
|
||||
checkBoxAutoEnrichParameters->setText(GdbOptionsPage::tr(
|
||||
"Use common locations for debug information"));
|
||||
checkBoxAutoEnrichParameters->setToolTip(GdbOptionsPage::tr(
|
||||
"<html><head/><body>Adds common paths to locations "
|
||||
"of debug information such as <i>/usr/src/debug</i> "
|
||||
"when starting GDB.</body></html>"));
|
||||
|
||||
// FIXME: Move to common settings page.
|
||||
auto checkBoxBreakOnWarning = new QCheckBox(groupBoxDangerous);
|
||||
checkBoxBreakOnWarning->setText(CommonOptionsPage::msgSetBreakpointAtFunction("qWarning"));
|
||||
checkBoxBreakOnWarning->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("qWarning"));
|
||||
|
||||
auto checkBoxBreakOnFatal = new QCheckBox(groupBoxDangerous);
|
||||
checkBoxBreakOnFatal->setText(CommonOptionsPage::msgSetBreakpointAtFunction("qFatal"));
|
||||
checkBoxBreakOnFatal->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("qFatal"));
|
||||
|
||||
auto checkBoxBreakOnAbort = new QCheckBox(groupBoxDangerous);
|
||||
checkBoxBreakOnAbort->setText(CommonOptionsPage::msgSetBreakpointAtFunction("abort"));
|
||||
checkBoxBreakOnAbort->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip("abort"));
|
||||
|
||||
auto checkBoxEnableReverseDebugging = new QCheckBox(groupBoxDangerous);
|
||||
checkBoxEnableReverseDebugging->setText(GdbOptionsPage::tr("Enable reverse debugging"));
|
||||
checkBoxEnableReverseDebugging->setToolTip(GdbOptionsPage::tr(
|
||||
"<html><head/><body><p>Enables stepping backwards.</p><p>"
|
||||
"<b>Note:</b> This feature is very slow and unstable on the GDB side. "
|
||||
"It exhibits unpredictable behavior when going backwards over system "
|
||||
"calls and is very likely to destroy your debugging session.</p></body></html>"));
|
||||
|
||||
auto checkBoxMultiInferior = new QCheckBox(groupBoxDangerous);
|
||||
checkBoxMultiInferior->setText(GdbOptionsPage::tr("Debug all child processes"));
|
||||
checkBoxMultiInferior->setToolTip(GdbOptionsPage::tr(
|
||||
"<html><head/><body>Keeps debugging all children after a fork."
|
||||
"</body></html>"));
|
||||
|
||||
|
||||
auto formLayout = new QFormLayout(groupBoxDangerous);
|
||||
formLayout->addRow(labelDangerous);
|
||||
formLayout->addRow(checkBoxTargetAsync);
|
||||
formLayout->addRow(checkBoxAutoEnrichParameters);
|
||||
formLayout->addRow(checkBoxBreakOnWarning);
|
||||
formLayout->addRow(checkBoxBreakOnFatal);
|
||||
formLayout->addRow(checkBoxBreakOnAbort);
|
||||
if (checkBoxEnableReverseDebugging)
|
||||
formLayout->addRow(checkBoxEnableReverseDebugging);
|
||||
formLayout->addRow(checkBoxMultiInferior);
|
||||
|
||||
auto gridLayout = new QGridLayout(this);
|
||||
gridLayout->addWidget(groupBoxDangerous, 0, 0, 2, 1);
|
||||
|
||||
group.insert(action(AutoEnrichParameters), checkBoxAutoEnrichParameters);
|
||||
group.insert(action(TargetAsync), checkBoxTargetAsync);
|
||||
group.insert(action(BreakOnWarning), checkBoxBreakOnWarning);
|
||||
group.insert(action(BreakOnFatal), checkBoxBreakOnFatal);
|
||||
group.insert(action(BreakOnAbort), checkBoxBreakOnAbort);
|
||||
group.insert(action(MultiInferior), checkBoxMultiInferior);
|
||||
if (checkBoxEnableReverseDebugging)
|
||||
group.insert(action(EnableReverseDebugging), checkBoxEnableReverseDebugging);
|
||||
Group {
|
||||
Title(GdbOptionsPage::tr("Extended")),
|
||||
labelDangerous,
|
||||
s.targetAsync,
|
||||
s.autoEnrichParameters,
|
||||
s.breakOnWarning,
|
||||
s.breakOnFatal,
|
||||
s.breakOnAbort,
|
||||
s.enableReverseDebugging,
|
||||
s.multiInferior,
|
||||
}.attachTo(this);
|
||||
}
|
||||
|
||||
// The "Dangerous" options.
|
||||
|
@@ -50,7 +50,6 @@
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/savedaction.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
#include <QApplication>
|
||||
@@ -87,15 +86,16 @@ LldbEngine::LldbEngine()
|
||||
setObjectName("LldbEngine");
|
||||
setDebuggerName("LLDB");
|
||||
|
||||
connect(action(AutoDerefPointers), &SavedAction::valueChanged,
|
||||
DebuggerSettings &ds = *debuggerSettings();
|
||||
connect(&ds.autoDerefPointers, &BaseAspect::changed,
|
||||
this, &LldbEngine::updateLocals);
|
||||
connect(action(CreateFullBacktrace)->action(), &QAction::triggered,
|
||||
connect(ds.createFullBacktrace.action(), &QAction::triggered,
|
||||
this, &LldbEngine::fetchFullBacktrace);
|
||||
connect(action(UseDebuggingHelpers), &SavedAction::valueChanged,
|
||||
connect(&ds.useDebuggingHelpers, &BaseAspect::changed,
|
||||
this, &LldbEngine::updateLocals);
|
||||
connect(action(UseDynamicType), &SavedAction::valueChanged,
|
||||
connect(&ds.useDynamicType, &BaseAspect::changed,
|
||||
this, &LldbEngine::updateLocals);
|
||||
connect(action(IntelFlavor), &SavedAction::valueChanged,
|
||||
connect(&ds.intelFlavor, &BaseAspect::changed,
|
||||
this, &LldbEngine::updateAll);
|
||||
|
||||
connect(&m_lldbProc, &QProcess::errorOccurred,
|
||||
@@ -244,14 +244,14 @@ void LldbEngine::setupEngine()
|
||||
executeCommand(commands.toLocal8Bit());
|
||||
|
||||
|
||||
const QString path = stringSetting(ExtraDumperFile);
|
||||
const QString path = debuggerSettings()->extraDumperFile.value();
|
||||
if (!path.isEmpty() && QFileInfo(path).isReadable()) {
|
||||
DebuggerCommand cmd("addDumperModule");
|
||||
cmd.arg("path", path);
|
||||
runCommand(cmd);
|
||||
}
|
||||
|
||||
commands = stringSetting(ExtraDumperCommands);
|
||||
commands = debuggerSettings()->extraDumperCommands.value();
|
||||
if (!commands.isEmpty()) {
|
||||
DebuggerCommand cmd("executeDebuggerCommand");
|
||||
cmd.arg("command", commands);
|
||||
@@ -480,7 +480,7 @@ void LldbEngine::selectThread(const Thread &thread)
|
||||
DebuggerCommand cmd("selectThread");
|
||||
cmd.arg("id", thread->id());
|
||||
cmd.callback = [this](const DebuggerResponse &) {
|
||||
fetchStack(action(MaximalStackDepth)->value().toInt());
|
||||
fetchStack(debuggerSettings()->maximalStackDepth.value());
|
||||
};
|
||||
runCommand(cmd);
|
||||
}
|
||||
@@ -711,7 +711,7 @@ void LldbEngine::updateAll()
|
||||
DebuggerCommand cmd("fetchThreads");
|
||||
cmd.callback = [this](const DebuggerResponse &response) {
|
||||
threadsHandler()->setThreads(response.data);
|
||||
fetchStack(action(MaximalStackDepth)->value().toInt());
|
||||
fetchStack(debuggerSettings()->maximalStackDepth.value());
|
||||
reloadRegisters();
|
||||
};
|
||||
runCommand(cmd);
|
||||
@@ -765,20 +765,21 @@ void LldbEngine::doUpdateLocals(const UpdateParameters ¶ms)
|
||||
watchHandler()->appendWatchersAndTooltipRequests(&cmd);
|
||||
|
||||
const static bool alwaysVerbose = qEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE");
|
||||
const DebuggerSettings &s = *debuggerSettings();
|
||||
cmd.arg("passexceptions", alwaysVerbose);
|
||||
cmd.arg("fancy", boolSetting(UseDebuggingHelpers));
|
||||
cmd.arg("autoderef", boolSetting(AutoDerefPointers));
|
||||
cmd.arg("dyntype", boolSetting(UseDynamicType));
|
||||
cmd.arg("fancy", s.useDebuggingHelpers.value());
|
||||
cmd.arg("autoderef", s.autoDerefPointers.value());
|
||||
cmd.arg("dyntype", s.useDynamicType.value());
|
||||
cmd.arg("partialvar", params.partialVariable);
|
||||
cmd.arg("qobjectnames", boolSetting(ShowQObjectNames));
|
||||
cmd.arg("timestamps", boolSetting(LogTimeStamps));
|
||||
cmd.arg("qobjectnames", s.showQObjectNames.value());
|
||||
cmd.arg("timestamps", s.logTimeStamps.value());
|
||||
|
||||
StackFrame frame = stackHandler()->currentFrame();
|
||||
cmd.arg("context", frame.context);
|
||||
cmd.arg("nativemixed", isNativeMixedActive());
|
||||
|
||||
cmd.arg("stringcutoff", action(MaximalStringLength)->value().toString());
|
||||
cmd.arg("displaystringlimit", action(DisplayStringLimit)->value().toString());
|
||||
cmd.arg("stringcutoff", s.maximalStringLength.value());
|
||||
cmd.arg("displaystringlimit", s.displayStringLimit.value());
|
||||
|
||||
//cmd.arg("resultvarname", m_resultVarName);
|
||||
cmd.arg("partialvar", params.partialVariable);
|
||||
@@ -993,7 +994,7 @@ void LldbEngine::fetchDisassembler(DisassemblerAgent *agent)
|
||||
DebuggerCommand cmd("fetchDisassembler");
|
||||
cmd.arg("address", loc.address());
|
||||
cmd.arg("function", loc.functionName());
|
||||
cmd.arg("flavor", boolSetting(IntelFlavor) ? "intel" : "att");
|
||||
cmd.arg("flavor", debuggerSettings()->intelFlavor.value() ? "intel" : "att");
|
||||
cmd.callback = [this, id](const DebuggerResponse &response) {
|
||||
DisassemblerLines result;
|
||||
QPointer<DisassemblerAgent> agent = m_disassemblerAgents.key(id);
|
||||
|
@@ -50,7 +50,6 @@
|
||||
#include <coreplugin/minisplitter.h>
|
||||
#include <coreplugin/find/basetextfind.h>
|
||||
|
||||
#include <utils/savedaction.h>
|
||||
#include <utils/fancylineedit.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/theme/theme.h>
|
||||
@@ -220,10 +219,10 @@ public:
|
||||
QMenu *menu = createStandardContextMenu();
|
||||
menu->addAction(m_clearContentsAction);
|
||||
menu->addAction(m_saveContentsAction); // X11 clipboard is unreliable for long texts
|
||||
menu->addAction(action(LogTimeStamps)->action());
|
||||
menu->addAction(debuggerSettings()->logTimeStamps.action());
|
||||
menu->addAction(m_reloadDebuggingHelpersAction);
|
||||
menu->addSeparator();
|
||||
menu->addAction(action(SettingsDialog)->action());
|
||||
menu->addAction(debuggerSettings()->settingsDialog.action());
|
||||
menu->exec(ev->globalPos());
|
||||
delete menu;
|
||||
}
|
||||
@@ -526,7 +525,7 @@ void LogWindow::showOutput(int channel, const QString &output)
|
||||
QString out;
|
||||
out.reserve(output.size() + 1000);
|
||||
|
||||
if (output.at(0) != '~' && boolSetting(LogTimeStamps)) {
|
||||
if (output.at(0) != '~' && debuggerSettings()->logTimeStamps.value()) {
|
||||
out.append(charForChannel(LogTime));
|
||||
out.append(logTimeStamp());
|
||||
out.append(nchar);
|
||||
@@ -594,7 +593,7 @@ void LogWindow::showInput(int channel, const QString &input)
|
||||
m_inputText->setTextCursor(cursor);
|
||||
return;
|
||||
}
|
||||
if (boolSetting(LogTimeStamps))
|
||||
if (debuggerSettings()->logTimeStamps.value())
|
||||
m_inputText->append(logTimeStamp());
|
||||
m_inputText->append(input);
|
||||
QTextCursor cursor = m_inputText->textCursor();
|
||||
@@ -726,7 +725,7 @@ void GlobalLogWindow::doOutput(const QString &output)
|
||||
|
||||
void GlobalLogWindow::doInput(const QString &input)
|
||||
{
|
||||
if (boolSetting(LogTimeStamps))
|
||||
if (debuggerSettings()->logTimeStamps.value())
|
||||
m_leftPane->append(LogWindow::logTimeStamp());
|
||||
m_leftPane->append(input);
|
||||
QTextCursor cursor = m_leftPane->textCursor();
|
||||
|
@@ -33,7 +33,6 @@
|
||||
#include <utils/basetreeview.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/savedaction.h>
|
||||
#include <utils/treemodel.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
@@ -223,7 +222,7 @@ bool ModulesModel::contextMenuEvent(const ItemViewEvent &ev)
|
||||
canShowSymbols && moduleNameValid,
|
||||
[this, modulePath] { engine->requestModuleSections(modulePath); });
|
||||
|
||||
menu->addAction(action(SettingsDialog)->action());
|
||||
menu->addAction(debuggerSettings()->settingsDialog.action());
|
||||
|
||||
menu->popup(ev.globalPos());
|
||||
return true;
|
||||
|
@@ -572,7 +572,7 @@ void PdbEngine::updateLocals()
|
||||
|
||||
const static bool alwaysVerbose = qEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE");
|
||||
cmd.arg("passexceptions", alwaysVerbose);
|
||||
cmd.arg("fancy", boolSetting(UseDebuggingHelpers));
|
||||
cmd.arg("fancy", debuggerSettings()->useDebuggingHelpers.value());
|
||||
|
||||
//cmd.arg("resultvarname", m_resultVarName);
|
||||
//m_lastDebuggableCommand = cmd;
|
||||
|
@@ -30,7 +30,6 @@
|
||||
#include "debuggerdialogs.h"
|
||||
|
||||
#include <utils/basetreeview.h>
|
||||
#include <utils/savedaction.h>
|
||||
|
||||
#include <QActionGroup>
|
||||
#include <QFile>
|
||||
@@ -799,7 +798,7 @@ bool PeripheralRegisterHandler::contextMenuEvent(const ItemViewEvent &ev)
|
||||
menu->addMenu(fmtMenu);
|
||||
}
|
||||
|
||||
menu->addAction(action(SettingsDialog)->action());
|
||||
menu->addAction(debuggerSettings()->settingsDialog.action());
|
||||
menu->popup(ev.globalPos());
|
||||
return true;
|
||||
}
|
||||
|
@@ -862,7 +862,7 @@ bool compareConsoleItems(const ConsoleItem *a, const ConsoleItem *b)
|
||||
static ConsoleItem *constructLogItemTree(const QVariant &result,
|
||||
const QString &key = QString())
|
||||
{
|
||||
bool sorted = boolSetting(SortStructMembers);
|
||||
bool sorted = debuggerSettings()->sortStructMembers.value();
|
||||
if (!result.isValid())
|
||||
return nullptr;
|
||||
|
||||
@@ -2226,7 +2226,7 @@ void QmlEnginePrivate::constructChildLogItems(ConsoleItem *item, const QmlV8Obje
|
||||
for (const QVariant &property : objectData.properties)
|
||||
*(it++) = constructLogItemTree(extractData(property), seenHandles);
|
||||
|
||||
if (boolSetting(SortStructMembers))
|
||||
if (debuggerSettings()->sortStructMembers.value())
|
||||
std::sort(children.begin(), children.end(), compareConsoleItems);
|
||||
|
||||
foreach (ConsoleItem *child, children)
|
||||
@@ -2339,7 +2339,7 @@ void QmlEnginePrivate::insertSubItems(WatchItem *parent, const QVariantList &pro
|
||||
parent->appendChild(item.release());
|
||||
}
|
||||
|
||||
if (boolSetting(SortStructMembers)) {
|
||||
if (debuggerSettings()->sortStructMembers.value()) {
|
||||
parent->sortChildren([](const WatchItem *item1, const WatchItem *item2) {
|
||||
return item1->name < item2->name;
|
||||
});
|
||||
|
@@ -45,8 +45,8 @@
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/savedaction.h>
|
||||
|
||||
#include <QAction>
|
||||
#include <QElapsedTimer>
|
||||
#include <QFileInfo>
|
||||
#include <QLoggingCategory>
|
||||
@@ -68,12 +68,12 @@ QmlInspectorAgent::QmlInspectorAgent(QmlEngine *engine, QmlDebugConnection *conn
|
||||
: m_qmlEngine(engine)
|
||||
, m_inspectorToolsContext("Debugger.QmlInspector")
|
||||
, m_selectAction(new QAction(this))
|
||||
, m_showAppOnTopAction(action(ShowAppOnTop)->action())
|
||||
, m_showAppOnTopAction(debuggerSettings()->showAppOnTop.action())
|
||||
{
|
||||
m_debugIdToIname.insert(WatchItem::InvalidId, "inspect");
|
||||
connect(action(ShowQmlObjectTree),
|
||||
&Utils::SavedAction::valueChanged, this, &QmlInspectorAgent::updateState);
|
||||
connect(action(SortStructMembers), &Utils::SavedAction::valueChanged,
|
||||
connect(&debuggerSettings()->showQmlObjectTree, &Utils::BaseAspect::changed,
|
||||
this, &QmlInspectorAgent::updateState);
|
||||
connect(&debuggerSettings()->sortStructMembers, &Utils::BaseAspect::changed,
|
||||
this, &QmlInspectorAgent::updateState);
|
||||
m_delayQueryTimer.setSingleShot(true);
|
||||
m_delayQueryTimer.setInterval(100);
|
||||
@@ -193,7 +193,7 @@ void QmlInspectorAgent::addObjectWatch(int objectDebugId)
|
||||
if (objectDebugId == WatchItem::InvalidId)
|
||||
return;
|
||||
|
||||
if (!isConnected() || !boolSetting(ShowQmlObjectTree))
|
||||
if (!isConnected() || !debuggerSettings()->showQmlObjectTree.value())
|
||||
return;
|
||||
|
||||
// already set
|
||||
@@ -212,7 +212,8 @@ void QmlInspectorAgent::updateState()
|
||||
m_qmlEngine->logServiceStateChange(m_engineClient->name(), m_engineClient->serviceVersion(),
|
||||
m_engineClient->state());
|
||||
|
||||
if (m_engineClient->state() == QmlDebugClient::Enabled && boolSetting(ShowQmlObjectTree))
|
||||
if (m_engineClient->state() == QmlDebugClient::Enabled
|
||||
&& debuggerSettings()->showQmlObjectTree.value())
|
||||
reloadEngines();
|
||||
else
|
||||
clearObjectTree();
|
||||
@@ -301,7 +302,7 @@ void QmlInspectorAgent::newObject(int engineId, int /*objectId*/, int /*parentId
|
||||
|
||||
static void sortChildrenIfNecessary(WatchItem *propertiesWatch)
|
||||
{
|
||||
if (boolSetting(SortStructMembers)) {
|
||||
if (debuggerSettings()->sortStructMembers.value()) {
|
||||
propertiesWatch->sortChildren([](const WatchItem *item1, const WatchItem *item2) {
|
||||
return item1->name < item2->name;
|
||||
});
|
||||
@@ -375,7 +376,7 @@ void QmlInspectorAgent::queryEngineContext()
|
||||
{
|
||||
qCDebug(qmlInspectorLog) << __FUNCTION__ << "pending queries:" << m_rootContextQueryIds;
|
||||
|
||||
if (!isConnected() || !boolSetting(ShowQmlObjectTree))
|
||||
if (!isConnected() || !debuggerSettings()->showQmlObjectTree.value())
|
||||
return;
|
||||
|
||||
log(LogSend, "LIST_OBJECTS");
|
||||
@@ -390,7 +391,7 @@ void QmlInspectorAgent::fetchObject(int debugId)
|
||||
{
|
||||
qCDebug(qmlInspectorLog) << __FUNCTION__ << '(' << debugId << ')';
|
||||
|
||||
if (!isConnected() || !boolSetting(ShowQmlObjectTree))
|
||||
if (!isConnected() || !debuggerSettings()->showQmlObjectTree.value())
|
||||
return;
|
||||
|
||||
log(LogSend, "FETCH_OBJECT " + QString::number(debugId));
|
||||
@@ -404,7 +405,7 @@ void QmlInspectorAgent::updateObjectTree(const ContextReference &context, int en
|
||||
{
|
||||
qCDebug(qmlInspectorLog) << __FUNCTION__ << '(' << context << ')';
|
||||
|
||||
if (!isConnected() || !boolSetting(ShowQmlObjectTree))
|
||||
if (!isConnected() || !debuggerSettings()->showQmlObjectTree.value())
|
||||
return;
|
||||
|
||||
for (const ObjectReference &obj : context.objects())
|
||||
|
@@ -36,7 +36,6 @@
|
||||
|
||||
#include <utils/basetreeview.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/savedaction.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QItemDelegate>
|
||||
@@ -834,7 +833,7 @@ bool RegisterHandler::contextMenuEvent(const ItemViewEvent &ev)
|
||||
addFormatAction(tr("Octal"), OctalFormat);
|
||||
addFormatAction(tr("Binary"), BinaryFormat);
|
||||
|
||||
menu->addAction(action(SettingsDialog)->action());
|
||||
menu->addAction(debuggerSettings()->settingsDialog.action());
|
||||
menu->popup(ev.globalPos());
|
||||
return true;
|
||||
}
|
||||
|
@@ -40,9 +40,8 @@ using namespace RegistryAccess;
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
void RegisterPostMortemAction::registerNow(const QVariant &value)
|
||||
void RegisterPostMortemAction::registerNow(bool value)
|
||||
{
|
||||
const bool boolValue = value.toBool();
|
||||
const QString debuggerExe = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + '/'
|
||||
+ QLatin1String(debuggerApplicationFileC) + ".exe");
|
||||
const ushort *debuggerWString = debuggerExe.utf16();
|
||||
@@ -54,7 +53,7 @@ void RegisterPostMortemAction::registerNow(const QVariant &value)
|
||||
shExecInfo.hwnd = NULL;
|
||||
shExecInfo.lpVerb = L"runas";
|
||||
shExecInfo.lpFile = reinterpret_cast<LPCWSTR>(debuggerWString);
|
||||
shExecInfo.lpParameters = boolValue ? L"-register" : L"-unregister";
|
||||
shExecInfo.lpParameters = value ? L"-register" : L"-unregister";
|
||||
shExecInfo.lpDirectory = NULL;
|
||||
shExecInfo.nShow = SW_SHOWNORMAL;
|
||||
shExecInfo.hProcess = NULL;
|
||||
@@ -64,9 +63,9 @@ void RegisterPostMortemAction::registerNow(const QVariant &value)
|
||||
readSettings();
|
||||
}
|
||||
|
||||
RegisterPostMortemAction::RegisterPostMortemAction(QObject *parent) : Utils::SavedAction(parent)
|
||||
RegisterPostMortemAction::RegisterPostMortemAction()
|
||||
{
|
||||
connect(this, &SavedAction::valueChanged, this, &RegisterPostMortemAction::registerNow);
|
||||
connect(this, &BoolAspect::valueChanged, this, &RegisterPostMortemAction::registerNow);
|
||||
}
|
||||
|
||||
void RegisterPostMortemAction::readSettings(const QSettings *)
|
||||
@@ -80,7 +79,7 @@ void RegisterPostMortemAction::readSettings(const QSettings *)
|
||||
registered = isRegistered(handle, debuggerCall(), &errorMessage);
|
||||
if (handle)
|
||||
RegCloseKey(handle);
|
||||
setValue(registered, false);
|
||||
setValueQuietly(registered);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -25,20 +25,20 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <utils/savedaction.h>
|
||||
#include <utils/aspects.h>
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
class RegisterPostMortemAction : public Utils::SavedAction
|
||||
class RegisterPostMortemAction : public Utils::BoolAspect
|
||||
{
|
||||
public:
|
||||
RegisterPostMortemAction(QObject *parent = nullptr);
|
||||
RegisterPostMortemAction();
|
||||
void readSettings(const QSettings *settings = nullptr) override;
|
||||
void writeSettings(QSettings *) override {}
|
||||
void writeSettings(QSettings *) const override {}
|
||||
|
||||
private:
|
||||
void registerNow(const QVariant &value);
|
||||
void registerNow(bool value);
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -30,7 +30,6 @@
|
||||
#include "debuggerengine.h"
|
||||
|
||||
#include <utils/basetreeview.h>
|
||||
#include <utils/savedaction.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFileInfo>
|
||||
@@ -137,7 +136,7 @@ bool SourceFilesHandler::setData(const QModelIndex &idx, const QVariant &data, i
|
||||
addAction(tr("Open File \"%1\"").arg(name), true,
|
||||
[this, name] { m_engine->gotoLocation(FilePath::fromString(name)); });
|
||||
|
||||
menu->addAction(action(SettingsDialog)->action());
|
||||
menu->addAction(debuggerSettings()->settingsDialog.action());
|
||||
menu->popup(ev.globalPos());
|
||||
return true;
|
||||
}
|
||||
|
@@ -40,7 +40,6 @@
|
||||
#include <utils/basetreeview.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/savedaction.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
@@ -52,6 +51,7 @@
|
||||
#include <QInputDialog>
|
||||
#include <QMenu>
|
||||
#include <QTextStream>
|
||||
#include <QTimer>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
@@ -70,9 +70,9 @@ StackHandler::StackHandler(DebuggerEngine *engine)
|
||||
setObjectName("StackModel");
|
||||
setHeader({tr("Level"), tr("Function"), tr("File"), tr("Line"), tr("Address") });
|
||||
|
||||
connect(action(ExpandStack)->action(), &QAction::triggered,
|
||||
connect(debuggerSettings()->expandStack.action(), &QAction::triggered,
|
||||
this, &StackHandler::reloadFullStack);
|
||||
connect(action(MaximalStackDepth)->action(), &QAction::triggered,
|
||||
connect(debuggerSettings()->maximalStackDepth.action(), &QAction::triggered,
|
||||
this, &StackHandler::reloadFullStack);
|
||||
|
||||
// For now there's always only "the" current thread.
|
||||
@@ -115,7 +115,7 @@ QVariant StackFrameItem::data(int column, int role) const
|
||||
if (role == Qt::DecorationRole && column == StackLevelColumn)
|
||||
return handler->iconForRow(row);
|
||||
|
||||
if (role == Qt::ToolTipRole && boolSetting(UseToolTipsInStackView))
|
||||
if (role == Qt::ToolTipRole && debuggerSettings()->useToolTipsInStackView.value())
|
||||
return frame.toToolTip();
|
||||
|
||||
return QVariant();
|
||||
@@ -257,8 +257,8 @@ void StackHandler::setFramesAndCurrentIndex(const GdbMi &frames, bool isFull)
|
||||
targetFrame = i;
|
||||
}
|
||||
|
||||
bool canExpand = !isFull && (n >= action(MaximalStackDepth)->value().toInt());
|
||||
action(ExpandStack)->setEnabled(canExpand);
|
||||
bool canExpand = !isFull && (n >= debuggerSettings()->maximalStackDepth.value());
|
||||
debuggerSettings()->expandStack.setEnabled(canExpand);
|
||||
setFrames(stackFrames, canExpand);
|
||||
|
||||
// We can't jump to any file if we don't have any frames.
|
||||
@@ -455,7 +455,7 @@ bool StackHandler::contextMenuEvent(const ItemViewEvent &ev)
|
||||
frame = frameAt(row);
|
||||
const quint64 address = frame.address;
|
||||
|
||||
menu->addAction(action(ExpandStack)->action());
|
||||
menu->addAction(debuggerSettings()->expandStack.action());
|
||||
|
||||
addAction(menu, tr("Copy Contents to Clipboard"), true, [ev] {
|
||||
copyTextToClipboard(selectedText(ev.view(), true));
|
||||
@@ -468,7 +468,7 @@ bool StackHandler::contextMenuEvent(const ItemViewEvent &ev)
|
||||
addAction(menu, tr("Save as Task File..."), true, [this] { saveTaskFile(); });
|
||||
|
||||
if (m_engine->hasCapability(CreateFullBacktraceCapability))
|
||||
menu->addAction(action(CreateFullBacktrace)->action());
|
||||
menu->addAction(debuggerSettings()->createFullBacktrace.action());
|
||||
|
||||
if (m_engine->hasCapability(AdditionalQmlStackCapability))
|
||||
addAction(menu, tr("Load QML Stack"), true, [this] { m_engine->loadAdditionalQmlStack(); });
|
||||
@@ -516,8 +516,8 @@ bool StackHandler::contextMenuEvent(const ItemViewEvent &ev)
|
||||
}
|
||||
|
||||
menu->addSeparator();
|
||||
menu->addAction(action(UseToolTipsInStackView)->action());
|
||||
menu->addAction(action(SettingsDialog)->action());
|
||||
menu->addAction(debuggerSettings()->useToolTipsInStackView.action());
|
||||
menu->addAction(debuggerSettings()->settingsDialog.action());
|
||||
menu->popup(ev.globalPos());
|
||||
return true;
|
||||
}
|
||||
|
@@ -29,8 +29,6 @@
|
||||
#include "debuggercore.h"
|
||||
#include "stackhandler.h"
|
||||
|
||||
#include <utils/savedaction.h>
|
||||
|
||||
#include <QAction>
|
||||
#include <QHeaderView>
|
||||
|
||||
|
@@ -35,7 +35,6 @@
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/basetreeview.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/savedaction.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
@@ -258,7 +257,7 @@ bool ThreadsHandler::setData(const QModelIndex &idx, const QVariant &data, int r
|
||||
|
||||
if (ev.as<QContextMenuEvent>()) {
|
||||
auto menu = new QMenu;
|
||||
menu->addAction(action(SettingsDialog)->action());
|
||||
menu->addAction(debuggerSettings()->settingsDialog.action());
|
||||
menu->popup(ev.globalPos());
|
||||
return true;
|
||||
}
|
||||
|
@@ -56,7 +56,6 @@
|
||||
#include <utils/checkablemessagebox.h>
|
||||
#include <utils/fancylineedit.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/savedaction.h>
|
||||
#include <utils/stringutils.h>
|
||||
#include <utils/theme/theme.h>
|
||||
|
||||
@@ -514,15 +513,16 @@ WatchModel::WatchModel(WatchHandler *handler, DebuggerEngine *engine)
|
||||
connect(&m_requestUpdateTimer, &QTimer::timeout,
|
||||
this, &WatchModel::updateStarted);
|
||||
|
||||
connect(action(SortStructMembers), &SavedAction::valueChanged,
|
||||
DebuggerSettings &s = *debuggerSettings();
|
||||
connect(&s.sortStructMembers, &BaseAspect::changed,
|
||||
m_engine, &DebuggerEngine::updateLocals);
|
||||
connect(action(ShowStdNamespace), &SavedAction::valueChanged,
|
||||
connect(&s.showStdNamespace, &BaseAspect::changed,
|
||||
m_engine, &DebuggerEngine::updateAll);
|
||||
connect(action(ShowQtNamespace), &SavedAction::valueChanged,
|
||||
connect(&s.showQtNamespace, &BaseAspect::changed,
|
||||
m_engine, &DebuggerEngine::updateAll);
|
||||
connect(action(ShowQObjectNames), &SavedAction::valueChanged,
|
||||
connect(&s.showQObjectNames, &BaseAspect::changed,
|
||||
m_engine, &DebuggerEngine::updateAll);
|
||||
connect(action(UseAnnotationsInMainEditor), &SavedAction::valueChanged,
|
||||
connect(&s.useAnnotationsInMainEditor, &BaseAspect::changed,
|
||||
m_engine, &DebuggerEngine::updateAll);
|
||||
|
||||
connect(SessionManager::instance(), &SessionManager::sessionLoaded,
|
||||
@@ -566,9 +566,9 @@ static QString niceTypeHelper(const QString &typeIn)
|
||||
|
||||
QString WatchModel::removeNamespaces(QString str) const
|
||||
{
|
||||
if (!boolSetting(ShowStdNamespace))
|
||||
if (!debuggerSettings()->showStdNamespace.value())
|
||||
str.remove("std::");
|
||||
if (!boolSetting(ShowQtNamespace)) {
|
||||
if (!debuggerSettings()->showQtNamespace.value()) {
|
||||
const QString qtNamespace = m_engine->qtNamespace();
|
||||
if (!qtNamespace.isEmpty())
|
||||
str.remove(qtNamespace);
|
||||
@@ -1055,7 +1055,7 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const
|
||||
}
|
||||
|
||||
case Qt::ToolTipRole:
|
||||
return boolSetting(UseToolTipsInLocalsView)
|
||||
return debuggerSettings()->useToolTipsInLocalsView.value()
|
||||
? item->toToolTip() : QVariant();
|
||||
|
||||
case Qt::ForegroundRole:
|
||||
@@ -1757,12 +1757,13 @@ bool WatchModel::contextMenuEvent(const ItemViewEvent &ev)
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
menu->addAction(action(UseDebuggingHelpers)->action());
|
||||
menu->addAction(action(UseToolTipsInLocalsView)->action());
|
||||
menu->addAction(action(AutoDerefPointers)->action());
|
||||
menu->addAction(action(SortStructMembers)->action());
|
||||
menu->addAction(action(UseDynamicType)->action());
|
||||
menu->addAction(action(SettingsDialog)->action());
|
||||
DebuggerSettings &s = *debuggerSettings();
|
||||
menu->addAction(s.useDebuggingHelpers.action());
|
||||
menu->addAction(s.useToolTipsInLocalsView.action());
|
||||
menu->addAction(s.autoDerefPointers.action());
|
||||
menu->addAction(s.sortStructMembers.action());
|
||||
menu->addAction(s.useDynamicType.action());
|
||||
menu->addAction(s.settingsDialog.action());
|
||||
|
||||
connect(menu, &QMenu::aboutToHide, menu, &QObject::deleteLater);
|
||||
menu->popup(ev.globalPos());
|
||||
@@ -2114,7 +2115,7 @@ void WatchHandler::insertItems(const GdbMi &data)
|
||||
{
|
||||
QSet<WatchItem *> itemsToSort;
|
||||
|
||||
const bool sortStructMembers = boolSetting(SortStructMembers);
|
||||
const bool sortStructMembers = debuggerSettings()->sortStructMembers.value();
|
||||
for (const GdbMi &child : data) {
|
||||
auto item = new WatchItem;
|
||||
item->parse(child, sortStructMembers);
|
||||
@@ -2255,7 +2256,7 @@ void WatchHandler::notifyUpdateFinished()
|
||||
});
|
||||
|
||||
QMap<QString, QString> values;
|
||||
if (boolSetting(UseAnnotationsInMainEditor)) {
|
||||
if (debuggerSettings()->useAnnotationsInMainEditor.value()) {
|
||||
m_model->forAllItems([&values](WatchItem *item) {
|
||||
const QString expr = item->sourceExpression();
|
||||
if (!expr.isEmpty())
|
||||
|
@@ -30,8 +30,8 @@
|
||||
#include "debuggercore.h"
|
||||
#include "watchhandler.h"
|
||||
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/savedaction.h>
|
||||
|
||||
#include <QHeaderView>
|
||||
#include <QScrollBar>
|
||||
@@ -54,7 +54,7 @@ WatchTreeView::WatchTreeView(WatchType type)
|
||||
connect(this, &QTreeView::expanded, this, &WatchTreeView::expandNode);
|
||||
connect(this, &QTreeView::collapsed, this, &WatchTreeView::collapseNode);
|
||||
|
||||
connect(action(LogTimeStamps)->action(), &QAction::triggered,
|
||||
connect(&debuggerSettings()->logTimeStamps, &Utils::BaseAspect::changed,
|
||||
this, &WatchTreeView::updateTimeColumn);
|
||||
}
|
||||
|
||||
@@ -106,7 +106,8 @@ void WatchTreeView::setModel(QAbstractItemModel *model)
|
||||
void WatchTreeView::updateTimeColumn()
|
||||
{
|
||||
if (header())
|
||||
header()->setSectionHidden(WatchModelBase::TimeColumn, !boolSetting(LogTimeStamps));
|
||||
header()->setSectionHidden(WatchModelBase::TimeColumn,
|
||||
debuggerSettings()->logTimeStamps.value());
|
||||
}
|
||||
|
||||
void WatchTreeView::handleItemIsExpanded(const QModelIndex &idx)
|
||||
|
Reference in New Issue
Block a user