10 #include "dyn_detail/boost/shared_ptr.hpp"
11 #include "dyn_detail/boost/enable_shared_from_this.hpp"
13 class installed_breakpoint;
17 namespace ProcControlAPI {
24 ArchEvent(std::string name_ = std::string(""));
26 std::string getName();
33 class EventBreakpoint;
37 class EventThreadDestroy;
42 class EventSingleStep;
43 class EventBreakpointClear;
46 class Event : public dyn_detail::boost::enable_shared_from_this<Event>
48 friend void dyn_detail::boost::checked_delete<Event>(Event *);
49 friend void dyn_detail::boost::checked_delete<const Event>(const Event *);
50 friend class ::HandlerPool;
52 typedef dyn_detail::boost::shared_ptr<Event> ptr;
53 typedef dyn_detail::boost::shared_ptr<const Event> const_ptr;
54 typedef dyn_detail::boost::weak_ptr<Event> weak_ptr;
56 Event(EventType etype_, Thread::ptr thread_ = Thread::ptr());
66 EventType getEventType() const;
67 Thread::const_ptr getThread() const;
68 Process::const_ptr getProcess() const;
69 SyncType getSyncType() const;
70 std::string name() const;
72 void setThread(Thread::const_ptr t);
73 void setProcess(Process::const_ptr p);
74 void setSyncType(SyncType t);
76 virtual bool suppressCB() const;
77 virtual bool triggersCB() const;
78 virtual bool canFastHandle() const;
79 virtual bool procStopper() const;
80 Event::weak_ptr subservientTo() const;
81 void addSubservientEvent(Event::ptr ev);
83 dyn_detail::boost::shared_ptr<EventTerminate> getEventTerminate();
84 dyn_detail::boost::shared_ptr<const EventTerminate> getEventTerminate() const;
86 dyn_detail::boost::shared_ptr<EventExit> getEventExit();
87 dyn_detail::boost::shared_ptr<const EventExit> getEventExit() const;
89 dyn_detail::boost::shared_ptr<EventCrash> getEventCrash();
90 dyn_detail::boost::shared_ptr<const EventCrash> getEventCrash() const;
92 dyn_detail::boost::shared_ptr<EventExec> getEventExec();
93 dyn_detail::boost::shared_ptr<const EventExec> getEventExec() const;
95 dyn_detail::boost::shared_ptr<EventStop> getEventStop();
96 dyn_detail::boost::shared_ptr<const EventStop> getEventStop() const;
98 dyn_detail::boost::shared_ptr<EventContinue> getEventContinue();
99 dyn_detail::boost::shared_ptr<const EventContinue> getEventContinue() const;
101 dyn_detail::boost::shared_ptr<EventBreakpoint> getEventBreakpoint();
102 dyn_detail::boost::shared_ptr<const EventBreakpoint> getEventBreakpoint() const;
104 dyn_detail::boost::shared_ptr<EventNewThread> getEventNewThread();
105 dyn_detail::boost::shared_ptr<const EventNewThread> getEventNewThread() const;
107 dyn_detail::boost::shared_ptr<EventThreadDestroy> getEventThreadDestroy();
108 dyn_detail::boost::shared_ptr<const EventThreadDestroy> getEventThreadDestroy() const;
110 dyn_detail::boost::shared_ptr<EventFork> getEventFork();
111 dyn_detail::boost::shared_ptr<const EventFork> getEventFork() const;
113 dyn_detail::boost::shared_ptr<EventSignal> getEventSignal();
114 dyn_detail::boost::shared_ptr<const EventSignal> getEventSignal() const;
116 dyn_detail::boost::shared_ptr<EventBootstrap> getEventBootstrap();
117 dyn_detail::boost::shared_ptr<const EventBootstrap> getEventBootstrap() const;
119 dyn_detail::boost::shared_ptr<EventRPC> getEventRPC();
120 dyn_detail::boost::shared_ptr<const EventRPC> getEventRPC() const;
122 dyn_detail::boost::shared_ptr<EventSingleStep> getEventSingleStep();
123 dyn_detail::boost::shared_ptr<const EventSingleStep> getEventSingleStep() const;
125 dyn_detail::boost::shared_ptr<EventBreakpointClear> getEventBreakpointClear();
126 dyn_detail::boost::shared_ptr<const EventBreakpointClear> getEventBreakpointClear() const;
128 dyn_detail::boost::shared_ptr<EventLibrary> getEventLibrary();
129 dyn_detail::boost::shared_ptr<const EventLibrary> getEventLibrary() const;
133 Thread::const_ptr thread;
134 Process::const_ptr proc;
136 std::vector<Event::ptr> subservient_events;
137 Event::weak_ptr master_event;
140 class EventTerminate : public Event
142 friend void dyn_detail::boost::checked_delete<EventTerminate>(EventTerminate *);
143 friend void dyn_detail::boost::checked_delete<const EventTerminate>(const EventTerminate *);
145 typedef dyn_detail::boost::shared_ptr<EventTerminate> ptr;
146 typedef dyn_detail::boost::shared_ptr<const EventTerminate> const_ptr;
147 EventTerminate(EventType type_);
148 virtual ~EventTerminate();
151 class EventExit : public EventTerminate
153 friend void dyn_detail::boost::checked_delete<EventExit>(EventExit *);
154 friend void dyn_detail::boost::checked_delete<const EventExit>(const EventExit *);
158 typedef dyn_detail::boost::shared_ptr<EventExit> ptr;
159 typedef dyn_detail::boost::shared_ptr<const EventExit> const_ptr;
160 int getExitCode() const;
161 EventExit(EventType::Time eventtime, int exitcode_);
162 virtual ~EventExit();
165 class EventCrash : public EventTerminate
167 friend void dyn_detail::boost::checked_delete<EventCrash>(EventCrash *);
168 friend void dyn_detail::boost::checked_delete<const EventCrash>(const EventCrash *);
172 typedef dyn_detail::boost::shared_ptr<EventCrash> ptr;
173 typedef dyn_detail::boost::shared_ptr<const EventCrash> const_ptr;
174 int getTermSignal() const;
175 EventCrash(int termsig);
176 virtual ~EventCrash();
179 class EventExec : public Event
181 friend void dyn_detail::boost::checked_delete<EventExec>(EventExec *);
182 friend void dyn_detail::boost::checked_delete<const EventExec>(const EventExec *);
184 std::string execpath;
186 typedef dyn_detail::boost::shared_ptr<EventExec> ptr;
187 typedef dyn_detail::boost::shared_ptr<const EventExec> const_ptr;
188 EventExec(EventType::Time etime_, std::string path = std::string(""));
189 virtual ~EventExec();
191 std::string getExecPath() const;
192 void setExecPath(std::string path_);
195 class EventStop : public Event
197 friend void dyn_detail::boost::checked_delete<EventStop>(EventStop *);
198 friend void dyn_detail::boost::checked_delete<const EventStop>(const EventStop *);
200 typedef dyn_detail::boost::shared_ptr<EventStop> ptr;
201 typedef dyn_detail::boost::shared_ptr<const EventStop> const_ptr;
203 virtual ~EventStop();
206 class EventContinue : public Event
208 friend void dyn_detail::boost::checked_delete<EventContinue>(EventContinue *);
209 friend void dyn_detail::boost::checked_delete<const EventContinue>(const EventContinue *);
213 typedef dyn_detail::boost::shared_ptr<EventContinue> ptr;
214 typedef dyn_detail::boost::shared_ptr<const EventContinue> const_ptr;
215 int getContinueSignal() const;
216 EventContinue(int contsig);
217 virtual ~EventContinue();
220 class EventBreakpoint : public Event
222 friend void dyn_detail::boost::checked_delete<EventBreakpoint>(EventBreakpoint *);
223 friend void dyn_detail::boost::checked_delete<const EventBreakpoint>(const EventBreakpoint *);
225 installed_breakpoint *ibp;
226 Dyninst::Address addr;
228 typedef dyn_detail::boost::shared_ptr<EventBreakpoint> ptr;
229 typedef dyn_detail::boost::shared_ptr<const EventBreakpoint> const_ptr;
230 installed_breakpoint *installedbp() const;
232 EventBreakpoint(Dyninst::Address addr, installed_breakpoint *ibp_);
233 virtual ~EventBreakpoint();
235 Dyninst::Address getAddress() const;
236 void getBreakpoints(std::vector<Breakpoint::const_ptr> &bps) const;
237 virtual bool suppressCB() const;
238 virtual bool procStopper() const;
241 class EventNewThread : public Event
243 friend void dyn_detail::boost::checked_delete<EventNewThread>(EventNewThread *);
244 friend void dyn_detail::boost::checked_delete<const EventNewThread>(const EventNewThread *);
248 typedef dyn_detail::boost::shared_ptr<EventNewThread> ptr;
249 typedef dyn_detail::boost::shared_ptr<const EventNewThread> const_ptr;
250 EventNewThread(Dyninst::LWP lwp_);
252 Dyninst::LWP getLWP() const;
253 Thread::const_ptr getNewThread() const;
256 class EventThreadDestroy : public Event
258 friend void dyn_detail::boost::checked_delete<EventThreadDestroy>(EventThreadDestroy *);
259 friend void dyn_detail::boost::checked_delete<const EventThreadDestroy>(const EventThreadDestroy *);
261 typedef dyn_detail::boost::shared_ptr<EventThreadDestroy> ptr;
262 typedef dyn_detail::boost::shared_ptr<const EventThreadDestroy> const_ptr;
263 EventThreadDestroy(EventType::Time time_);
264 virtual ~EventThreadDestroy();
267 class EventFork : public Event
269 friend void dyn_detail::boost::checked_delete<EventFork>(EventFork *);
270 friend void dyn_detail::boost::checked_delete<const EventFork>(const EventFork *);
274 typedef dyn_detail::boost::shared_ptr<EventFork> ptr;
275 typedef dyn_detail::boost::shared_ptr<const EventFork> const_ptr;
276 EventFork(Dyninst::PID pid_);
278 Dyninst::PID getPID() const;
279 Process::const_ptr getChildProcess() const;
282 class EventSignal : public Event
284 friend void dyn_detail::boost::checked_delete<EventSignal>(EventSignal *);
285 friend void dyn_detail::boost::checked_delete<const EventSignal>(const EventSignal *);
289 typedef dyn_detail::boost::shared_ptr<EventSignal> ptr;
290 typedef dyn_detail::boost::shared_ptr<const EventSignal> const_ptr;
291 EventSignal(int sig);
292 virtual ~EventSignal();
294 int getSignal() const;
297 class EventBootstrap : public Event
299 friend void dyn_detail::boost::checked_delete<EventBootstrap>(EventBootstrap *);
300 friend void dyn_detail::boost::checked_delete<const EventBootstrap>(const EventBootstrap *);
302 typedef dyn_detail::boost::shared_ptr<EventBootstrap> ptr;
303 typedef dyn_detail::boost::shared_ptr<const EventBootstrap> const_ptr;
305 virtual ~EventBootstrap();
308 class EventRPC : public Event
310 friend void dyn_detail::boost::checked_delete<EventRPC>(EventRPC *);
311 friend void dyn_detail::boost::checked_delete<const EventRPC>(const EventRPC *);
313 rpc_wrapper *wrapper;
315 virtual bool suppressCB() const;
316 rpc_wrapper *getllRPC();
317 typedef dyn_detail::boost::shared_ptr<EventRPC> ptr;
318 typedef dyn_detail::boost::shared_ptr<const EventRPC> const_ptr;
319 EventRPC(rpc_wrapper *wrapper_);
322 IRPC::const_ptr getIRPC() const;
325 class EventSingleStep : public Event
327 friend void dyn_detail::boost::checked_delete<EventSingleStep>(EventSingleStep *);
328 friend void dyn_detail::boost::checked_delete<const EventSingleStep>(const EventSingleStep *);
330 typedef dyn_detail::boost::shared_ptr<EventSingleStep> ptr;
331 typedef dyn_detail::boost::shared_ptr<const EventSingleStep> const_ptr;
336 class EventBreakpointClear : public Event
338 friend void dyn_detail::boost::checked_delete<EventBreakpointClear>(EventBreakpointClear *);
339 friend void dyn_detail::boost::checked_delete<const EventBreakpointClear>(const EventBreakpointClear *);
341 installed_breakpoint *bp_;
343 typedef dyn_detail::boost::shared_ptr<EventBreakpointClear> ptr;
344 typedef dyn_detail::boost::shared_ptr<const EventBreakpointClear> const_ptr;
345 EventBreakpointClear(installed_breakpoint *bp);
346 ~EventBreakpointClear();
348 installed_breakpoint *bp();
351 class EventLibrary : public Event
353 friend void dyn_detail::boost::checked_delete<EventLibrary>(EventLibrary *);
354 friend void dyn_detail::boost::checked_delete<const EventLibrary>(const EventLibrary *);
356 std::set<Library::ptr> added_libs;
357 std::set<Library::ptr> rmd_libs;
359 typedef dyn_detail::boost::shared_ptr<EventLibrary> ptr;
360 typedef dyn_detail::boost::shared_ptr<const EventLibrary> const_ptr;
362 EventLibrary(const std::set<Library::ptr> &added_libs_,
363 const std::set<Library::ptr> &rmd_libs_);
366 void setLibs(const std::set<Library::ptr> &added_libs_,
367 const std::set<Library::ptr> &rmd_libs_);
368 const std::set<Library::ptr> &libsAdded() const;
369 const std::set<Library::ptr> &libsRemoved() const;