misc: Rename the GDB "Event" event class to InputEvent.
The "Event" name is the same as the base event class. That's a bit confusing, and makes it a little awkward to add other event types.
This commit is contained in:
parent
f9f46b8fa9
commit
cddf988bfd
2 changed files with 24 additions and 24 deletions
|
@ -166,18 +166,18 @@ debugger()
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
||||||
GDBListener::Event::Event(GDBListener *l, int fd, int e)
|
GDBListener::InputEvent::InputEvent(GDBListener *l, int fd, int e)
|
||||||
: PollEvent(fd, e), listener(l)
|
: PollEvent(fd, e), listener(l)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void
|
void
|
||||||
GDBListener::Event::process(int revent)
|
GDBListener::InputEvent::process(int revent)
|
||||||
{
|
{
|
||||||
listener->accept();
|
listener->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
GDBListener::GDBListener(BaseRemoteGDB *g, int p)
|
GDBListener::GDBListener(BaseRemoteGDB *g, int p)
|
||||||
: event(NULL), gdb(g), port(p)
|
: inputEvent(NULL), gdb(g), port(p)
|
||||||
{
|
{
|
||||||
assert(!gdb->listener);
|
assert(!gdb->listener);
|
||||||
gdb->listener = this;
|
gdb->listener = this;
|
||||||
|
@ -185,8 +185,8 @@ GDBListener::GDBListener(BaseRemoteGDB *g, int p)
|
||||||
|
|
||||||
GDBListener::~GDBListener()
|
GDBListener::~GDBListener()
|
||||||
{
|
{
|
||||||
if (event)
|
if (inputEvent)
|
||||||
delete event;
|
delete inputEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
string
|
string
|
||||||
|
@ -208,8 +208,8 @@ GDBListener::listen()
|
||||||
port++;
|
port++;
|
||||||
}
|
}
|
||||||
|
|
||||||
event = new Event(this, listener.getfd(), POLLIN);
|
inputEvent = new InputEvent(this, listener.getfd(), POLLIN);
|
||||||
pollQueue.schedule(event);
|
pollQueue.schedule(inputEvent);
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
gdb->number = debuggers.size();
|
gdb->number = debuggers.size();
|
||||||
|
@ -241,12 +241,12 @@ GDBListener::accept()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseRemoteGDB::Event::Event(BaseRemoteGDB *g, int fd, int e)
|
BaseRemoteGDB::InputEvent::InputEvent(BaseRemoteGDB *g, int fd, int e)
|
||||||
: PollEvent(fd, e), gdb(g)
|
: PollEvent(fd, e), gdb(g)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void
|
void
|
||||||
BaseRemoteGDB::Event::process(int revent)
|
BaseRemoteGDB::InputEvent::process(int revent)
|
||||||
{
|
{
|
||||||
BaseCPU *cpu = gdb->context->getCpuPtr();
|
BaseCPU *cpu = gdb->context->getCpuPtr();
|
||||||
EventQueue *eq = cpu->comInstEventQueue[gdb->context->threadId()];
|
EventQueue *eq = cpu->comInstEventQueue[gdb->context->threadId()];
|
||||||
|
@ -269,7 +269,7 @@ BaseRemoteGDB::TrapEvent::process()
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseRemoteGDB::BaseRemoteGDB(System *_system, ThreadContext *c, size_t cacheSize)
|
BaseRemoteGDB::BaseRemoteGDB(System *_system, ThreadContext *c, size_t cacheSize)
|
||||||
: event(NULL), trapEvent(this), listener(NULL), number(-1), fd(-1),
|
: inputEvent(NULL), trapEvent(this), listener(NULL), number(-1), fd(-1),
|
||||||
active(false), attached(false),
|
active(false), attached(false),
|
||||||
system(_system), context(c),
|
system(_system), context(c),
|
||||||
gdbregs(cacheSize)
|
gdbregs(cacheSize)
|
||||||
|
@ -279,8 +279,8 @@ BaseRemoteGDB::BaseRemoteGDB(System *_system, ThreadContext *c, size_t cacheSize
|
||||||
|
|
||||||
BaseRemoteGDB::~BaseRemoteGDB()
|
BaseRemoteGDB::~BaseRemoteGDB()
|
||||||
{
|
{
|
||||||
if (event)
|
if (inputEvent)
|
||||||
delete event;
|
delete inputEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
string
|
string
|
||||||
|
@ -298,8 +298,8 @@ BaseRemoteGDB::attach(int f)
|
||||||
{
|
{
|
||||||
fd = f;
|
fd = f;
|
||||||
|
|
||||||
event = new Event(this, fd, POLLIN);
|
inputEvent = new InputEvent(this, fd, POLLIN);
|
||||||
pollQueue.schedule(event);
|
pollQueue.schedule(inputEvent);
|
||||||
|
|
||||||
attached = true;
|
attached = true;
|
||||||
DPRINTFN("remote gdb attached\n");
|
DPRINTFN("remote gdb attached\n");
|
||||||
|
@ -312,7 +312,7 @@ BaseRemoteGDB::detach()
|
||||||
close(fd);
|
close(fd);
|
||||||
fd = -1;
|
fd = -1;
|
||||||
|
|
||||||
pollQueue.remove(event);
|
pollQueue.remove(inputEvent);
|
||||||
DPRINTFN("remote gdb detached\n");
|
DPRINTFN("remote gdb detached\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,17 +105,17 @@ class BaseRemoteGDB
|
||||||
virtual const char * gdb_command(char cmd);
|
virtual const char * gdb_command(char cmd);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
class Event : public PollEvent
|
class InputEvent : public PollEvent
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
BaseRemoteGDB *gdb;
|
BaseRemoteGDB *gdb;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Event(BaseRemoteGDB *g, int fd, int e);
|
InputEvent(BaseRemoteGDB *g, int fd, int e);
|
||||||
void process(int revent);
|
void process(int revent);
|
||||||
};
|
};
|
||||||
|
|
||||||
class TrapEvent : public ::Event
|
class TrapEvent : public Event
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
int _type;
|
int _type;
|
||||||
|
@ -129,8 +129,8 @@ class BaseRemoteGDB
|
||||||
void process();
|
void process();
|
||||||
};
|
};
|
||||||
|
|
||||||
friend class Event;
|
friend class InputEvent;
|
||||||
Event *event;
|
InputEvent *inputEvent;
|
||||||
TrapEvent trapEvent;
|
TrapEvent trapEvent;
|
||||||
GDBListener *listener;
|
GDBListener *listener;
|
||||||
int number;
|
int number;
|
||||||
|
@ -270,18 +270,18 @@ BaseRemoteGDB::write(Addr addr, T data)
|
||||||
class GDBListener
|
class GDBListener
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
class Event : public PollEvent
|
class InputEvent : public PollEvent
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
GDBListener *listener;
|
GDBListener *listener;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Event(GDBListener *l, int fd, int e);
|
InputEvent(GDBListener *l, int fd, int e);
|
||||||
void process(int revent);
|
void process(int revent);
|
||||||
};
|
};
|
||||||
|
|
||||||
friend class Event;
|
friend class InputEvent;
|
||||||
Event *event;
|
InputEvent *inputEvent;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ListenSocket listener;
|
ListenSocket listener;
|
||||||
|
|
Loading…
Reference in a new issue