debugger: s/*ViewAgent/*Agent/ to reduce noise and match file names

This commit is contained in:
hjk
2010-12-14 12:29:32 +01:00
parent b90bb97fa9
commit fb837b5230
17 changed files with 101 additions and 102 deletions

View File

@@ -1361,7 +1361,7 @@ bool CdbEngine::attemptBreakpointSynchronizationI(QString *errorMessage)
return true; return true;
} }
void CdbEngine::fetchDisassembler(DisassemblerViewAgent *agent) void CdbEngine::fetchDisassembler(DisassemblerAgent *agent)
{ {
enum { ContextLines = 40 }; enum { ContextLines = 40 };
QString errorMessage; QString errorMessage;
@@ -1387,7 +1387,7 @@ void CdbEngine::fetchDisassembler(DisassemblerViewAgent *agent)
agent->setContents(lines); agent->setContents(lines);
} }
void CdbEngine::fetchMemory(MemoryViewAgent *agent, QObject *token, quint64 addr, quint64 length) void CdbEngine::fetchMemory(MemoryAgent *agent, QObject *token, quint64 addr, quint64 length)
{ {
if (!m_d->m_hDebuggeeProcess && !length) if (!m_d->m_hDebuggeeProcess && !length)
return; return;

View File

@@ -37,7 +37,7 @@
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
class DisassemblerViewAgent; class DisassemblerAgent;
class CdbDebugEventCallback; class CdbDebugEventCallback;
class CdbDebugOutput; class CdbDebugOutput;
class CdbEnginePrivate; class CdbEnginePrivate;
@@ -88,8 +88,8 @@ public:
virtual void attemptBreakpointSynchronization(); virtual void attemptBreakpointSynchronization();
virtual void setRegisterValue(int regnr, const QString &value); virtual void setRegisterValue(int regnr, const QString &value);
virtual void fetchDisassembler(DisassemblerViewAgent *agent); virtual void fetchDisassembler(DisassemblerAgent *agent);
virtual void fetchMemory(MemoryViewAgent *, QObject *, quint64 addr, quint64 length); virtual void fetchMemory(MemoryAgent *, QObject *, quint64 addr, quint64 length);
virtual void reloadModules(); virtual void reloadModules();
virtual void loadSymbols(const QString &moduleName); virtual void loadSymbols(const QString &moduleName);

View File

@@ -71,8 +71,8 @@
#include <cctype> #include <cctype>
Q_DECLARE_METATYPE(Debugger::Internal::DisassemblerViewAgent*) Q_DECLARE_METATYPE(Debugger::Internal::DisassemblerAgent*)
Q_DECLARE_METATYPE(Debugger::Internal::MemoryViewAgent*) Q_DECLARE_METATYPE(Debugger::Internal::MemoryAgent*)
enum { debug = 0 }; enum { debug = 0 };
enum { debugLocals = 0 }; enum { debugLocals = 0 };
@@ -115,11 +115,11 @@ static const char localsPrefixC[] = "local.";
using namespace Debugger::Internal; using namespace Debugger::Internal;
struct MemoryViewCookie { struct MemoryViewCookie {
explicit MemoryViewCookie(MemoryViewAgent *a = 0, QObject *e = 0, explicit MemoryViewCookie(MemoryAgent *a = 0, QObject *e = 0,
quint64 addr = 0, quint64 l = 0) : quint64 addr = 0, quint64 l = 0) :
agent(a), editorToken(e), address(addr), length(l) {} agent(a), editorToken(e), address(addr), length(l) {}
MemoryViewAgent *agent; MemoryAgent *agent;
QObject *editorToken; QObject *editorToken;
quint64 address; quint64 address;
quint64 length; quint64 length;
@@ -1022,28 +1022,28 @@ void CdbEngine::selectThread(int index)
postBuiltinCommand(cmd, 0, &CdbEngine::dummyHandler, CommandListStack); postBuiltinCommand(cmd, 0, &CdbEngine::dummyHandler, CommandListStack);
} }
void CdbEngine::fetchDisassembler(Debugger::Internal::DisassemblerViewAgent *agent) void CdbEngine::fetchDisassembler(Debugger::Internal::DisassemblerAgent *agent)
{ {
QTC_ASSERT(m_accessible, return;) QTC_ASSERT(m_accessible, return;)
QByteArray cmd; QByteArray cmd;
ByteArrayInputStream str(cmd); ByteArrayInputStream str(cmd);
str << "u " << hex << hexPrefixOn << agent->address() << " L40"; str << "u " << hex << hexPrefixOn << agent->address() << " L40";
const QVariant cookie = qVariantFromValue<Debugger::Internal::DisassemblerViewAgent*>(agent); const QVariant cookie = qVariantFromValue<Debugger::Internal::DisassemblerAgent*>(agent);
postBuiltinCommand(cmd, 0, &CdbEngine::handleDisassembler, 0, cookie); postBuiltinCommand(cmd, 0, &CdbEngine::handleDisassembler, 0, cookie);
} }
// Parse: "00000000`77606060 cc int 3" // Parse: "00000000`77606060 cc int 3"
void CdbEngine::handleDisassembler(const CdbBuiltinCommandPtr &command) void CdbEngine::handleDisassembler(const CdbBuiltinCommandPtr &command)
{ {
QTC_ASSERT(qVariantCanConvert<Debugger::Internal::DisassemblerViewAgent*>(command->cookie), return;) QTC_ASSERT(qVariantCanConvert<Debugger::Internal::DisassemblerAgent*>(command->cookie), return;)
Debugger::Internal::DisassemblerViewAgent *agent = qvariant_cast<Debugger::Internal::DisassemblerViewAgent*>(command->cookie); Debugger::Internal::DisassemblerAgent *agent = qvariant_cast<Debugger::Internal::DisassemblerAgent*>(command->cookie);
DisassemblerLines disassemblerLines; DisassemblerLines disassemblerLines;
foreach(const QByteArray &line, command->reply) foreach(const QByteArray &line, command->reply)
disassemblerLines.appendLine(DisassemblerLine(QString::fromLatin1(line))); disassemblerLines.appendLine(DisassemblerLine(QString::fromLatin1(line)));
agent->setContents(disassemblerLines); agent->setContents(disassemblerLines);
} }
void CdbEngine::fetchMemory(Debugger::Internal::MemoryViewAgent *agent, QObject *editor, quint64 addr, quint64 length) void CdbEngine::fetchMemory(Debugger::Internal::MemoryAgent *agent, QObject *editor, quint64 addr, quint64 length)
{ {
QTC_ASSERT(m_accessible, return;) QTC_ASSERT(m_accessible, return;)
if (debug) if (debug)

View File

@@ -41,7 +41,7 @@
namespace Debugger { namespace Debugger {
namespace Cdb { namespace Cdb {
class DisassemblerViewAgent; class DisassemblerAgent;
struct CdbBuiltinCommand; struct CdbBuiltinCommand;
struct CdbExtensionCommand; struct CdbExtensionCommand;
struct CdbOptions; struct CdbOptions;
@@ -106,8 +106,8 @@ public:
virtual bool acceptsBreakpoint(BreakpointId id) const; virtual bool acceptsBreakpoint(BreakpointId id) const;
virtual void attemptBreakpointSynchronization(); virtual void attemptBreakpointSynchronization();
virtual void fetchDisassembler(Debugger::Internal::DisassemblerViewAgent *agent); virtual void fetchDisassembler(Debugger::Internal::DisassemblerAgent *agent);
virtual void fetchMemory(Debugger::Internal::MemoryViewAgent *, QObject *, quint64 addr, quint64 length); virtual void fetchMemory(Debugger::Internal::MemoryAgent *, QObject *, quint64 addr, quint64 length);
virtual void reloadModules(); virtual void reloadModules();
virtual void loadSymbols(const QString &moduleName); virtual void loadSymbols(const QString &moduleName);

View File

@@ -214,8 +214,8 @@ public:
m_threadsHandler(), m_threadsHandler(),
m_watchHandler(engine), m_watchHandler(engine),
m_isSlaveEngine(false), m_isSlaveEngine(false),
m_disassemblerViewAgent(engine), m_disassemblerAgent(engine),
m_memoryViewAgent(engine) m_memoryAgent(engine)
{ {
connect(&m_locationTimer, SIGNAL(timeout()), SLOT(doRemoveLocationMark())); connect(&m_locationTimer, SIGNAL(timeout()), SLOT(doRemoveLocationMark()));
} }
@@ -306,8 +306,8 @@ public:
QFutureInterface<void> m_progress; QFutureInterface<void> m_progress;
bool m_isSlaveEngine; bool m_isSlaveEngine;
DisassemblerViewAgent m_disassemblerViewAgent; DisassemblerAgent m_disassemblerAgent;
MemoryViewAgent m_memoryViewAgent; MemoryAgent m_memoryAgent;
QScopedPointer<TextEditor::BaseTextMark> m_locationMark; QScopedPointer<TextEditor::BaseTextMark> m_locationMark;
QTimer m_locationTimer; QTimer m_locationTimer;
}; };
@@ -452,7 +452,7 @@ QAbstractItemModel *DebuggerEngine::sourceFilesModel() const
return model; return model;
} }
void DebuggerEngine::fetchMemory(MemoryViewAgent *, QObject *, void DebuggerEngine::fetchMemory(MemoryAgent *, QObject *,
quint64 addr, quint64 length) quint64 addr, quint64 length)
{ {
Q_UNUSED(addr); Q_UNUSED(addr);
@@ -532,7 +532,7 @@ void DebuggerEngine::breakByFunction(const QString &functionName)
void DebuggerEngine::resetLocation() void DebuggerEngine::resetLocation()
{ {
d->m_disassemblerViewAgent.resetLocation(); d->m_disassemblerAgent.resetLocation();
d->removeLocationMark(); d->removeLocationMark();
} }
@@ -559,7 +559,7 @@ void DebuggerEngine::gotoLocation(const QString &file, int line, bool setMarker)
void DebuggerEngine::gotoLocation(const StackFrame &frame, bool setMarker) void DebuggerEngine::gotoLocation(const StackFrame &frame, bool setMarker)
{ {
if (debuggerCore()->boolSetting(OperateByInstruction) || !frame.isUsable()) if (debuggerCore()->boolSetting(OperateByInstruction) || !frame.isUsable())
d->m_disassemblerViewAgent.setFrame(frame, true, setMarker); d->m_disassemblerAgent.setFrame(frame, true, setMarker);
else else
gotoLocation(frame.file, frame.line, setMarker); gotoLocation(frame.file, frame.line, setMarker);
} }
@@ -1154,8 +1154,7 @@ void DebuggerEngine::setToolTipExpression
{ {
} }
void DebuggerEngine::updateWatchData void DebuggerEngine::updateWatchData(const WatchData &, const WatchUpdateFlags &)
(const Internal::WatchData &, const Internal::WatchUpdateFlags &)
{ {
} }
@@ -1163,7 +1162,7 @@ void DebuggerEngine::watchPoint(const QPoint &)
{ {
} }
void DebuggerEngine::fetchDisassembler(Internal::DisassemblerViewAgent *) void DebuggerEngine::fetchDisassembler(DisassemblerAgent *)
{ {
} }
@@ -1292,7 +1291,7 @@ void DebuggerEngine::attemptBreakpointSynchronization()
} }
if (done) if (done)
d->m_disassemblerViewAgent.updateBreakpointMarkers(); d->m_disassemblerAgent.updateBreakpointMarkers();
} }
void DebuggerEngine::insertBreakpoint(BreakpointId id) void DebuggerEngine::insertBreakpoint(BreakpointId id)
@@ -1320,8 +1319,8 @@ void DebuggerEngine::selectThread(int)
{ {
} }
void DebuggerEngine::assignValueInDebugger void DebuggerEngine::assignValueInDebugger(const WatchData *,
(const Internal::WatchData *, const QString &, const QVariant &) const QString &, const QVariant &)
{ {
} }
@@ -1383,7 +1382,7 @@ void DebuggerEngine::executeDebuggerCommand(const QString &)
{ {
} }
Internal::BreakHandler *DebuggerEngine::breakHandler() const BreakHandler *DebuggerEngine::breakHandler() const
{ {
return debuggerCore()->breakHandler(); return debuggerCore()->breakHandler();
} }
@@ -1478,17 +1477,17 @@ bool DebuggerEngine::isCppBreakpoint(const BreakpointParameters &p)
void DebuggerEngine::openMemoryView(quint64 address) void DebuggerEngine::openMemoryView(quint64 address)
{ {
d->m_memoryViewAgent.createBinEditor(address); d->m_memoryAgent.createBinEditor(address);
} }
void DebuggerEngine::updateMemoryViews() void DebuggerEngine::updateMemoryViews()
{ {
d->m_memoryViewAgent.updateContents(); d->m_memoryAgent.updateContents();
} }
void DebuggerEngine::openDisassemblerView(const StackFrame &frame) void DebuggerEngine::openDisassemblerView(const StackFrame &frame)
{ {
DisassemblerViewAgent *agent = new DisassemblerViewAgent(this); DisassemblerAgent *agent = new DisassemblerAgent(this);
agent->setFrame(frame, true, false); agent->setFrame(frame, true, false);
} }

View File

@@ -122,8 +122,8 @@ DEBUGGER_EXPORT QDebug operator<<(QDebug str, DebuggerState state);
namespace Internal { namespace Internal {
class DebuggerPluginPrivate; class DebuggerPluginPrivate;
class DisassemblerViewAgent; class DisassemblerAgent;
class MemoryViewAgent; class MemoryAgent;
class WatchData; class WatchData;
class BreakHandler; class BreakHandler;
class ModulesHandler; class ModulesHandler;
@@ -164,11 +164,11 @@ public:
virtual void watchPoint(const QPoint &); virtual void watchPoint(const QPoint &);
virtual void openMemoryView(quint64 addr); virtual void openMemoryView(quint64 addr);
virtual void fetchMemory(Internal::MemoryViewAgent *, QObject *, virtual void fetchMemory(Internal::MemoryAgent *, QObject *,
quint64 addr, quint64 length); quint64 addr, quint64 length);
virtual void updateMemoryViews(); virtual void updateMemoryViews();
virtual void openDisassemblerView(const Internal::StackFrame &frame); virtual void openDisassemblerView(const Internal::StackFrame &frame);
virtual void fetchDisassembler(Internal::DisassemblerViewAgent *); virtual void fetchDisassembler(Internal::DisassemblerAgent *);
virtual void activateFrame(int index); virtual void activateFrame(int index);
virtual void reloadModules(); virtual void reloadModules();

View File

@@ -1789,7 +1789,7 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditor::ITextEditor *editor,
.section('\n', lineNumber - 1, lineNumber - 1); .section('\n', lineNumber - 1, lineNumber - 1);
BreakpointResponse needle; BreakpointResponse needle;
needle.type = BreakpointByAddress; needle.type = BreakpointByAddress;
needle.address = DisassemblerViewAgent::addressFromDisassemblyLine(line); needle.address = DisassemblerAgent::addressFromDisassemblyLine(line);
address = needle.address; address = needle.address;
needle.lineNumber = -1; needle.lineNumber = -1;
id = breakHandler()->findSimilarBreakpoint(needle); id = breakHandler()->findSimilarBreakpoint(needle);
@@ -1872,7 +1872,7 @@ void DebuggerPluginPrivate::toggleBreakpoint()
if (textEditor->property("DisassemblerView").toBool()) { if (textEditor->property("DisassemblerView").toBool()) {
QString line = textEditor->contents() QString line = textEditor->contents()
.section('\n', lineNumber - 1, lineNumber - 1); .section('\n', lineNumber - 1, lineNumber - 1);
quint64 address = DisassemblerViewAgent::addressFromDisassemblyLine(line); quint64 address = DisassemblerAgent::addressFromDisassemblyLine(line);
toggleBreakpointByAddress(address); toggleBreakpointByAddress(address);
} else if (lineNumber >= 0) { } else if (lineNumber >= 0) {
toggleBreakpointByFileAndLine(textEditor->file()->fileName(), lineNumber); toggleBreakpointByFileAndLine(textEditor->file()->fileName(), lineNumber);
@@ -1919,7 +1919,7 @@ void DebuggerPluginPrivate::requestMark(ITextEditor *editor, int lineNumber)
if (editor->property("DisassemblerView").toBool()) { if (editor->property("DisassemblerView").toBool()) {
QString line = editor->contents() QString line = editor->contents()
.section('\n', lineNumber - 1, lineNumber - 1); .section('\n', lineNumber - 1, lineNumber - 1);
quint64 address = DisassemblerViewAgent::addressFromDisassemblyLine(line); quint64 address = DisassemblerAgent::addressFromDisassemblyLine(line);
toggleBreakpointByAddress(address); toggleBreakpointByAddress(address);
} else if (editor->file()) { } else if (editor->file()) {
toggleBreakpointByFileAndLine(editor->file()->fileName(), lineNumber); toggleBreakpointByFileAndLine(editor->file()->fileName(), lineNumber);

View File

@@ -59,7 +59,7 @@ namespace Internal {
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
// //
// DisassemblerViewAgent // DisassemblerAgent
// //
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
@@ -91,11 +91,11 @@ private:
}; };
class DisassemblerViewAgentPrivate class DisassemblerAgentPrivate
{ {
public: public:
DisassemblerViewAgentPrivate(); DisassemblerAgentPrivate();
~DisassemblerViewAgentPrivate(); ~DisassemblerAgentPrivate();
void configureMimeType(); void configureMimeType();
public: public:
@@ -111,7 +111,7 @@ public:
QString mimeType; QString mimeType;
}; };
DisassemblerViewAgentPrivate::DisassemblerViewAgentPrivate() DisassemblerAgentPrivate::DisassemblerAgentPrivate()
: editor(0), : editor(0),
tryMixed(true), tryMixed(true),
setMarker(true), setMarker(true),
@@ -120,7 +120,7 @@ DisassemblerViewAgentPrivate::DisassemblerViewAgentPrivate()
{ {
} }
DisassemblerViewAgentPrivate::~DisassemblerViewAgentPrivate() DisassemblerAgentPrivate::~DisassemblerAgentPrivate()
{ {
if (editor) { if (editor) {
EditorManager *editorManager = EditorManager::instance(); EditorManager *editorManager = EditorManager::instance();
@@ -131,31 +131,31 @@ DisassemblerViewAgentPrivate::~DisassemblerViewAgentPrivate()
} }
/*! /*!
\class DisassemblerViewAgent \class DisassemblerAgent
Objects from this class are created in response to user actions in Objects from this class are created in response to user actions in
the Gui for showing disassembled memory from the inferior. After creation the Gui for showing disassembled memory from the inferior. After creation
it handles communication between the engine and the editor. it handles communication between the engine and the editor.
*/ */
DisassemblerViewAgent::DisassemblerViewAgent(DebuggerEngine *engine) DisassemblerAgent::DisassemblerAgent(DebuggerEngine *engine)
: QObject(0), d(new DisassemblerViewAgentPrivate) : QObject(0), d(new DisassemblerAgentPrivate)
{ {
d->engine = engine; d->engine = engine;
} }
DisassemblerViewAgent::~DisassemblerViewAgent() DisassemblerAgent::~DisassemblerAgent()
{ {
delete d; delete d;
d = 0; d = 0;
} }
void DisassemblerViewAgent::cleanup() void DisassemblerAgent::cleanup()
{ {
d->cache.clear(); d->cache.clear();
} }
void DisassemblerViewAgent::resetLocation() void DisassemblerAgent::resetLocation()
{ {
if (!d->editor) if (!d->editor)
return; return;
@@ -167,12 +167,12 @@ QString frameKey(const StackFrame &frame)
return _("%1:%2:%3").arg(frame.function).arg(frame.file).arg(frame.from); return _("%1:%2:%3").arg(frame.function).arg(frame.file).arg(frame.from);
} }
const StackFrame &DisassemblerViewAgent::frame() const const StackFrame &DisassemblerAgent::frame() const
{ {
return d->frame; return d->frame;
} }
bool DisassemblerViewAgent::isMixed() const bool DisassemblerAgent::isMixed() const
{ {
return d->tryMixed return d->tryMixed
&& d->frame.line > 0 && d->frame.line > 0
@@ -180,7 +180,7 @@ bool DisassemblerViewAgent::isMixed() const
&& d->frame.function != _("??"); && d->frame.function != _("??");
} }
void DisassemblerViewAgent::setFrame(const StackFrame &frame, void DisassemblerAgent::setFrame(const StackFrame &frame,
bool tryMixed, bool setMarker) bool tryMixed, bool setMarker)
{ {
d->frame = frame; d->frame = frame;
@@ -202,7 +202,7 @@ void DisassemblerViewAgent::setFrame(const StackFrame &frame,
d->engine->fetchDisassembler(this); d->engine->fetchDisassembler(this);
} }
void DisassemblerViewAgentPrivate::configureMimeType() void DisassemblerAgentPrivate::configureMimeType()
{ {
QTC_ASSERT(editor, return); QTC_ASSERT(editor, return);
@@ -222,12 +222,12 @@ void DisassemblerViewAgentPrivate::configureMimeType()
qWarning("Assembler mimetype '%s' not found.", qPrintable(mimeType)); qWarning("Assembler mimetype '%s' not found.", qPrintable(mimeType));
} }
QString DisassemblerViewAgent::mimeType() const QString DisassemblerAgent::mimeType() const
{ {
return d->mimeType; return d->mimeType;
} }
void DisassemblerViewAgent::setMimeType(const QString &mt) void DisassemblerAgent::setMimeType(const QString &mt)
{ {
if (mt == d->mimeType) if (mt == d->mimeType)
return; return;
@@ -236,7 +236,7 @@ void DisassemblerViewAgent::setMimeType(const QString &mt)
d->configureMimeType(); d->configureMimeType();
} }
void DisassemblerViewAgent::setContents(const DisassemblerLines &contents) void DisassemblerAgent::setContents(const DisassemblerLines &contents)
{ {
QTC_ASSERT(d, return); QTC_ASSERT(d, return);
using namespace Core; using namespace Core;
@@ -287,7 +287,7 @@ void DisassemblerViewAgent::setContents(const DisassemblerLines &contents)
updateLocationMarker(); updateLocationMarker();
} }
void DisassemblerViewAgent::updateLocationMarker() void DisassemblerAgent::updateLocationMarker()
{ {
QTC_ASSERT(d->editor, return); QTC_ASSERT(d->editor, return);
@@ -309,7 +309,7 @@ void DisassemblerViewAgent::updateLocationMarker()
plainTextEdit->setTextCursor(tc); plainTextEdit->setTextCursor(tc);
} }
void DisassemblerViewAgent::updateBreakpointMarkers() void DisassemblerAgent::updateBreakpointMarkers()
{ {
if (!d->editor) if (!d->editor)
return; return;
@@ -337,13 +337,13 @@ void DisassemblerViewAgent::updateBreakpointMarkers()
} }
} }
quint64 DisassemblerViewAgent::address() const quint64 DisassemblerAgent::address() const
{ {
return d->frame.address; return d->frame.address;
} }
// Return address of an assembly line "0x0dfd bla" // Return address of an assembly line "0x0dfd bla"
quint64 DisassemblerViewAgent::addressFromDisassemblyLine(const QString &line) quint64 DisassemblerAgent::addressFromDisassemblyLine(const QString &line)
{ {
return DisassemblerLine(line).address; return DisassemblerLine(line).address;
} }

