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