BareMetal: add variable support for device gdb commands

Change-Id: I192ccf4dc7a2599ead1fcdd11a4d59f0e22e3e1d
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Tim Sander
2014-06-05 10:33:23 +02:00
committed by hjk
parent 9ed5e8080d
commit b7b8c47bdb
7 changed files with 33 additions and 7 deletions

View File

@@ -64,6 +64,8 @@ const char QML_UPDATE_ON_SAVE[] = "Debugger.QmlUpdateOnSave";
const char QML_SELECTTOOL[] = "Debugger.QmlSelectTool";
const char QML_ZOOMTOOL[] = "Debugger.QmlZoomTool";
// VariableManager Prefix
const char PrefixDebugExecutable[] = "DebuggedExecutable";
const char TASK_CATEGORY_DEBUGGER_DEBUGINFO[] = "Debuginfo";
const char TASK_CATEGORY_DEBUGGER_RUNTIME[] = "DebugRuntime";

View File

@@ -172,6 +172,11 @@ public:
connect(&m_locationTimer, SIGNAL(timeout()), SLOT(resetLocation()));
connect(debuggerCore()->action(IntelFlavor), SIGNAL(valueChanged(QVariant)),
SLOT(reloadDisassembly()));
Core::VariableManager::registerFileVariables(Constants::PrefixDebugExecutable,
tr("Debugged executable"));
connect(Core::VariableManager::instance(),
SIGNAL(variableUpdateRequested(QByteArray)),
SLOT(updateVariable(QByteArray)));
}
public slots:
@@ -183,6 +188,13 @@ public slots:
void doInterruptInferior();
void doFinishDebugger();
void updateVariable(QByteArray variable) {
if (Core::VariableManager::isFileVariable(variable, Constants::PrefixDebugExecutable)) {
VariableManager::insert(variable, Core::VariableManager::fileVariableValue(variable,
Constants::PrefixDebugExecutable, QFileInfo(m_startParameters.executable)));
}
}
void reloadDisassembly()
{
m_disassemblerAgent.reload();
@@ -305,6 +317,7 @@ public:
bool m_isStateDebugging;
Utils::FileInProjectFinder m_fileFinder;
};

View File

@@ -34,6 +34,7 @@
#include "debuggerconstants.h"
#include "breakpoint.h" // For BreakpointModelId.
#include "threaddata.h" // For ThreadId.
#include "coreplugin/variablemanager.h"
#include <QObject>

View File

@@ -4460,7 +4460,8 @@ void GdbEngine::handleInferiorPrepared()
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
if (!sp.commandsAfterConnect.isEmpty()) {
foreach (QByteArray command, sp.commandsAfterConnect.split('\n')) {
QByteArray substitutedCommands = Core::VariableManager::expandedString(QString::fromLatin1(sp.commandsAfterConnect)).toLatin1();
foreach (QByteArray command, substitutedCommands.split('\n')) {
postCommand(command);
}
}