remote_gdb.hh (10597:bd68c6838b9f) remote_gdb.hh (10598:3d7653a2538b)
1/*
2 * Copyright 2014 Google, Inc.
3 * Copyright (c) 2002-2005 The Regents of The University of Michigan
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 91 unchanged lines hidden (view full) ---

100 //between architectures, so they're defined as virtual
101 //functions.
102 virtual void mem2hex(void *, const void *, int);
103 virtual const char * hex2mem(void *, const char *, int);
104 virtual const char * break_type(char c);
105 virtual const char * gdb_command(char cmd);
106
107 protected:
1/*
2 * Copyright 2014 Google, Inc.
3 * Copyright (c) 2002-2005 The Regents of The University of Michigan
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 91 unchanged lines hidden (view full) ---

100 //between architectures, so they're defined as virtual
101 //functions.
102 virtual void mem2hex(void *, const void *, int);
103 virtual const char * hex2mem(void *, const char *, int);
104 virtual const char * break_type(char c);
105 virtual const char * gdb_command(char cmd);
106
107 protected:
108 class Event : public PollEvent
108 class InputEvent : public PollEvent
109 {
110 protected:
111 BaseRemoteGDB *gdb;
112
113 public:
109 {
110 protected:
111 BaseRemoteGDB *gdb;
112
113 public:
114 Event(BaseRemoteGDB *g, int fd, int e);
114 InputEvent(BaseRemoteGDB *g, int fd, int e);
115 void process(int revent);
116 };
117
115 void process(int revent);
116 };
117
118 class TrapEvent : public ::Event
118 class TrapEvent : public Event
119 {
120 protected:
121 int _type;
122 BaseRemoteGDB *gdb;
123
124 public:
125 TrapEvent(BaseRemoteGDB *g) : gdb(g)
126 {}
127
128 void type(int t) { _type = t; }
129 void process();
130 };
131
119 {
120 protected:
121 int _type;
122 BaseRemoteGDB *gdb;
123
124 public:
125 TrapEvent(BaseRemoteGDB *g) : gdb(g)
126 {}
127
128 void type(int t) { _type = t; }
129 void process();
130 };
131
132 friend class Event;
133 Event *event;
132 friend class InputEvent;
133 InputEvent *inputEvent;
134 TrapEvent trapEvent;
135 GDBListener *listener;
136 int number;
137
138 protected:
139 //The socket commands come in through
140 int fd;
141

--- 123 unchanged lines hidden (view full) ---

265template <class T>
266inline void
267BaseRemoteGDB::write(Addr addr, T data)
268{ write(addr, sizeof(T), (const char *)&data); }
269
270class GDBListener
271{
272 protected:
134 TrapEvent trapEvent;
135 GDBListener *listener;
136 int number;
137
138 protected:
139 //The socket commands come in through
140 int fd;
141

--- 123 unchanged lines hidden (view full) ---

265template <class T>
266inline void
267BaseRemoteGDB::write(Addr addr, T data)
268{ write(addr, sizeof(T), (const char *)&data); }
269
270class GDBListener
271{
272 protected:
273 class Event : public PollEvent
273 class InputEvent : public PollEvent
274 {
275 protected:
276 GDBListener *listener;
277
278 public:
274 {
275 protected:
276 GDBListener *listener;
277
278 public:
279 Event(GDBListener *l, int fd, int e);
279 InputEvent(GDBListener *l, int fd, int e);
280 void process(int revent);
281 };
282
280 void process(int revent);
281 };
282
283 friend class Event;
284 Event *event;
283 friend class InputEvent;
284 InputEvent *inputEvent;
285
286 protected:
287 ListenSocket listener;
288 BaseRemoteGDB *gdb;
289 int port;
290
291 public:
292 GDBListener(BaseRemoteGDB *g, int p);
293 ~GDBListener();
294
295 void accept();
296 void listen();
297 std::string name();
298};
299
300#endif /* __REMOTE_GDB_H__ */
285
286 protected:
287 ListenSocket listener;
288 BaseRemoteGDB *gdb;
289 int port;
290
291 public:
292 GDBListener(BaseRemoteGDB *g, int p);
293 ~GDBListener();
294
295 void accept();
296 void listen();
297 std::string name();
298};
299
300#endif /* __REMOTE_GDB_H__ */