Commit e539f5bd authored by hjk's avatar hjk
Browse files

debugger: take advantage of the fact that the trkadapter has often up-to-date

register data
parent 520bb366
......@@ -96,6 +96,7 @@ class CdbExceptionLoggerEventCallback;
class GdbEngine;
class CdbDebugEngine;
class CdbDebugEnginePrivate;
class TrkGdbAdapter;
} // namespace Internal
class DEBUGGER_EXPORT DebuggerStartParameters
......@@ -171,6 +172,7 @@ public:
friend class Internal::ScriptEngine;
friend class Internal::CdbDebugEngine;
friend class Internal::CdbDebugEnginePrivate;
friend class Internal::TrkGdbAdapter;
DebuggerState state() const;
QList<Core::IOptionsPage*> initializeEngines(unsigned enabledTypeFlags);
......
......@@ -57,7 +57,8 @@ public:
virtual ~AbstractGdbAdapter();
virtual void write(const QByteArray &data);
virtual bool isTrkAdapter() const; // isUtterlyBrokenAdapter
virtual bool isTrkAdapter() const;
virtual void trkReloadRegisters() {}
virtual void startAdapter() = 0;
virtual void startInferior() = 0;
......
......@@ -2805,11 +2805,7 @@ void GdbEngine::reloadRegisters()
}
if (m_gdbAdapter->isTrkAdapter()) {
// FIXME: remove that special case. This is only to prevent
// gdb from asking for the values of the fixed point registers
postCommand("-data-list-register-values x 0 1 2 3 4 5 6 7 8 9 "
"10 11 12 13 14 15 25",
Discardable, CB(handleRegisterListValues));
m_gdbAdapter->trkReloadRegisters();
} else {
postCommand("-data-list-register-values x",
Discardable, CB(handleRegisterListValues));
......
......@@ -28,12 +28,14 @@
**************************************************************************/
#include "trkgdbadapter.h"
#include "launcher.h"
#include "trkoptions.h"
#include "trkoptionspage.h"
#include "s60debuggerbluetoothstarter.h"
#include "bluetoothlistener_gui.h"
#include "registerhandler.h"
#include "debuggeractions.h"
#include "debuggerstringutils.h"
#ifndef STANDALONE_RUNNER
......@@ -695,7 +697,6 @@ void TrkGdbAdapter::handleGdbServerCommand(const QByteArray &cmd)
sendGdbServerAck();
int pos = cmd.indexOf(',');
//qDebug() << "SAL: " << cmd << cmd.mid(3, pos - 3) << cmd.mid(pos + 1);
bool ok = false;
m_snapshot.lineFromAddress = cmd.mid(3, pos - 3).toUInt(0, 16);
m_snapshot.lineToAddress = cmd.mid(pos + 1).toUInt(0, 16);
//qDebug() << "SAL: " << hexxNumber(m_snapshot.lineFromAddress)
......@@ -2112,5 +2113,28 @@ void TrkGdbAdapter::shutdown()
cleanup();
}
void TrkGdbAdapter::trkReloadRegisters()
{
// Take advantage of direct access to cached register values.
QTC_ASSERT(m_snapshot.registerValid, /**/);
RegisterHandler *handler = m_engine->manager()->registerHandler();
QList<Register> registers = handler->registers();
QTC_ASSERT(registers.size() >= 25, return);
for (int i = 0; i < 16; ++i) {
Register &reg = registers[i];
QString value = hexxNumber(m_snapshot.registers[i]);
reg.changed = (value != reg.value);
if (reg.changed)
reg.value = value;
}
Register &reg = registers[24];
QString value = hexxNumber(m_snapshot.registers[16]);
reg.changed = (value != reg.value);
if (reg.changed)
reg.value = value;
handler->setRegisters(registers);
}
} // namespace Internal
} // namespace Debugger
......@@ -145,6 +145,7 @@ public:
void setVerbose(int verbose);
void setBufferedMemoryRead(bool b) { m_bufferedMemoryRead = b; }
trk::Session &session() { return m_session; }
void trkReloadRegisters();
signals:
void output(const QString &msg);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment