Commit 1803ee2f authored by hjk's avatar hjk
Browse files

debugger: reset memory cache after stepping

It's better when one wants up-to-date data...
parent b944e1eb
......@@ -1200,6 +1200,7 @@ void TrkGdbAdapter::handleReadMemoryUnbuffered(const TrkResult &result)
void TrkGdbAdapter::handleStepInto(const TrkResult &result)
{
m_snapshot.reset();
if (result.errorCode()) {
logMessage("ERROR: " + result.errorString() + " in handleStepInto");
// Try fallback with Step Over
......@@ -1225,6 +1226,7 @@ void TrkGdbAdapter::handleStepInto2(const TrkResult &result)
void TrkGdbAdapter::handleStepOver(const TrkResult &result)
{
m_snapshot.reset();
if (result.errorCode()) {
logMessage("ERROR: " + result.errorString() + "in handleStepOver");
// Try fallback with Step Into
......
......@@ -362,5 +362,12 @@ QString TrkResult::errorString() const
return errorMessage(data.at(0));
}
void Snapshot::reset()
{
memory.clear();
for (int i = 0; i < RegisterCount; ++i)
registers[i] = 0;
}
} // namespace trk
......@@ -153,6 +153,8 @@ struct Session
struct Snapshot
{
void reset();
uint registers[RegisterCount];
typedef QHash<uint, QByteArray> Memory;
Memory memory;
......
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