diff options
Diffstat (limited to 'src/base/remote_gdb.cc')
-rw-r--r-- | src/base/remote_gdb.cc | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/src/base/remote_gdb.cc b/src/base/remote_gdb.cc index 97d763803..e603fb90f 100644 --- a/src/base/remote_gdb.cc +++ b/src/base/remote_gdb.cc @@ -262,11 +262,18 @@ BaseRemoteGDB::TrapEvent::process() gdb->trap(_type); } -BaseRemoteGDB::BaseRemoteGDB(System *_system, ThreadContext *c, size_t cacheSize) - : inputEvent(NULL), trapEvent(this), listener(NULL), number(-1), fd(-1), - active(false), attached(false), - system(_system), context(c), - gdbregs(cacheSize) +void +BaseRemoteGDB::SingleStepEvent::process() +{ + if (!gdb->singleStepEvent.scheduled()) + gdb->scheduleInstCommitEvent(&gdb->singleStepEvent, 1); + gdb->trap(SIGTRAP); +} + +BaseRemoteGDB::BaseRemoteGDB(System *_system, ThreadContext *c, + size_t cacheSize) : inputEvent(NULL), trapEvent(this), listener(NULL), + number(-1), fd(-1), active(false), attached(false), system(_system), + context(c), gdbregs(cacheSize), singleStepEvent(this) { memset(gdbregs.regs, 0, gdbregs.bytes()); } @@ -525,6 +532,19 @@ BaseRemoteGDB::write(Addr vaddr, size_t size, const char *data) return true; } +void +BaseRemoteGDB::clearSingleStep() +{ + descheduleInstCommitEvent(&singleStepEvent); +} + +void +BaseRemoteGDB::setSingleStep() +{ + if (!singleStepEvent.scheduled()) + scheduleInstCommitEvent(&singleStepEvent, 1); +} + PCEventQueue *BaseRemoteGDB::getPcEventQueue() { return &system->pcEventQueue; |