View File

@@ -46,17 +46,17 @@ class DebuggerEngine;
namespace Internal { namespace Internal {
class StackFrame; class StackFrame;
class DisassemblerViewAgent; class DisassemblerAgent;
class DisassemblerViewAgentPrivate; class DisassemblerAgentPrivate;
class DisassemblerViewAgent : public QObject class DisassemblerAgent : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(QString mimeType READ mimeType WRITE setMimeType) Q_PROPERTY(QString mimeType READ mimeType WRITE setMimeType)
public: public:
// Called from Gui // Called from Gui
explicit DisassemblerViewAgent(DebuggerEngine *engine); explicit DisassemblerAgent(DebuggerEngine *engine);
~DisassemblerViewAgent(); ~DisassemblerAgent();
void setFrame(const StackFrame &frame, bool tryMixed, bool setMarker); void setFrame(const StackFrame &frame, bool tryMixed, bool setMarker);
const StackFrame &frame() const; const StackFrame &frame() const;
@@ -78,7 +78,7 @@ public:
static quint64 addressFromDisassemblyLine(const QString &data); static quint64 addressFromDisassemblyLine(const QString &data);
private: private:
DisassemblerViewAgentPrivate *d; DisassemblerAgentPrivate *d;
}; };

View File

@@ -3661,15 +3661,15 @@ void GdbEngine::handleWatchPoint(const GdbResponse &response)
struct MemoryAgentCookie struct MemoryAgentCookie
{ {
MemoryAgentCookie() : agent(0), token(0), address(0) {} MemoryAgentCookie() : agent(0), token(0), address(0) {}
MemoryAgentCookie(MemoryViewAgent *agent_, QObject *token_, quint64 address_) MemoryAgentCookie(MemoryAgent *agent_, QObject *token_, quint64 address_)
: agent(agent_), token(token_), address(address_) : agent(agent_), token(token_), address(address_)
{} {}
QPointer<MemoryViewAgent> agent; QPointer<MemoryAgent> agent;
QPointer<QObject> token; QPointer<QObject> token;
quint64 address; quint64 address;
}; };
void GdbEngine::fetchMemory(MemoryViewAgent *agent, QObject *token, quint64 addr, void GdbEngine::fetchMemory(MemoryAgent *agent, QObject *token, quint64 addr,
quint64 length) quint64 length)
{ {
//qDebug() << "GDB MEMORY FETCH" << agent << addr << length; //qDebug() << "GDB MEMORY FETCH" << agent << addr << length;
@@ -3708,17 +3708,17 @@ class DisassemblerAgentCookie
{ {
public: public:
DisassemblerAgentCookie() : agent(0), attempts(0) {} DisassemblerAgentCookie() : agent(0), attempts(0) {}
DisassemblerAgentCookie(DisassemblerViewAgent *agent_) DisassemblerAgentCookie(DisassemblerAgent *agent_)
: agent(agent_), attempts(0) : agent(agent_), attempts(0)
{} {}
public: public:
QPointer<DisassemblerViewAgent> agent; QPointer<DisassemblerAgent> agent;
int attempts; int attempts;
}; };
// FIXME: add agent->frame() accessor and use that // FIXME: add agent->frame() accessor and use that
void GdbEngine::fetchDisassembler(DisassemblerViewAgent *agent) void GdbEngine::fetchDisassembler(DisassemblerAgent *agent)
{ {
fetchDisassemblerByCli(agent, agent->isMixed()); fetchDisassemblerByCli(agent, agent->isMixed());
/* /*

View File

@@ -397,7 +397,7 @@ private: ////////// View & Data Stuff //////////
// //
// Disassembler specific stuff // Disassembler specific stuff
// //
void fetchDisassembler(DisassemblerViewAgent *agent); void fetchDisassembler(DisassemblerAgent *agent);
void fetchDisassemblerByAddress(const DisassemblerAgentCookie &ac, void fetchDisassemblerByAddress(const DisassemblerAgentCookie &ac,
bool useMixedMode); bool useMixedMode);
void fetchDisassemblerByCli(const DisassemblerAgentCookie &ac, void fetchDisassemblerByCli(const DisassemblerAgentCookie &ac,
@@ -455,7 +455,7 @@ private: ////////// View & Data Stuff //////////
virtual void assignValueInDebugger(const WatchData *data, virtual void assignValueInDebugger(const WatchData *data,
const QString &expr, const QVariant &value); const QString &expr, const QVariant &value);
virtual void fetchMemory(MemoryViewAgent *agent, QObject *token, virtual void fetchMemory(MemoryAgent *agent, QObject *token,
quint64 addr, quint64 length); quint64 addr, quint64 length);
void handleFetchMemory(const GdbResponse &response); void handleFetchMemory(const GdbResponse &response);

View File

@@ -234,7 +234,7 @@ void IPCEngineHost::selectThread(int index)
rpcCall(SelectThread, p); rpcCall(SelectThread, p);
} }
void IPCEngineHost::fetchDisassembler(DisassemblerViewAgent *v) void IPCEngineHost::fetchDisassembler(DisassemblerAgent *v)
{ {
quint64 address = v->frame().address; quint64 address = v->frame().address;
m_frameToDisassemblerAgent.insert(address, v); m_frameToDisassemblerAgent.insert(address, v);
@@ -468,7 +468,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
DisassemblerLines lines; DisassemblerLines lines;
s >> pc; s >> pc;
s >> lines; s >> lines;
DisassemblerViewAgent *view = m_frameToDisassemblerAgent.take(pc); DisassemblerAgent *view = m_frameToDisassemblerAgent.take(pc);
if (view) if (view)
view->setContents(lines); view->setContents(lines);
} }

View File

@@ -105,7 +105,7 @@ public:
void executeJumpToLine(const QString &fileName, int lineNumber); void executeJumpToLine(const QString &fileName, int lineNumber);
void activateFrame(int index); void activateFrame(int index);
void selectThread(int index); void selectThread(int index);
void fetchDisassembler(DisassemblerViewAgent *); void fetchDisassembler(DisassemblerAgent *);
bool acceptsBreakpoint(BreakpointId) const { return true; } // FIXME bool acceptsBreakpoint(BreakpointId) const { return true; } // FIXME
void insertBreakpoint(BreakpointId id); void insertBreakpoint(BreakpointId id);
void removeBreakpoint(BreakpointId id); void removeBreakpoint(BreakpointId id);
@@ -129,7 +129,7 @@ private:
quint64 m_nextMessagePayloadSize; quint64 m_nextMessagePayloadSize;
quint64 m_cookie; quint64 m_cookie;
QIODevice *m_device; QIODevice *m_device;
QHash<quint64, DisassemblerViewAgent *> m_frameToDisassemblerAgent; QHash<quint64, DisassemblerAgent *> m_frameToDisassemblerAgent;
QHash<QString, SourceAgent *> m_sourceAgents; QHash<QString, SourceAgent *> m_sourceAgents;
}; };

View File

@@ -48,12 +48,12 @@ namespace Internal {
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
// //
// MemoryViewAgent // MemoryAgent
// //
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
/*! /*!
\class MemoryViewAgent \class MemoryAgent
Objects form this class are created in response to user actions in Objects form this class are created in response to user actions in
the Gui for showing raw memory from the inferior. After creation the Gui for showing raw memory from the inferior. After creation
@@ -62,13 +62,13 @@ namespace Internal {
namespace { const int DataRange = 1024 * 1024; } namespace { const int DataRange = 1024 * 1024; }
MemoryViewAgent::MemoryViewAgent(Debugger::DebuggerEngine *engine) MemoryAgent::MemoryAgent(Debugger::DebuggerEngine *engine)
: QObject(engine), m_engine(engine) : QObject(engine), m_engine(engine)
{ {
QTC_ASSERT(engine, /**/); QTC_ASSERT(engine, /**/);
} }
MemoryViewAgent::~MemoryViewAgent() MemoryAgent::~MemoryAgent()
{ {
QList<IEditor *> editors; QList<IEditor *> editors;
foreach (QPointer<IEditor> editor, m_editors) foreach (QPointer<IEditor> editor, m_editors)
@@ -77,7 +77,7 @@ MemoryViewAgent::~MemoryViewAgent()
EditorManager::instance()->closeEditors(editors); EditorManager::instance()->closeEditors(editors);
} }
void MemoryViewAgent::createBinEditor(quint64 addr) void MemoryAgent::createBinEditor(quint64 addr)
{ {
EditorManager *editorManager = EditorManager::instance(); EditorManager *editorManager = EditorManager::instance();
QString titlePattern = tr("Memory $"); QString titlePattern = tr("Memory $");
@@ -115,13 +115,13 @@ void MemoryViewAgent::createBinEditor(quint64 addr)
} }
} }
void MemoryViewAgent::fetchLazyData(IEditor *editor, quint64 block, bool sync) void MemoryAgent::fetchLazyData(IEditor *editor, quint64 block, bool sync)
{ {
Q_UNUSED(sync); // FIXME: needed support for incremental searching Q_UNUSED(sync); // FIXME: needed support for incremental searching
m_engine->fetchMemory(this, editor, BinBlockSize * block, BinBlockSize); m_engine->fetchMemory(this, editor, BinBlockSize * block, BinBlockSize);
} }
void MemoryViewAgent::addLazyData(QObject *editorToken, quint64 addr, void MemoryAgent::addLazyData(QObject *editorToken, quint64 addr,
const QByteArray &ba) const QByteArray &ba)
{ {
IEditor *editor = qobject_cast<IEditor *>(editorToken); IEditor *editor = qobject_cast<IEditor *>(editorToken);
@@ -132,7 +132,7 @@ void MemoryViewAgent::addLazyData(QObject *editorToken, quint64 addr,
} }
} }
void MemoryViewAgent::provideNewRange(IEditor *editor, quint64 address) void MemoryAgent::provideNewRange(IEditor *editor, quint64 address)
{ {
QMetaObject::invokeMethod(editor->widget(), "setLazyData", QMetaObject::invokeMethod(editor->widget(), "setLazyData",
Q_ARG(quint64, address), Q_ARG(int, DataRange), Q_ARG(quint64, address), Q_ARG(int, DataRange),
@@ -142,19 +142,19 @@ void MemoryViewAgent::provideNewRange(IEditor *editor, quint64 address)
// Since we are not dealing with files, we take these signals to mean // Since we are not dealing with files, we take these signals to mean
// "move to start/end of range". This seems to make more sense than // "move to start/end of range". This seems to make more sense than
// jumping to the start or end of the address space, respectively. // jumping to the start or end of the address space, respectively.
void MemoryViewAgent::handleStartOfFileRequested(IEditor *editor) void MemoryAgent::handleStartOfFileRequested(IEditor *editor)
{ {
QMetaObject::invokeMethod(editor->widget(), QMetaObject::invokeMethod(editor->widget(),
"setCursorPosition", Q_ARG(int, 0)); "setCursorPosition", Q_ARG(int, 0));
} }
void MemoryViewAgent::handleEndOfFileRequested(IEditor *editor) void MemoryAgent::handleEndOfFileRequested(IEditor *editor)
{ {
QMetaObject::invokeMethod(editor->widget(), QMetaObject::invokeMethod(editor->widget(),
"setCursorPosition", Q_ARG(int, DataRange - 1)); "setCursorPosition", Q_ARG(int, DataRange - 1));
} }
void MemoryViewAgent::updateContents() void MemoryAgent::updateContents()
{ {
foreach (QPointer<IEditor> editor, m_editors) foreach (QPointer<IEditor> editor, m_editors)
if (editor) if (editor)

View File

@@ -43,13 +43,13 @@ class DebuggerEngine;
namespace Internal { namespace Internal {
class MemoryViewAgent : public QObject class MemoryAgent : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit MemoryViewAgent(DebuggerEngine *engine); explicit MemoryAgent(DebuggerEngine *engine);
~MemoryViewAgent(); ~MemoryAgent();
enum { BinBlockSize = 1024 }; enum { BinBlockSize = 1024 };

View File

@@ -146,15 +146,15 @@ void QmlCppEngine::watchPoint(const QPoint &point)
d->m_cppEngine->watchPoint(point); d->m_cppEngine->watchPoint(point);
} }
void QmlCppEngine::fetchMemory(MemoryViewAgent *mva, QObject *obj, void QmlCppEngine::fetchMemory(MemoryAgent *ma, QObject *obj,
quint64 addr, quint64 length) quint64 addr, quint64 length)
{ {
d->m_cppEngine->fetchMemory(mva, obj, addr, length); d->m_cppEngine->fetchMemory(ma, obj, addr, length);
} }
void QmlCppEngine::fetchDisassembler(DisassemblerViewAgent *dva) void QmlCppEngine::fetchDisassembler(DisassemblerAgent *da)
{ {
d->m_cppEngine->fetchDisassembler(dva); d->m_cppEngine->fetchDisassembler(da);
} }
void QmlCppEngine::activateFrame(int index) void QmlCppEngine::activateFrame(int index)

View File

@@ -30,9 +30,9 @@ public:
const WatchUpdateFlags &flags); const WatchUpdateFlags &flags);
virtual void watchPoint(const QPoint &); virtual void watchPoint(const QPoint &);
virtual void fetchMemory(MemoryViewAgent *, QObject *, virtual void fetchMemory(MemoryAgent *, QObject *,
quint64 addr, quint64 length); quint64 addr, quint64 length);
virtual void fetchDisassembler(DisassemblerViewAgent *); virtual void fetchDisassembler(DisassemblerAgent *);
virtual void activateFrame(int index); virtual void activateFrame(int index);
virtual void reloadModules(); virtual void reloadModules();