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)
QByteArray cmd;
if (m_isMacGdb)
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 ...
cmd = "-break-insert -f ";
else
......
......@@ -384,8 +384,9 @@ QByteArray TrkGdbAdapter::trkStepRangeMessage(trk::byte option)
uint to = m_snapshot.lineToAddress;
uint pc = m_snapshot.registers[RegisterPC];
if (from <= pc && pc <= to) {
qDebug() << "STEP IN " << hexxNumber(from) << hexxNumber(to)
<< "INSTEAD OF " << hexxNumber(pc);
to = qMax(to - 4, from);
debugMessage("STEP IN " + hexxNumber(from) + " " + hexxNumber(to)
+ " INSTEAD OF " + hexxNumber(pc));
} else {
from = pc;
to = pc;
......@@ -1852,7 +1853,7 @@ void TrkGdbAdapter::handleCreateProcess(const TrkResult &result)
m_engine->postCommand("symbol-file \"" + symbolFile + "\"");
}
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 displaced-stepping on"); // No difference?
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