Commit 5ac407ee authored by hjk's avatar hjk
Browse files

Debugger: Reduce line noise



Move some function out of the DebuggerCore "namespace", to avoid one
indirection and removes clutter in the calling code.

Change-Id: I1c870d5c7eeade32fa63dedf581490fbb090cd6a
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 15fcdabc
......@@ -336,15 +336,14 @@ void BreakHandler::saveBreakpoints()
map.insert(_("message"), data.message);
list.append(map);
}
DebuggerCore::setSessionValue("Breakpoints", list);
setSessionValue("Breakpoints", list);
//qDebug() << "SAVED BREAKPOINTS" << this << list.size();
}
void BreakHandler::loadBreakpoints()
{
QTC_ASSERT(debuggerCore(), return);
//qDebug() << "LOADING BREAKPOINTS...";
QVariant value = DebuggerCore::sessionValue("Breakpoints");
QVariant value = sessionValue("Breakpoints");
QList<QVariant> list = value.toList();
//clear();
foreach (const QVariant &var, list) {
......@@ -686,7 +685,7 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
}
switch (role) {
case Qt::ToolTipRole:
if (debuggerCore()->boolSetting(UseToolTipsInBreakpointsView))
if (boolSetting(UseToolTipsInBreakpointsView))
return QVariant(it->toToolTip());
break;
}
......@@ -1217,7 +1216,7 @@ void BreakHandler::gotoLocation(BreakpointModelId id) const
{
ConstIterator it = m_storage.find(id);
BREAK_ASSERT(it != m_storage.end(), return);
DebuggerEngine *engine = debuggerCore()->currentEngine();
DebuggerEngine *engine = currentEngine();
if (it->data.type == BreakpointByAddress) {
if (engine)
engine->gotoLocation(it->data.address);
......
......@@ -655,7 +655,7 @@ MultiBreakPointsDialog::MultiBreakPointsDialog(QWidget *parent) :
m_buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
QFormLayout *formLayout = new QFormLayout;
if (debuggerCore()->currentEngine()->hasCapability(BreakConditionCapability))
if (currentEngine()->hasCapability(BreakConditionCapability))
formLayout->addRow(tr("&Condition:"), m_lineEditCondition);
formLayout->addRow(tr("&Ignore count:"), m_spinBoxIgnoreCount);
formLayout->addRow(tr("&Thread specification:"), m_lineEditThreadSpec);
......@@ -678,7 +678,7 @@ BreakTreeView::BreakTreeView()
{
setWindowIcon(QIcon(QLatin1String(":/debugger/images/debugger_breakpoints.png")));
setSelectionMode(QAbstractItemView::ExtendedSelection);
connect(debuggerCore()->action(UseAddressInBreakpointsView),
connect(action(UseAddressInBreakpointsView),
SIGNAL(toggled(bool)), SLOT(showAddressColumn(bool)));
}
......@@ -816,11 +816,11 @@ void BreakTreeView::contextMenuEvent(QContextMenuEvent *ev)
menu.addSeparator();
menu.addAction(synchronizeAction);
menu.addSeparator();
menu.addAction(debuggerCore()->action(UseToolTipsInBreakpointsView));
if (debuggerCore()->currentEngine()->hasCapability(MemoryAddressCapability))
menu.addAction(debuggerCore()->action(UseAddressInBreakpointsView));
menu.addAction(action(UseToolTipsInBreakpointsView));
if (currentEngine()->hasCapability(MemoryAddressCapability))
menu.addAction(action(UseAddressInBreakpointsView));
menu.addSeparator();
menu.addAction(debuggerCore()->action(SettingsDialog));
menu.addAction(action(SettingsDialog));
QAction *act = menu.exec(ev->globalPos());
......
......@@ -195,7 +195,7 @@ namespace Internal {
static inline bool isCreatorConsole(const DebuggerStartParameters &sp)
{
return !debuggerCore()->boolSetting(UseCdbConsole) && sp.useTerminal
return !boolSetting(UseCdbConsole) && sp.useTerminal
&& (sp.startMode == StartInternal || sp.startMode == StartExternal);
}
......@@ -345,11 +345,11 @@ CdbEngine::CdbEngine(const DebuggerStartParameters &sp) :
m_watchPointY(0),
m_ignoreCdbOutput(false)
{
connect(debuggerCore()->action(OperateByInstruction), SIGNAL(triggered(bool)),
connect(action(OperateByInstruction), SIGNAL(triggered(bool)),
this, SLOT(operateByInstructionTriggered(bool)));
connect(debuggerCore()->action(VerboseLog), SIGNAL(triggered(bool)),
connect(action(VerboseLog), SIGNAL(triggered(bool)),
this, SLOT(verboseLogTriggered(bool)));
connect(debuggerCore()->action(CreateFullBacktrace), SIGNAL(triggered()),
connect(action(CreateFullBacktrace), SIGNAL(triggered()),
this, SLOT(createFullBacktrace()));
setObjectName(QLatin1String("CdbEngine"));
connect(&m_process, SIGNAL(finished(int)), this, SLOT(processFinished()));
......@@ -366,8 +366,8 @@ void CdbEngine::init()
m_specialStopMode = NoSpecialStop;
m_nextCommandToken = 0;
m_currentBuiltinCommandIndex = -1;
m_operateByInstructionPending = debuggerCore()->action(OperateByInstruction)->isChecked();
m_verboseLogPending = debuggerCore()->boolSetting(VerboseLog);
m_operateByInstructionPending = action(OperateByInstruction)->isChecked();
m_verboseLogPending = boolSetting(VerboseLog);
m_operateByInstruction = true; // Default CDB setting
m_verboseLog = false; // Default CDB setting
m_notifyEngineShutdownOnTermination = false;
......@@ -597,9 +597,9 @@ void CdbEngine::setupEngine()
if (debug)
qDebug(">setupEngine");
// Nag to add symbol server and cache
QStringList symbolPaths = debuggerCore()->stringListSetting(CdbSymbolPaths);
QStringList symbolPaths = stringListSetting(CdbSymbolPaths);
if (CdbSymbolPathListEditor::promptToAddSymbolPaths(&symbolPaths))
debuggerCore()->action(CdbSymbolPaths)->setValue(symbolPaths);
action(CdbSymbolPaths)->setValue(symbolPaths);
init();
if (!m_logTime.elapsed())
......@@ -680,18 +680,18 @@ bool CdbEngine::launchCDB(const DebuggerStartParameters &sp, QString *errorMessa
<< QLatin1String(".idle_cmd ") + QString::fromLatin1(m_extensionCommandPrefixBA) + QLatin1String("idle");
if (sp.useTerminal) // Separate console
arguments << QLatin1String("-2");
if (debuggerCore()->boolSetting(IgnoreFirstChanceAccessViolation))
if (boolSetting(IgnoreFirstChanceAccessViolation))
arguments << QLatin1String("-x");
const QStringList &symbolPaths = debuggerCore()->stringListSetting(CdbSymbolPaths);
const QStringList &symbolPaths = stringListSetting(CdbSymbolPaths);
if (!symbolPaths.isEmpty())
arguments << QLatin1String("-y") << symbolPaths.join(QString(QLatin1Char(';')));
const QStringList &sourcePaths = debuggerCore()->stringListSetting(CdbSourcePaths);
const QStringList &sourcePaths = stringListSetting(CdbSourcePaths);
if (!sourcePaths.isEmpty())
arguments << QLatin1String("-srcpath") << sourcePaths.join(QString(QLatin1Char(';')));
// Compile argument string preserving quotes
QString nativeArguments = debuggerCore()->stringSetting(CdbAdditionalArguments);
QString nativeArguments = stringSetting(CdbAdditionalArguments);
switch (sp.startMode) {
case StartInternal:
case StartExternal:
......@@ -786,9 +786,9 @@ void CdbEngine::setupInferior()
postCommand("sxn ibp", 0); // Do not break on initial breakpoints.
postCommand(".asm source_line", 0); // Source line in assembly
postCommand(m_extensionCommandPrefixBA + "setparameter maxStringLength="
+ debuggerCore()->action(MaximalStringLength)->value().toByteArray()
+ action(MaximalStringLength)->value().toByteArray()
+ " maxStackDepth="
+ debuggerCore()->action(MaximalStackDepth)->value().toByteArray()
+ action(MaximalStackDepth)->value().toByteArray()
, 0);
postExtensionCommand("pid", QByteArray(), 0, &CdbEngine::handlePid);
}
......@@ -827,13 +827,12 @@ void CdbEngine::runEngine()
if (debug)
qDebug("runEngine");
const QStringList &breakEvents =
debuggerCore()->stringListSetting(CdbBreakEvents);
const QStringList breakEvents = stringListSetting(CdbBreakEvents);
foreach (const QString &breakEvent, breakEvents)
postCommand(QByteArray("sxe ") + breakEvent.toLatin1(), 0);
// Break functions: each function must be fully qualified,
// else the debugger will slow down considerably.
if (debuggerCore()->boolSetting(CdbBreakOnCrtDbgReport)) {
if (boolSetting(CdbBreakOnCrtDbgReport)) {
const QByteArray module = msvcRunTime(startParameters().toolChainAbi.osFlavor());
const QByteArray debugModule = module + 'D';
const QByteArray wideFunc = QByteArray(CdbOptionsPage::crtDbgReport).append('W');
......@@ -846,13 +845,13 @@ void CdbEngine::runEngine()
postBuiltinCommand(breakAtFunctionCommand(wideFunc, debugModule), 0,
&CdbEngine::handleBreakInsert);
}
if (debuggerCore()->boolSetting(BreakOnWarning)) {
if (boolSetting(BreakOnWarning)) {
postBuiltinCommand("bm /( QtCored4!qWarning", 0,
&CdbEngine::handleBreakInsert); // 'bm': All overloads.
postBuiltinCommand("bm /( Qt5Cored!QMessageLogger::warning", 0,
&CdbEngine::handleBreakInsert);
}
if (debuggerCore()->boolSetting(BreakOnFatal)) {
if (boolSetting(BreakOnFatal)) {
postBuiltinCommand("bm /( QtCored4!qFatal", 0,
&CdbEngine::handleBreakInsert); // 'bm': All overloads.
postBuiltinCommand("bm /( Qt5Cored!QMessageLogger::fatal", 0,
......@@ -1061,9 +1060,9 @@ void CdbEngine::handleAddWatch(const CdbExtensionCommandPtr &reply)
void CdbEngine::addLocalsOptions(ByteArrayInputStream &str) const
{
if (debuggerCore()->boolSetting(VerboseLog))
if (boolSetting(VerboseLog))
str << blankSeparator << "-v";
if (debuggerCore()->boolSetting(UseDebuggingHelpers))
if (boolSetting(UseDebuggingHelpers))
str << blankSeparator << "-c";
const QByteArray typeFormats = watchHandler()->typeFormatRequests();
if (!typeFormats.isEmpty())
......@@ -1521,7 +1520,7 @@ void CdbEngine::updateLocals(bool forNewStackFrame)
addLocalsOptions(str);
// Uninitialized variables if desired. Quote as safeguard against shadowed
// variables in case of errors in uninitializedVariables().
if (debuggerCore()->boolSetting(UseCodeModel)) {
if (boolSetting(UseCodeModel)) {
QStringList uninitializedVariables;
getUninitializedVariables(debuggerCore()->cppCodeModelSnapshot(),
frame.function, frame.file, frame.line, &uninitializedVariables);
......@@ -1932,7 +1931,7 @@ void CdbEngine::handleLocals(const CdbExtensionCommandPtr &reply)
{
const int flags = reply->cookie.toInt();
if (reply->success) {
if (debuggerCore()->boolSetting(VerboseLog))
if (boolSetting(VerboseLog))
showMessage(QLatin1String("Locals: ") + QString::fromLatin1(reply->reply), LogDebug);
QList<WatchData> watchData;
WatchHandler *handler = watchHandler();
......@@ -2915,7 +2914,7 @@ void CdbEngine::attemptBreakpointSynchronization()
case BreakpointInsertRequested:
if (!m_autoBreakPointCorrection
&& parameters.type == BreakpointByFileAndLine
&& debuggerCore()->boolSetting(CdbBreakPointCorrection)) {
&& boolSetting(CdbBreakPointCorrection)) {
if (lineCorrection.isNull())
lineCorrection.reset(new BreakpointCorrectionContext(debuggerCore()->cppCodeModelSnapshot(),
CppTools::CppModelManagerInterface::instance()->workingCopy()));
......
......@@ -182,15 +182,14 @@ CdbOptionsPageWidget::CdbOptionsPageWidget(QWidget *parent)
m_ui.breakCrtDbgReportCheckBox
->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(CdbOptionsPage::crtDbgReport, hint));
DebuggerCore *dc = debuggerCore();
group.insert(dc->action(CdbAdditionalArguments), m_ui.additionalArgumentsLineEdit);
group.insert(dc->action(CdbBreakOnCrtDbgReport), m_ui.breakCrtDbgReportCheckBox);
group.insert(dc->action(UseCdbConsole), m_ui.consoleCheckBox);
group.insert(dc->action(CdbBreakPointCorrection), m_ui.breakpointCorrectionCheckBox);
group.insert(dc->action(IgnoreFirstChanceAccessViolation),
group.insert(action(CdbAdditionalArguments), m_ui.additionalArgumentsLineEdit);
group.insert(action(CdbBreakOnCrtDbgReport), m_ui.breakCrtDbgReportCheckBox);
group.insert(action(UseCdbConsole), m_ui.consoleCheckBox);
group.insert(action(CdbBreakPointCorrection), m_ui.breakpointCorrectionCheckBox);
group.insert(action(IgnoreFirstChanceAccessViolation),
m_ui.ignoreFirstChanceAccessViolationCheckBox);
m_breakEventWidget->setBreakEvents(dc->stringListSetting(CdbBreakEvents));
m_breakEventWidget->setBreakEvents(stringListSetting(CdbBreakEvents));
}
QStringList CdbOptionsPageWidget::breakEvents() const
......@@ -226,7 +225,7 @@ void CdbOptionsPage::apply()
if (!m_widget)
return;
m_widget->group.apply(Core::ICore::settings());
debuggerCore()->action(CdbBreakEvents)->setValue(m_widget->breakEvents());
action(CdbBreakEvents)->setValue(m_widget->breakEvents());
}
void CdbOptionsPage::finish()
......@@ -274,9 +273,8 @@ CdbPathsPageWidget::CdbPathsPageWidget(QWidget *parent) :
layout->addWidget(gbSymbolPath);
layout->addWidget(gbSourcePath);
DebuggerCore *dc = debuggerCore();
group.insert(dc->action(CdbSymbolPaths), m_symbolPathListEditor);
group.insert(dc->action(CdbSourcePaths), m_sourcePathListEditor);
group.insert(action(CdbSymbolPaths), m_symbolPathListEditor);
group.insert(action(CdbSourcePaths), m_sourcePathListEditor);
}
CdbPathsPage::CdbPathsPage()
......
......@@ -175,48 +175,47 @@ CommonOptionsPageWidget::CommonOptionsPageWidget
verticalLayout->addWidget(sourcesMappingWidget);
verticalLayout->addStretch();
DebuggerCore *dc = debuggerCore();
m_group->clear();
m_group->insert(dc->action(ListSourceFiles),
m_group->insert(action(ListSourceFiles),
checkBoxListSourceFiles);
m_group->insert(dc->action(UseAlternatingRowColors),
m_group->insert(action(UseAlternatingRowColors),
checkBoxUseAlternatingRowColors);
m_group->insert(dc->action(UseToolTipsInMainEditor),
m_group->insert(action(UseToolTipsInMainEditor),
checkBoxUseToolTipsInMainEditor);
m_group->insert(dc->action(CloseBuffersOnExit),
m_group->insert(action(CloseBuffersOnExit),
checkBoxCloseBuffersOnExit);
m_group->insert(dc->action(SwitchModeOnExit),
m_group->insert(action(SwitchModeOnExit),
checkBoxSwitchModeOnExit);
m_group->insert(dc->action(BreakpointsFullPathByDefault),
m_group->insert(action(BreakpointsFullPathByDefault),
checkBoxBreakpointsFullPath);
m_group->insert(dc->action(RaiseOnInterrupt),
m_group->insert(action(RaiseOnInterrupt),
checkBoxBringToForegroundOnInterrrupt);
m_group->insert(dc->action(ShowQmlObjectTree),
m_group->insert(action(ShowQmlObjectTree),
checkBoxShowQmlObjectTree);
m_group->insert(dc->action(WarnOnReleaseBuilds),
m_group->insert(action(WarnOnReleaseBuilds),
checkBoxWarnOnReleaseBuilds);
m_group->insert(dc->action(StationaryEditorWhileStepping),
m_group->insert(action(StationaryEditorWhileStepping),
checkBoxKeepEditorStationaryWhileStepping);
m_group->insert(dc->action(FontSizeFollowsEditor),
m_group->insert(action(FontSizeFollowsEditor),
checkBoxFontSizeFollowsEditor);
m_group->insert(dc->action(AutoDerefPointers), 0);
m_group->insert(dc->action(UseToolTipsInLocalsView), 0);
m_group->insert(dc->action(AlwaysAdjustColumnWidths), 0);
m_group->insert(dc->action(UseToolTipsInBreakpointsView), 0);
m_group->insert(dc->action(UseToolTipsInStackView), 0);
m_group->insert(dc->action(UseAddressInBreakpointsView), 0);
m_group->insert(dc->action(UseAddressInStackView), 0);
m_group->insert(dc->action(MaximalStackDepth), spinBoxMaximalStackDepth);
m_group->insert(dc->action(ShowStdNamespace), 0);
m_group->insert(dc->action(ShowQtNamespace), 0);
m_group->insert(dc->action(SortStructMembers), 0);
m_group->insert(dc->action(LogTimeStamps), 0);
m_group->insert(dc->action(VerboseLog), 0);
m_group->insert(dc->action(BreakOnThrow), 0);
m_group->insert(dc->action(BreakOnCatch), 0);
m_group->insert(action(AutoDerefPointers), 0);
m_group->insert(action(UseToolTipsInLocalsView), 0);
m_group->insert(action(AlwaysAdjustColumnWidths), 0);
m_group->insert(action(UseToolTipsInBreakpointsView), 0);
m_group->insert(action(UseToolTipsInStackView), 0);
m_group->insert(action(UseAddressInBreakpointsView), 0);
m_group->insert(action(UseAddressInStackView), 0);
m_group->insert(action(MaximalStackDepth), spinBoxMaximalStackDepth);
m_group->insert(action(ShowStdNamespace), 0);
m_group->insert(action(ShowQtNamespace), 0);
m_group->insert(action(SortStructMembers), 0);
m_group->insert(action(LogTimeStamps), 0);
m_group->insert(action(VerboseLog), 0);
m_group->insert(action(BreakOnThrow), 0);
m_group->insert(action(BreakOnCatch), 0);
if (Utils::HostOsInfo::isWindowsHost()) {
Utils::SavedAction *registerAction = dc->action(RegisterForPostMortem);
Utils::SavedAction *registerAction = action(RegisterForPostMortem);
m_group->insert(registerAction,
checkBoxRegisterForPostMortem);
connect(registerAction, SIGNAL(toggled(bool)),
......@@ -340,7 +339,6 @@ QWidget *LocalsAndExpressionsOptionsPage::widget()
{
if (!m_widget) {
m_widget = new QWidget;
DebuggerCore *dc = debuggerCore();
auto debuggingHelperGroupBox = new QGroupBox(m_widget);
debuggingHelperGroupBox->setTitle(tr("Use Debugging Helper"));
......@@ -357,7 +355,7 @@ QWidget *LocalsAndExpressionsOptionsPage::widget()
auto checkBoxUseCodeModel = new QCheckBox(debuggingHelperGroupBox);
checkBoxUseCodeModel->setText(tr("Use code model"));
checkBoxUseCodeModel->setToolTip(dc->action(UseCodeModel)->toolTip());
checkBoxUseCodeModel->setToolTip(action(UseCodeModel)->toolTip());
checkBoxUseCodeModel->setToolTip(tr("Makes use of Qt Creator's code model "
"to find out if a variable has already been assigned a "
"value at the point the debugger interrupts."));
......@@ -409,13 +407,13 @@ QWidget *LocalsAndExpressionsOptionsPage::widget()
layout->addStretch();
m_group.clear();
m_group.insert(dc->action(UseDebuggingHelpers), debuggingHelperGroupBox);
m_group.insert(dc->action(UseCodeModel), checkBoxUseCodeModel);
m_group.insert(dc->action(ShowThreadNames), checkBoxShowThreadNames);
m_group.insert(dc->action(ShowStdNamespace), checkBoxShowStdNamespace);
m_group.insert(dc->action(ShowQtNamespace), checkBoxShowQtNamespace);
m_group.insert(dc->action(DisplayStringLimit), spinBoxDisplayStringLimit);
m_group.insert(dc->action(MaximalStringLength), spinBoxMaximalStringLength);
m_group.insert(action(UseDebuggingHelpers), debuggingHelperGroupBox);
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(DisplayStringLimit), spinBoxDisplayStringLimit);
m_group.insert(action(MaximalStringLength), spinBoxMaximalStringLength);
#ifndef QT_DEBUG
#if 0
......
......@@ -57,7 +57,6 @@ class DebuggerEngine;
namespace Internal {
class BreakHandler;
class SnapshotHandler;
class Symbol;
class Section;
class GlobalDebuggerOptions;
......@@ -75,20 +74,12 @@ class DebuggerCore : public QObject
public:
DebuggerCore() {}
static QVariant sessionValue(const QByteArray &name);
static void setSessionValue(const QByteArray &name, const QVariant &value);
static QVariant configValue(const QByteArray &name);
static void setConfigValue(const QByteArray &name, const QVariant &value);
virtual void updateState(DebuggerEngine *engine) = 0;
virtual void updateWatchersWindow(bool showWatch, bool showReturn) = 0;
virtual QIcon locationMarkIcon() const = 0;
virtual const CPlusPlus::Snapshot &cppCodeModelSnapshot() const = 0;
virtual bool hasSnapshots() const = 0;
virtual void openTextEditor(const QString &titlePattern, const QString &contents) = 0;
virtual BreakHandler *breakHandler() const = 0;
virtual SnapshotHandler *snapshotHandler() const = 0;
virtual DebuggerEngine *currentEngine() const = 0;
virtual bool isActiveDebugLanguage(int language) const = 0;
// void runTest(const QString &fileName);
......@@ -104,8 +95,6 @@ public:
virtual bool initialize(const QStringList &arguments, QString *errorMessage) = 0;
virtual QWidget *mainWindow() const = 0;
virtual bool isDockVisible(const QString &objectName) const = 0;
// virtual QString debuggerForAbi(const ProjectExplorer::Abi &abi,
// DebuggerEngineType et = NoEngineType) const = 0;
virtual void showModuleSymbols(const QString &moduleName,
const QVector<Symbol> &symbols) = 0;
virtual void showModuleSections(const QString &moduleName,
......@@ -113,10 +102,6 @@ public:
virtual void openMemoryEditor() = 0;
virtual void languagesChanged() = 0;
virtual Utils::SavedAction *action(int code) const = 0;
virtual bool boolSetting(int code) const = 0;
virtual QString stringSetting(int code) const = 0;
virtual QStringList stringListSetting(int code) const = 0;
virtual void setThreads(const QStringList &list, int index) = 0;
virtual QSharedPointer<GlobalDebuggerOptions> globalDebuggerOptions() const = 0;
......@@ -127,9 +112,23 @@ public slots:
virtual void attachExternalApplication(ProjectExplorer::RunControl *rc) = 0;
};
// Some convenience.
QVariant sessionValue(const QByteArray &name);
void setSessionValue(const QByteArray &name, const QVariant &value);
QVariant configValue(const QByteArray &name);
void setConfigValue(const QByteArray &name, const QVariant &value);
Utils::SavedAction *action(int code);
bool boolSetting(int code);
QString stringSetting(int code);
QStringList stringListSetting(int code);
BreakHandler *breakHandler();
DebuggerEngine *currentEngine();
// This is the only way to access the global object.
DebuggerCore *debuggerCore();
inline BreakHandler *breakHandler() { return debuggerCore()->breakHandler(); }
QMessageBox *showMessageBox(int icon, const QString &title,
const QString &text, int buttons = 0);
......
......@@ -174,7 +174,7 @@ public:
m_isStateDebugging(false)
{
connect(&m_locationTimer, SIGNAL(timeout()), SLOT(resetLocation()));
connect(debuggerCore()->action(IntelFlavor), SIGNAL(valueChanged(QVariant)),
connect(action(IntelFlavor), SIGNAL(valueChanged(QVariant)),
SLOT(reloadDisassembly()));
VariableManager::registerFileVariables(PrefixDebugExecutable,
......@@ -521,8 +521,7 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
if (!d->m_startParameters.environment.size())
d->m_startParameters.environment = Utils::Environment();
debuggerCore()->action(OperateByInstruction)
->setEnabled(hasCapability(DisassemblerCapability));
action(OperateByInstruction)->setEnabled(hasCapability(DisassemblerCapability));
QTC_ASSERT(state() == DebuggerNotReady || state() == DebuggerFinished,
qDebug() << state());
......@@ -543,7 +542,7 @@ void DebuggerEngine::gotoLocation(const Location &loc)
d->resetLocation();
if ((hasCapability(OperateByInstructionCapability) &&
debuggerCore()->boolSetting(OperateByInstruction)) || !loc.hasDebugInfo()) {
boolSetting(OperateByInstruction)) || !loc.hasDebugInfo()) {
d->m_disassemblerAgent.setLocation(loc);
return;
}
......@@ -559,7 +558,7 @@ void DebuggerEngine::gotoLocation(const Location &loc)
EditorManager::IgnoreNavigationHistory, &newEditor);
QTC_ASSERT(editor, return); // Unreadable file?
editor->gotoLine(line, 0, !debuggerCore()->boolSetting(StationaryEditorWhileStepping));
editor->gotoLine(line, 0, !boolSetting(StationaryEditorWhileStepping));
if (newEditor)
editor->document()->setProperty(Constants::OPENED_BY_DEBUGGER, true);
......@@ -953,7 +952,7 @@ void DebuggerEngine::notifyInferiorSpontaneousStop()
QTC_ASSERT(state() == InferiorRunOk, qDebug() << this << state());
showStatusMessage(tr("Stopped."));
setState(InferiorStopOk);
if (debuggerCore()->boolSetting(RaiseOnInterrupt))
if (boolSetting(RaiseOnInterrupt))
ICore::raiseWindow(debuggerCore()->mainWindow());
}
......@@ -1620,7 +1619,7 @@ void DebuggerEngine::executeDebuggerCommand(const QString &, DebuggerLanguages)
BreakHandler *DebuggerEngine::breakHandler() const
{
return debuggerCore()->breakHandler();
return Internal::breakHandler();
}
bool DebuggerEngine::isDying() const
......@@ -1752,7 +1751,7 @@ void DebuggerEngine::setStateDebugging(bool on)
void DebuggerEngine::checkForReleaseBuild(const DebuggerStartParameters &sp)
{
if (!debuggerCore()->boolSetting(WarnOnReleaseBuilds) || !(sp.languages & CppLanguage))
if (!boolSetting(WarnOnReleaseBuilds) || !(sp.languages & CppLanguage))
return;
QString binary = sp.executable;
if (binary.isEmpty())
......
......@@ -533,7 +533,7 @@ public:
static QWidget *addSearch(BaseTreeView *treeView, const QString &title,
const char *objectName)
{
QAction *act = debuggerCore()->action(UseAlternatingRowColors);
QAction *act = action(UseAlternatingRowColors);
treeView->setAlternatingRowColors(act->isChecked());
QObject::connect(act, SIGNAL(toggled(bool)),
treeView, SLOT(setAlternatingRowColorsHelper(bool)));
......@@ -715,7 +715,6 @@ public:
void connectEngine(DebuggerEngine *engine);
void disconnectEngine() { connectEngine(0); }
DebuggerEngine *currentEngine() const { return m_currentEngine; }
DebuggerEngine *dummyEngine();
void setThreads(const QStringList &list, int index)
......@@ -897,9 +896,6 @@ public slots:
bool isReverseDebugging() const;
BreakHandler *breakHandler() const { return m_breakHandler; }
SnapshotHandler *snapshotHandler() const { return m_snapshotHandler; }
void displayDebugger(DebuggerEngine *engine, bool updateEngine = true);
void dumpLog();
......@@ -1158,11 +1154,6 @@ public slots:
void openTextEditor(const QString &titlePattern0, const QString &contents);
void showMessage(const QString &msg, int channel, int timeout = -1);
SavedAction *action(int code) const;
bool boolSetting(int code) const;
QString stringSetting(int code) const;
QStringList stringListSetting(int code) const;
void showModuleSymbols(const QString &moduleName, const Symbols &symbols);
void showModuleSections(const QString &moduleName, const Sections &sections);
......@@ -1497,12 +1488,12 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
return true;
}
void DebuggerCore::setConfigValue(const QByteArray &name, const QVariant &value)
void setConfigValue(const QByteArray &name, const QVariant &value)
{
ICore::settings()->setValue(_("DebugMode/" + name), value);
}
QVariant DebuggerCore::configValue(const QByteArray &name)
QVariant configValue(const QByteArray &name)
{
return ICore::settings()->value(_("DebugMode/" + name));
}
......@@ -2029,7 +2020,7 @@ void DebuggerPluginPrivate::toggleBreakpointByFileAndLine(const QString &fileNam
handler->removeBreakpoint(id);
} else {
BreakpointParameters data(BreakpointByFileAndLine);
if (debuggerCore()->boolSetting(BreakpointsFullPathByDefault))
if (boolSetting(BreakpointsFullPathByDefault))
data.pathUsage = BreakpointUseFullPath;
data.tracepoint = !tracePointMessage.isEmpty();
data.message = tracePointMessage;
......@@ -2536,12 +2527,12 @@ const CPlusPlus::Snapshot &DebuggerPluginPrivate::cppCodeModelSnapshot() const
return m_codeModelSnapshot;
}
void DebuggerCore::setSessionValue(const QByteArray &key, const QVariant &value)
void setSessionValue(const QByteArray &key, const QVariant &value)
{
SessionManager::setValue(QString::fromUtf8(key), value);
}