summaryrefslogtreecommitdiff
path: root/src/arch/mips
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2014-12-05 22:37:03 -0800
committerGabe Black <gabeblack@google.com>2014-12-05 22:37:03 -0800
commit4a8a0a07982b7896127d0cb723fde08b3825bb48 (patch)
tree32274c02ae9dca6d6ebad156e559c9afcc44cabb /src/arch/mips
parentfb07d43b1a4a903fb2e51b41685eb5814d9f9e11 (diff)
downloadgem5-4a8a0a07982b7896127d0cb723fde08b3825bb48.tar.xz
misc: Generalize GDB single stepping.
The new single stepping implementation for x86 doesn't rely on any ISA specific properties or functionality. This change pulls out the per ISA implementation of those functions and promotes the X86 implementation to the base class. One drawback of that implementation is that the CPU might stop on an instruction twice if it's affected by both breakpoints and single stepping. While that might be a little surprising, it's harmless and would only happen under somewhat unlikely circumstances.
Diffstat (limited to 'src/arch/mips')
-rw-r--r--src/arch/mips/remote_gdb.cc44
-rw-r--r--src/arch/mips/remote_gdb.hh7
2 files changed, 0 insertions, 51 deletions
diff --git a/src/arch/mips/remote_gdb.cc b/src/arch/mips/remote_gdb.cc
index 9c944fc59..a7bde8ba6 100644
--- a/src/arch/mips/remote_gdb.cc
+++ b/src/arch/mips/remote_gdb.cc
@@ -235,47 +235,3 @@ RemoteGDB::setregs()
context->setFloatRegBits(FLOATREG_FIR,
gdbregs.regs32[GdbIntRegs + GdbFloatArchRegs + 1]);
}
-
-void
-RemoteGDB::clearSingleStep()
-{
- DPRINTF(GDBMisc, "clearSingleStep bt_addr=%#x nt_addr=%#x\n",
- takenBkpt, notTakenBkpt);
-
- if (takenBkpt != 0)
- clearTempBreakpoint(takenBkpt);
-
- if (notTakenBkpt != 0)
- clearTempBreakpoint(notTakenBkpt);
-}
-
-void
-RemoteGDB::setSingleStep()
-{
- PCState pc = context->pcState();
- PCState bpc;
- bool set_bt = false;
-
- // User was stopped at pc, e.g. the instruction at pc was not
- // executed.
- MachInst inst = read<MachInst>(pc.pc());
- StaticInstPtr si = context->getDecoderPtr()->decode(inst, pc.pc());
- if (si->hasBranchTarget(pc, context, bpc)) {
- // Don't bother setting a breakpoint on the taken branch if it
- // is the same as the next npc
- if (bpc.npc() != pc.nnpc())
- set_bt = true;
- }
-
- DPRINTF(GDBMisc, "setSingleStep bt_addr=%#x nt_addr=%#x\n",
- takenBkpt, notTakenBkpt);
-
- notTakenBkpt = pc.nnpc();
- setTempBreakpoint(notTakenBkpt);
-
- if (set_bt) {
- takenBkpt = bpc.npc();
- setTempBreakpoint(takenBkpt);
- }
-}
-
diff --git a/src/arch/mips/remote_gdb.hh b/src/arch/mips/remote_gdb.hh
index 157276dcf..8d113eb99 100644
--- a/src/arch/mips/remote_gdb.hh
+++ b/src/arch/mips/remote_gdb.hh
@@ -54,10 +54,6 @@ namespace MipsISA
class RemoteGDB : public BaseRemoteGDB
{
- protected:
- Addr notTakenBkpt;
- Addr takenBkpt;
-
public:
RemoteGDB(System *_system, ThreadContext *tc);
@@ -66,9 +62,6 @@ namespace MipsISA
void getregs();
void setregs();
-
- void clearSingleStep();
- void setSingleStep();
};
}