Commit fb837b52 authored by hjk's avatar hjk

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

parent b90bb97f
......@@ -1361,7 +1361,7 @@ bool CdbEngine::attemptBreakpointSynchronizationI(QString *errorMessage)
return true;
}
void CdbEngine::fetchDisassembler(DisassemblerViewAgent *agent)
void CdbEngine::fetchDisassembler(DisassemblerAgent *agent)
{
enum { ContextLines = 40 };
QString errorMessage;
......@@ -1387,7 +1387,7 @@ void CdbEngine::fetchDisassembler(DisassemblerViewAgent *agent)
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)
return;
......
......@@ -37,7 +37,7 @@
namespace Debugger {
namespace Internal {
class DisassemblerViewAgent;
class DisassemblerAgent;
class CdbDebugEventCallback;
class CdbDebugOutput;
class CdbEnginePrivate;
......@@ -88,8 +88,8 @@ public:
virtual void attemptBreakpointSynchronization();
virtual void setRegisterValue(int regnr, const QString &value);
virtual void fetchDisassembler(DisassemblerViewAgent *agent);
virtual void fetchMemory(MemoryViewAgent *, QObject *, quint64 addr, quint64 length);
virtual void fetchDisassembler(DisassemblerAgent *agent);
virtual void fetchMemory(MemoryAgent *, QObject *, quint64 addr, quint64 length);
virtual void reloadModules();
virtual void loadSymbols(const QString &moduleName);
......
......@@ -71,8 +71,8 @@
#include <cctype>
Q_DECLARE_METATYPE(Debugger::Internal::DisassemblerViewAgent*)
Q_DECLARE_METATYPE(Debugger::Internal::MemoryViewAgent*)
Q_DECLARE_METATYPE(Debugger::Internal::DisassemblerAgent*)
Q_DECLARE_METATYPE(Debugger::Internal::MemoryAgent*)
enum { debug = 0 };
enum { debugLocals = 0 };
......@@ -115,11 +115,11 @@ static const char localsPrefixC[] = "local.";
using namespace Debugger::Internal;
struct MemoryViewCookie {
explicit MemoryViewCookie(MemoryViewAgent *a = 0, QObject *e = 0,
explicit MemoryViewCookie(MemoryAgent *a = 0, QObject *e = 0,
quint64 addr = 0, quint64 l = 0) :
agent(a), editorToken(e), address(addr), length(l) {}
MemoryViewAgent *agent;
MemoryAgent *agent;
QObject *editorToken;
quint64 address;
quint64 length;
......@@ -1022,28 +1022,28 @@ void CdbEngine::selectThread(int index)
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;)
QByteArray cmd;
ByteArrayInputStream str(cmd);
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);
}
// Parse: "00000000`77606060 cc int 3"
void CdbEngine::handleDisassembler(const CdbBuiltinCommandPtr &command)
{
QTC_ASSERT(qVariantCanConvert<Debugger::Internal::DisassemblerViewAgent*>(command->cookie), return;)
Debugger::Internal::DisassemblerViewAgent *agent = qvariant_cast<Debugger::Internal::DisassemblerViewAgent*>(command->cookie);
QTC_ASSERT(qVariantCanConvert<Debugger::Internal::DisassemblerAgent*>(command->cookie), return;)
Debugger::Internal::DisassemblerAgent *agent = qvariant_cast<Debugger::Internal::DisassemblerAgent*>(command->cookie);
DisassemblerLines disassemblerLines;
foreach(const QByteArray &line, command->reply)
disassemblerLines.appendLine(DisassemblerLine(QString::fromLatin1(line)));
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;)
if (debug)
......
......@@ -41,7 +41,7 @@
namespace Debugger {
namespace Cdb {
class DisassemblerViewAgent;
class DisassemblerAgent;
struct CdbBuiltinCommand;
struct CdbExtensionCommand;
struct CdbOptions;
......@@ -106,8 +106,8 @@ public:
virtual bool acceptsBreakpoint(BreakpointId id) const;
virtual void attemptBreakpointSynchronization();
virtual void fetchDisassembler(Debugger::Internal::DisassemblerViewAgent *agent);
virtual void fetchMemory(Debugger::Internal::MemoryViewAgent *, QObject *, quint64 addr, quint64 length);
virtual void fetchDisassembler(Debugger::Internal::DisassemblerAgent *agent);
virtual void fetchMemory(Debugger::Internal::MemoryAgent *, QObject *, quint64 addr, quint64 length);
virtual void reloadModules();
virtual void loadSymbols(const QString &moduleName);
......
......@@ -214,8 +214,8 @@ public:
m_threadsHandler(),
m_watchHandler(engine),
m_isSlaveEngine(false),
m_disassemblerViewAgent(engine),
m_memoryViewAgent(engine)
m_disassemblerAgent(engine),
m_memoryAgent(engine)
{
connect(&m_locationTimer, SIGNAL(timeout()), SLOT(doRemoveLocationMark()));
}
......@@ -306,8 +306,8 @@ public:
QFutureInterface<void> m_progress;
bool m_isSlaveEngine;
DisassemblerViewAgent m_disassemblerViewAgent;
MemoryViewAgent m_memoryViewAgent;
DisassemblerAgent m_disassemblerAgent;
MemoryAgent m_memoryAgent;
QScopedPointer<TextEditor::BaseTextMark> m_locationMark;
QTimer m_locationTimer;
};
......@@ -452,7 +452,7 @@ QAbstractItemModel *DebuggerEngine::sourceFilesModel() const
return model;
}
void DebuggerEngine::fetchMemory(MemoryViewAgent *, QObject *,
void DebuggerEngine::fetchMemory(MemoryAgent *, QObject *,
quint64 addr, quint64 length)
{
Q_UNUSED(addr);
......@@ -532,7 +532,7 @@ void DebuggerEngine::breakByFunction(const QString &functionName)
void DebuggerEngine::resetLocation()
{
d->m_disassemblerViewAgent.resetLocation();
d->m_disassemblerAgent.resetLocation();
d->removeLocationMark();
}
......@@ -559,7 +559,7 @@ void DebuggerEngine::gotoLocation(const QString &file, int line, bool setMarker)
void DebuggerEngine::gotoLocation(const StackFrame &frame, bool setMarker)
{
if (debuggerCore()->boolSetting(OperateByInstruction) || !frame.isUsable())
d->m_disassemblerViewAgent.setFrame(frame, true, setMarker);
d->m_disassemblerAgent.setFrame(frame, true, setMarker);
else
gotoLocation(frame.file, frame.line, setMarker);
}
......@@ -1154,8 +1154,7 @@ void DebuggerEngine::setToolTipExpression
{
}
void DebuggerEngine::updateWatchData
(const Internal::WatchData &, const Internal::WatchUpdateFlags &)
void DebuggerEngine::updateWatchData(const WatchData &, const 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)
d->m_disassemblerViewAgent.updateBreakpointMarkers();
d->m_disassemblerAgent.updateBreakpointMarkers();
}
void DebuggerEngine::insertBreakpoint(BreakpointId id)
......@@ -1320,8 +1319,8 @@ void DebuggerEngine::selectThread(int)
{
}
void DebuggerEngine::assignValueInDebugger
(const Internal::WatchData *, const QString &, const QVariant &)
void DebuggerEngine::assignValueInDebugger(const WatchData *,
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();
}
......@@ -1478,17 +1477,17 @@ bool DebuggerEngine::isCppBreakpoint(const BreakpointParameters &p)
void DebuggerEngine::openMemoryView(quint64 address)
{
d->m_memoryViewAgent.createBinEditor(address);
d->m_memoryAgent.createBinEditor(address);
}
void DebuggerEngine::updateMemoryViews()
{
d->m_memoryViewAgent.updateContents();
d->m_memoryAgent.updateContents();
}
void DebuggerEngine::openDisassemblerView(const StackFrame &frame)
{
DisassemblerViewAgent *agent = new DisassemblerViewAgent(this);
DisassemblerAgent *agent = new DisassemblerAgent(this);
agent->setFrame(frame, true, false);
}
......
......@@ -122,8 +122,8 @@ DEBUGGER_EXPORT QDebug operator<<(QDebug str, DebuggerState state);
namespace Internal {
class DebuggerPluginPrivate;
class DisassemblerViewAgent;
class MemoryViewAgent;
class DisassemblerAgent;
class MemoryAgent;
class WatchData;
class BreakHandler;
class ModulesHandler;
......@@ -164,11 +164,11 @@ public:
virtual void watchPoint(const QPoint &);
virtual void openMemoryView(quint64 addr);
virtual void fetchMemory(Internal::MemoryViewAgent *, QObject *,
virtual void fetchMemory(Internal::MemoryAgent *, QObject *,
quint64 addr, quint64 length);
virtual void updateMemoryViews();
virtual void openDisassemblerView(const Internal::StackFrame &frame);
virtual void fetchDisassembler(Internal::DisassemblerViewAgent *);
virtual void fetchDisassembler(Internal::DisassemblerAgent *);
virtual void activateFrame(int index);
virtual void reloadModules();
......
......@@ -1789,7 +1789,7 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditor::ITextEditor *editor,
.section('\n', lineNumber - 1, lineNumber - 1);
BreakpointResponse needle;
needle.type = BreakpointByAddress;
needle.address = DisassemblerViewAgent::addressFromDisassemblyLine(line);
needle.address = DisassemblerAgent::addressFromDisassemblyLine(line);
address = needle.address;
needle.lineNumber = -1;
id = breakHandler()->findSimilarBreakpoint(needle);
......@@ -1872,7 +1872,7 @@ void DebuggerPluginPrivate::toggleBreakpoint()
if (textEditor->property("DisassemblerView").toBool()) {
QString line = textEditor->contents()
.section('\n', lineNumber - 1, lineNumber - 1);
quint64 address = DisassemblerViewAgent::addressFromDisassemblyLine(line);
quint64 address = DisassemblerAgent::addressFromDisassemblyLine(line);
toggleBreakpointByAddress(address);
} else if (lineNumber >= 0) {
toggleBreakpointByFileAndLine(textEditor->file()->fileName(), lineNumber);
......@@ -1919,7 +1919,7 @@ void DebuggerPluginPrivate::requestMark(ITextEditor *editor, int lineNumber)
if (editor->property("DisassemblerView").toBool()) {
QString line = editor->contents()
.section('\n', lineNumber - 1, lineNumber - 1);
quint64 address = DisassemblerViewAgent::addressFromDisassemblyLine(line);
quint64 address = DisassemblerAgent::addressFromDisassemblyLine(line);
toggleBreakpointByAddress(address);
} else if (editor->file()) {
toggleBreakpointByFileAndLine(editor->file()->fileName(), lineNumber);
......
......@@ -59,7 +59,7 @@ namespace Internal {
///////////////////////////////////////////////////////////////////////
//
// DisassemblerViewAgent
// DisassemblerAgent
//
///////////////////////////////////////////////////////////////////////
......@@ -91,11 +91,11 @@ private:
};
class DisassemblerViewAgentPrivate
class DisassemblerAgentPrivate
{
public:
DisassemblerViewAgentPrivate();
~DisassemblerViewAgentPrivate();
DisassemblerAgentPrivate();
~DisassemblerAgentPrivate();
void configureMimeType();
public:
......@@ -111,7 +111,7 @@ public:
QString mimeType;
};
DisassemblerViewAgentPrivate::DisassemblerViewAgentPrivate()
DisassemblerAgentPrivate::DisassemblerAgentPrivate()
: editor(0),
tryMixed(true),
setMarker(true),
......@@ -120,7 +120,7 @@ DisassemblerViewAgentPrivate::DisassemblerViewAgentPrivate()
{
}
DisassemblerViewAgentPrivate::~DisassemblerViewAgentPrivate()
DisassemblerAgentPrivate::~DisassemblerAgentPrivate()
{
if (editor) {
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
the Gui for showing disassembled memory from the inferior. After creation
it handles communication between the engine and the editor.
*/
DisassemblerViewAgent::DisassemblerViewAgent(DebuggerEngine *engine)
: QObject(0), d(new DisassemblerViewAgentPrivate)
DisassemblerAgent::DisassemblerAgent(DebuggerEngine *engine)
: QObject(0), d(new DisassemblerAgentPrivate)
{
d->engine = engine;
}
DisassemblerViewAgent::~DisassemblerViewAgent()
DisassemblerAgent::~DisassemblerAgent()
{
delete d;
d = 0;
}
void DisassemblerViewAgent::cleanup()
void DisassemblerAgent::cleanup()
{
d->cache.clear();
}
void DisassemblerViewAgent::resetLocation()
void DisassemblerAgent::resetLocation()
{
if (!d->editor)
return;
......@@ -167,12 +167,12 @@ QString frameKey(const StackFrame &frame)
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;
}
bool DisassemblerViewAgent::isMixed() const
bool DisassemblerAgent::isMixed() const
{
return d->tryMixed
&& d->frame.line > 0
......@@ -180,7 +180,7 @@ bool DisassemblerViewAgent::isMixed() const
&& d->frame.function != _("??");
}
void DisassemblerViewAgent::setFrame(const StackFrame &frame,
void DisassemblerAgent::setFrame(const StackFrame &frame,
bool tryMixed, bool setMarker)
{
d->frame = frame;
......@@ -202,7 +202,7 @@ void DisassemblerViewAgent::setFrame(const StackFrame &frame,
d->engine->fetchDisassembler(this);
}
void DisassemblerViewAgentPrivate::configureMimeType()
void DisassemblerAgentPrivate::configureMimeType()
{
QTC_ASSERT(editor, return);
......@@ -222,12 +222,12 @@ void DisassemblerViewAgentPrivate::configureMimeType()
qWarning("Assembler mimetype '%s' not found.", qPrintable(mimeType));
}
QString DisassemblerViewAgent::mimeType() const
QString DisassemblerAgent::mimeType() const
{
return d->mimeType;
}
void DisassemblerViewAgent::setMimeType(const QString &mt)
void DisassemblerAgent::setMimeType(const QString &mt)
{
if (mt == d->mimeType)
return;
......@@ -236,7 +236,7 @@ void DisassemblerViewAgent::setMimeType(const QString &mt)
d->configureMimeType();
}
void DisassemblerViewAgent::setContents(const DisassemblerLines &contents)
void DisassemblerAgent::setContents(const DisassemblerLines &contents)
{
QTC_ASSERT(d, return);
using namespace Core;
......@@ -287,7 +287,7 @@ void DisassemblerViewAgent::setContents(const DisassemblerLines &contents)
updateLocationMarker();
}
void DisassemblerViewAgent::updateLocationMarker()
void DisassemblerAgent::updateLocationMarker()
{
QTC_ASSERT(d->editor, return);
......@@ -309,7 +309,7 @@ void DisassemblerViewAgent::updateLocationMarker()
plainTextEdit->setTextCursor(tc);
}
void DisassemblerViewAgent::updateBreakpointMarkers()
void DisassemblerAgent::updateBreakpointMarkers()
{
if (!d->editor)
return;
......@@ -337,13 +337,13 @@ void DisassemblerViewAgent::updateBreakpointMarkers()
}
}
quint64 DisassemblerViewAgent::address() const
quint64 DisassemblerAgent::address() const
{
return d->frame.address;
}
// Return address of an assembly line "0x0dfd bla"
quint64 DisassemblerViewAgent::addressFromDisassemblyLine(const QString &line)
quint64 DisassemblerAgent::addressFromDisassemblyLine(const QString &line)
{
return DisassemblerLine(line).address;
}
......
......@@ -46,17 +46,17 @@ class DebuggerEngine;
namespace Internal {
class StackFrame;
class DisassemblerViewAgent;
class DisassemblerViewAgentPrivate;
class DisassemblerAgent;
class DisassemblerAgentPrivate;
class DisassemblerViewAgent : public QObject
class DisassemblerAgent : public QObject
{
Q_OBJECT
Q_PROPERTY(QString mimeType READ mimeType WRITE setMimeType)
public:
// Called from Gui
explicit DisassemblerViewAgent(DebuggerEngine *engine);
~DisassemblerViewAgent();
explicit DisassemblerAgent(DebuggerEngine *engine);
~DisassemblerAgent();
void setFrame(const StackFrame &frame, bool tryMixed, bool setMarker);
const StackFrame &frame() const;
......@@ -78,7 +78,7 @@ public:
static quint64 addressFromDisassemblyLine(const QString &data);
private:
DisassemblerViewAgentPrivate *d;
DisassemblerAgentPrivate *d;
};
......
......@@ -3661,15 +3661,15 @@ void GdbEngine::handleWatchPoint(const GdbResponse &response)
struct MemoryAgentCookie
{
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_)
{}
QPointer<MemoryViewAgent> agent;
QPointer<MemoryAgent> agent;
QPointer<QObject> token;
quint64 address;
};
void GdbEngine::fetchMemory(MemoryViewAgent *agent, QObject *token, quint64 addr,
void GdbEngine::fetchMemory(MemoryAgent *agent, QObject *token, quint64 addr,
quint64 length)
{
//qDebug() << "GDB MEMORY FETCH" << agent << addr << length;
......@@ -3708,17 +3708,17 @@ class DisassemblerAgentCookie
{
public:
DisassemblerAgentCookie() : agent(0), attempts(0) {}
DisassemblerAgentCookie(DisassemblerViewAgent *agent_)
DisassemblerAgentCookie(DisassemblerAgent *agent_)
: agent(agent_), attempts(0)
{}
public:
QPointer<DisassemblerViewAgent> agent;
QPointer<DisassemblerAgent> agent;
int attempts;
};
// FIXME: add agent->frame() accessor and use that
void GdbEngine::fetchDisassembler(DisassemblerViewAgent *agent)
void GdbEngine::fetchDisassembler(DisassemblerAgent *agent)
{
fetchDisassemblerByCli(agent, agent->isMixed());
/*
......
......@@ -397,7 +397,7 @@ private: ////////// View & Data Stuff //////////
//
// Disassembler specific stuff
//
void fetchDisassembler(DisassemblerViewAgent *agent);
void fetchDisassembler(DisassemblerAgent *agent);
void fetchDisassemblerByAddress(const DisassemblerAgentCookie &ac,
bool useMixedMode);
void fetchDisassemblerByCli(const DisassemblerAgentCookie &ac,
......@@ -455,7 +455,7 @@ private: ////////// View & Data Stuff //////////
virtual void assignValueInDebugger(const WatchData *data,
const QString &expr, const QVariant &value);
virtual void fetchMemory(MemoryViewAgent *agent, QObject *token,
virtual void fetchMemory(MemoryAgent *agent, QObject *token,
quint64 addr, quint64 length);
void handleFetchMemory(const GdbResponse &response);
......
......@@ -234,7 +234,7 @@ void IPCEngineHost::selectThread(int index)
rpcCall(SelectThread, p);
}
void IPCEngineHost::fetchDisassembler(DisassemblerViewAgent *v)
void IPCEngineHost::fetchDisassembler(DisassemblerAgent *v)
{
quint64 address = v->frame().address;
m_frameToDisassemblerAgent.insert(address, v);
......@@ -468,7 +468,7 @@ void IPCEngineHost::rpcCallback(quint64 f, QByteArray payload)
DisassemblerLines lines;
s >> pc;
s >> lines;
DisassemblerViewAgent *view = m_frameToDisassemblerAgent.take(pc);
DisassemblerAgent *view = m_frameToDisassemblerAgent.take(pc);
if (view)
view->setContents(lines);
}
......
......@@ -105,7 +105,7 @@ public:
void executeJumpToLine(const QString &fileName, int lineNumber);
void activateFrame(int index);
void selectThread(int index);
void fetchDisassembler(DisassemblerViewAgent *);
void fetchDisassembler(DisassemblerAgent *);
bool acceptsBreakpoint(BreakpointId) const { return true; } // FIXME
void insertBreakpoint(BreakpointId id);
void removeBreakpoint(BreakpointId id);
......@@ -129,7 +129,7 @@ private:
quint64 m_nextMessagePayloadSize;
quint64 m_cookie;
QIODevice *m_device;
QHash<quint64, DisassemblerViewAgent *> m_frameToDisassemblerAgent;
QHash<quint64, DisassemblerAgent *> m_frameToDisassemblerAgent;
QHash<QString, SourceAgent *> m_sourceAgents;
};
......
......@@ -48,12 +48,12 @@ namespace Internal {
///////////////////////////////////////////////////////////////////////
//
// MemoryViewAgent
// MemoryAgent
//
///////////////////////////////////////////////////////////////////////
/*!
\class MemoryViewAgent
\class MemoryAgent
Objects form this class are created in response to user actions in
the Gui for showing raw memory from the inferior. After creation
......@@ -62,13 +62,13 @@ namespace Internal {
namespace { const int DataRange = 1024 * 1024; }
MemoryViewAgent::MemoryViewAgent(Debugger::DebuggerEngine *engine)
MemoryAgent::MemoryAgent(Debugger::DebuggerEngine *engine)
: QObject(engine), m_engine(engine)
{
QTC_ASSERT(engine, /**/);
}
MemoryViewAgent::~MemoryViewAgent()
MemoryAgent::~MemoryAgent()
{
QList<IEditor *> editors;