forked from qt-creator/qt-creator
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:
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "debuggerconstants.h"
|
||||
#include "breakpoint.h" // For BreakpointModelId.
|
||||
#include "threaddata.h" // For ThreadId.
|
||||
#include "coreplugin/variablemanager.h"
|
||||
|
||||
#include <QObject>
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user