Commit 735b3489 authored by hjk's avatar hjk
Browse files

debugger: fake hardware breakpoints work better with read-only memory

parent 52dcc410
...@@ -2021,6 +2021,8 @@ void GdbEngine::sendInsertBreakpoint(int index) ...@@ -2021,6 +2021,8 @@ void GdbEngine::sendInsertBreakpoint(int index)
QByteArray cmd; QByteArray cmd;
if (m_isMacGdb) if (m_isMacGdb)
cmd = "-break-insert -l -1 -f "; cmd = "-break-insert -l -1 -f ";
else if (m_gdbAdapter->isTrkAdapter())
cmd = "-break-insert -h -f ";
else if (m_gdbVersion >= 60800) // Probably some earlier version would work as well ... else if (m_gdbVersion >= 60800) // Probably some earlier version would work as well ...
cmd = "-break-insert -f "; cmd = "-break-insert -f ";
else else
......
...@@ -384,8 +384,9 @@ QByteArray TrkGdbAdapter::trkStepRangeMessage(trk::byte option) ...@@ -384,8 +384,9 @@ QByteArray TrkGdbAdapter::trkStepRangeMessage(trk::byte option)
uint to = m_snapshot.lineToAddress; uint to = m_snapshot.lineToAddress;
uint pc = m_snapshot.registers[RegisterPC]; uint pc = m_snapshot.registers[RegisterPC];
if (from <= pc && pc <= to) { if (from <= pc && pc <= to) {
qDebug() << "STEP IN " << hexxNumber(from) << hexxNumber(to) to = qMax(to - 4, from);
<< "INSTEAD OF " << hexxNumber(pc); debugMessage("STEP IN " + hexxNumber(from) + " " + hexxNumber(to)
+ " INSTEAD OF " + hexxNumber(pc));
} else { } else {
from = pc; from = pc;
to = pc; to = pc;
...@@ -1852,7 +1853,7 @@ void TrkGdbAdapter::handleCreateProcess(const TrkResult &result) ...@@ -1852,7 +1853,7 @@ void TrkGdbAdapter::handleCreateProcess(const TrkResult &result)
m_engine->postCommand("symbol-file \"" + symbolFile + "\""); m_engine->postCommand("symbol-file \"" + symbolFile + "\"");
} }
m_engine->postCommand("set breakpoint always-inserted on"); m_engine->postCommand("set breakpoint always-inserted on");
m_engine->postCommand("set breakpoint auto-hw off"); m_engine->postCommand("set breakpoint auto-hw on");
m_engine->postCommand("set trust-readonly-sections"); // No difference? m_engine->postCommand("set trust-readonly-sections"); // No difference?
m_engine->postCommand("set displaced-stepping on"); // No difference? m_engine->postCommand("set displaced-stepping on"); // No difference?
m_engine->postCommand("set mem inaccessible-by-default"); m_engine->postCommand("set mem inaccessible-by-default");
......
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