//
//
-GDBListener::Event::Event(GDBListener *l, int fd, int e)
+GDBListener::InputEvent::InputEvent(GDBListener *l, int fd, int e)
: PollEvent(fd, e), listener(l)
{}
void
-GDBListener::Event::process(int revent)
+GDBListener::InputEvent::process(int revent)
{
listener->accept();
}
GDBListener::GDBListener(BaseRemoteGDB *g, int p)
- : event(NULL), gdb(g), port(p)
+ : inputEvent(NULL), gdb(g), port(p)
{
assert(!gdb->listener);
gdb->listener = this;
GDBListener::~GDBListener()
{
- if (event)
- delete event;
+ if (inputEvent)
+ delete inputEvent;
}
string
port++;
}
- event = new Event(this, listener.getfd(), POLLIN);
- pollQueue.schedule(event);
+ inputEvent = new InputEvent(this, listener.getfd(), POLLIN);
+ pollQueue.schedule(inputEvent);
#ifndef NDEBUG
gdb->number = debuggers.size();
}
}
-BaseRemoteGDB::Event::Event(BaseRemoteGDB *g, int fd, int e)
+BaseRemoteGDB::InputEvent::InputEvent(BaseRemoteGDB *g, int fd, int e)
: PollEvent(fd, e), gdb(g)
{}
void
-BaseRemoteGDB::Event::process(int revent)
+BaseRemoteGDB::InputEvent::process(int revent)
{
BaseCPU *cpu = gdb->context->getCpuPtr();
EventQueue *eq = cpu->comInstEventQueue[gdb->context->threadId()];
}
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),
system(_system), context(c),
gdbregs(cacheSize)
BaseRemoteGDB::~BaseRemoteGDB()
{
- if (event)
- delete event;
+ if (inputEvent)
+ delete inputEvent;
}
string
{
fd = f;
- event = new Event(this, fd, POLLIN);
- pollQueue.schedule(event);
+ inputEvent = new InputEvent(this, fd, POLLIN);
+ pollQueue.schedule(inputEvent);
attached = true;
DPRINTFN("remote gdb attached\n");
close(fd);
fd = -1;
- pollQueue.remove(event);
+ pollQueue.remove(inputEvent);
DPRINTFN("remote gdb detached\n");
}
virtual const char * gdb_command(char cmd);
protected:
- class Event : public PollEvent
+ class InputEvent : public PollEvent
{
protected:
BaseRemoteGDB *gdb;
public:
- Event(BaseRemoteGDB *g, int fd, int e);
+ InputEvent(BaseRemoteGDB *g, int fd, int e);
void process(int revent);
};
- class TrapEvent : public ::Event
+ class TrapEvent : public Event
{
protected:
int _type;
void process();
};
- friend class Event;
- Event *event;
+ friend class InputEvent;
+ InputEvent *inputEvent;
TrapEvent trapEvent;
GDBListener *listener;
int number;
class GDBListener
{
protected:
- class Event : public PollEvent
+ class InputEvent : public PollEvent
{
protected:
GDBListener *listener;
public:
- Event(GDBListener *l, int fd, int e);
+ InputEvent(GDBListener *l, int fd, int e);
void process(int revent);
};
- friend class Event;
- Event *event;
+ friend class InputEvent;
+ InputEvent *inputEvent;
protected:
ListenSocket listener;