BinEditor/MemoryView: Follow pointers, potentially in new window.

Reviewed-by: hjk
This commit is contained in:
ck
2010-02-17 17:33:42 +01:00
parent 7c9c99dcf0
commit d87d7694bc
10 changed files with 147 additions and 37 deletions

View File

@@ -3542,21 +3542,23 @@ void GdbEngine::handleWatchPoint(const GdbResponse &response)
struct MemoryAgentCookie
{
MemoryAgentCookie() : agent(0), address(0) {}
MemoryAgentCookie(MemoryViewAgent *agent_, quint64 address_)
: agent(agent_), address(address_)
MemoryAgentCookie() : agent(0), token(0), address(0) {}
MemoryAgentCookie(MemoryViewAgent *agent_, QObject *token_, quint64 address_)
: agent(agent_), token(token_), address(address_)
{}
QPointer<MemoryViewAgent> agent;
QPointer<QObject> token;
quint64 address;
};
void GdbEngine::fetchMemory(MemoryViewAgent *agent, quint64 addr, quint64 length)
void GdbEngine::fetchMemory(MemoryViewAgent *agent, QObject *token, quint64 addr,
quint64 length)
{
//qDebug() << "GDB MEMORY FETCH" << agent << addr << length;
postCommand("-data-read-memory " + QByteArray::number(addr) + " x 1 1 "
+ QByteArray::number(length),
NeedsStop, CB(handleFetchMemory),
QVariant::fromValue(MemoryAgentCookie(agent, addr)));
QVariant::fromValue(MemoryAgentCookie(agent, token, addr)));
}
void GdbEngine::handleFetchMemory(const GdbResponse &response)
@@ -3581,7 +3583,7 @@ void GdbEngine::handleFetchMemory(const GdbResponse &response)
QTC_ASSERT(ok, return);
ba.append(c);
}
ac.agent->addLazyData(ac.address, ba);
ac.agent->addLazyData(ac.token, ac.address, ba);
}

View File

@@ -428,7 +428,8 @@ private: ////////// View & Data Stuff //////////
virtual void assignValueInDebugger(const QString &expr, const QString &value);
virtual void fetchMemory(MemoryViewAgent *agent, quint64 addr, quint64 length);
virtual void fetchMemory(MemoryViewAgent *agent, QObject *token,
quint64 addr, quint64 length);
void handleFetchMemory(const GdbResponse &response);
virtual void watchPoint(const QPoint &);