From 4a8a0a07982b7896127d0cb723fde08b3825bb48 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 5 Dec 2014 22:37:03 -0800 Subject: 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. --- src/base/remote_gdb.hh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/base/remote_gdb.hh') diff --git a/src/base/remote_gdb.hh b/src/base/remote_gdb.hh index 62f98f29a..6cca485e3 100644 --- a/src/base/remote_gdb.hh +++ b/src/base/remote_gdb.hh @@ -209,11 +209,25 @@ class BaseRemoteGDB } protected: + class SingleStepEvent : public Event + { + protected: + BaseRemoteGDB *gdb; + + public: + SingleStepEvent(BaseRemoteGDB *g) : gdb(g) + {} + + void process(); + }; + + SingleStepEvent singleStepEvent; + virtual void getregs() = 0; virtual void setregs() = 0; - virtual void clearSingleStep() = 0; - virtual void setSingleStep() = 0; + void clearSingleStep(); + void setSingleStep(); PCEventQueue *getPcEventQueue(); EventQueue *getComInstEventQueue(); -- cgit v1.2.3