/* * See the dyninst/COPYRIGHT file for copyright information. * * We provide the Paradyn Tools (below described as "Paradyn") * on an AS IS basis, and do not warrant its validity or performance. * We reserve the right to update, modify, or discontinue this * software at any time. We shall have no obligation to supply such * updates or modifications or any other form of support to you. * * By your use of Paradyn, you understand and agree that we (or any * other person or entity with proprietary rights in Paradyn) are * under no obligation to provide either maintenance services, * update services, notices of latent defects, or correction of * defects for Paradyn. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined(EVENT_H_) #define EVENT_H_ #include #include #include #include #include "dyntypes.h" #include "MachSyscall.h" #include "EventType.h" #include "PCProcess.h" #include "util.h" class HandlerPool; class HandleCallbacks; namespace Dyninst { namespace ProcControlAPI { class PC_EXPORT ArchEvent { private: std::string name; public: ArchEvent(std::string name_ = std::string("")); virtual ~ArchEvent(); std::string getName(); }; class Handler; class EventTerminate; class EventExit; class EventCrash; class EventForceTerminate; class EventExec; class EventBreakpoint; class EventStop; class EventNewThread; class EventNewUserThread; class EventNewLWP; class EventThreadDestroy; class EventUserThreadDestroy; class EventLWPDestroy; class EventFork; class EventSignal; class EventBootstrap; class EventRPC; class EventSingleStep; class EventBreakpointClear; class EventBreakpointRestore; class EventLibrary; class EventRPCLaunch; class EventAsync; class EventChangePCStop; class EventPreBootstrap; class EventDetach; class EventIntBootstrap; class EventNop; class EventThreadDB; class EventWinStopThreadDestroy; class EventControlAuthority; class EventAsyncIO; class EventAsyncRead; class EventAsyncWrite; class EventAsyncReadAllRegs; class EventAsyncSetAllRegs; class EventAsyncFileRead; class EventPostponedSyscall; class EventSyscall; class EventPreSyscall; class EventPostSyscall; class PC_EXPORT Event : public dyncompat::enable_shared_from_this { friend void dyncompat::checked_delete(Event *) noexcept; friend void dyncompat::checked_delete(const Event *) noexcept; friend class ::HandlerPool; friend class ::int_process; friend class ::HandleCallbacks; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; typedef dyncompat::weak_ptr weak_ptr; Event(EventType etype_, Thread::ptr thread_ = Thread::ptr()); virtual ~Event(); typedef enum { unset, async, sync_thread, sync_process } SyncType; EventType getEventType() const; Thread::const_ptr getThread() const; Process::const_ptr getProcess() const; SyncType getSyncType() const; std::string name() const; void setThread(Thread::const_ptr t); void setProcess(Process::const_ptr p); void setSyncType(SyncType t); void setSuppressCB(bool b); virtual bool suppressCB() const; virtual bool triggersCB() const; virtual bool canFastHandle() const; virtual bool userEvent() const; virtual void setUserEvent(bool b); virtual bool procStopper() const; Event::weak_ptr subservientTo() const; void addSubservientEvent(Event::ptr ev); dyncompat::shared_ptr getEventTerminate(); dyncompat::shared_ptr getEventTerminate() const; dyncompat::shared_ptr getEventExit(); dyncompat::shared_ptr getEventExit() const; dyncompat::shared_ptr getEventCrash(); dyncompat::shared_ptr getEventCrash() const; dyncompat::shared_ptr getEventForceTerminate(); dyncompat::shared_ptr getEventForceTerminate() const; dyncompat::shared_ptr getEventExec(); dyncompat::shared_ptr getEventExec() const; dyncompat::shared_ptr getEventStop(); dyncompat::shared_ptr getEventStop() const; dyncompat::shared_ptr getEventBreakpoint(); dyncompat::shared_ptr getEventBreakpoint() const; dyncompat::shared_ptr getEventNewThread(); dyncompat::shared_ptr getEventNewThread() const; dyncompat::shared_ptr getEventNewUserThread(); dyncompat::shared_ptr getEventNewUserThread() const; dyncompat::shared_ptr getEventNewLWP(); dyncompat::shared_ptr getEventNewLWP() const; dyncompat::shared_ptr getEventThreadDestroy(); dyncompat::shared_ptr getEventThreadDestroy() const; dyncompat::shared_ptr getEventUserThreadDestroy(); dyncompat::shared_ptr getEventUserThreadDestroy() const; dyncompat::shared_ptr getEventLWPDestroy(); dyncompat::shared_ptr getEventLWPDestroy() const; dyncompat::shared_ptr getEventFork(); dyncompat::shared_ptr getEventFork() const; dyncompat::shared_ptr getEventSignal(); dyncompat::shared_ptr getEventSignal() const; dyncompat::shared_ptr getEventBootstrap(); dyncompat::shared_ptr getEventBootstrap() const; dyncompat::shared_ptr getEventPreBootstrap(); dyncompat::shared_ptr getEventPreBootstrap() const; dyncompat::shared_ptr getEventRPC(); dyncompat::shared_ptr getEventRPC() const; dyncompat::shared_ptr getEventRPCLaunch(); dyncompat::shared_ptr getEventRPCLaunch() const; dyncompat::shared_ptr getEventSingleStep(); dyncompat::shared_ptr getEventSingleStep() const; dyncompat::shared_ptr getEventBreakpointClear(); dyncompat::shared_ptr getEventBreakpointClear() const; dyncompat::shared_ptr getEventBreakpointRestore(); dyncompat::shared_ptr getEventBreakpointRestore() const; dyncompat::shared_ptr getEventLibrary(); dyncompat::shared_ptr getEventLibrary() const; dyncompat::shared_ptr getEventAsync(); dyncompat::shared_ptr getEventAsync() const; dyncompat::shared_ptr getEventChangePCStop(); dyncompat::shared_ptr getEventChangePCStop() const; dyncompat::shared_ptr getEventDetach(); dyncompat::shared_ptr getEventDetach() const; dyncompat::shared_ptr getEventIntBootstrap(); dyncompat::shared_ptr getEventIntBootstrap() const; dyncompat::shared_ptr getEventNop(); dyncompat::shared_ptr getEventNop() const; dyncompat::shared_ptr getEventThreadDB(); dyncompat::shared_ptr getEventThreadDB() const; dyncompat::shared_ptr getEventWinStopThreadDestroy(); dyncompat::shared_ptr getEventWinStopThreadDestroy() const; dyncompat::shared_ptr getEventControlAuthority(); dyncompat::shared_ptr getEventControlAuthority() const; dyncompat::shared_ptr getEventAsyncIO(); dyncompat::shared_ptr getEventAsyncIO() const; dyncompat::shared_ptr getEventAsyncRead(); dyncompat::shared_ptr getEventAsyncRead() const; dyncompat::shared_ptr getEventAsyncWrite(); dyncompat::shared_ptr getEventAsyncWrite() const; dyncompat::shared_ptr getEventAsyncReadAllRegs(); dyncompat::shared_ptr getEventAsyncReadAllRegs() const; dyncompat::shared_ptr getEventAsyncSetAllRegs(); dyncompat::shared_ptr getEventAsyncSetAllRegs() const; dyncompat::shared_ptr getEventAsyncFileRead(); dyncompat::shared_ptr getEventAsyncFileRead() const; dyncompat::shared_ptr getEventPostponedSyscall(); dyncompat::shared_ptr getEventPostponedSyscall() const; dyncompat::shared_ptr getEventSyscall(); dyncompat::shared_ptr getEventSyscall() const; dyncompat::shared_ptr getEventPreSyscall(); dyncompat::shared_ptr getEventPreSyscall() const; dyncompat::shared_ptr getEventPostSyscall(); dyncompat::shared_ptr getEventPostSyscall() const; //Not meant for public consumption void setLastError(err_t ec, const char *es); protected: EventType etype; Thread::const_ptr thread; Process::const_ptr proc; SyncType stype; std::vector subservient_events; Event::weak_ptr master_event; std::set handled_by; bool suppress_cb; bool user_event; bool handling_started; bool noted_event; }; template OS& operator<<(OS& str, Event& e) { str << e.getEventType().name() << " event is "; switch(e.getSyncType()) { case Event::async: str << "asynchronous "; break; case Event::sync_thread: str << "thread synchronous "; break; case Event::sync_process: str << "process synchronous "; break; default: str << " "; break; } str << "on " << (e.getProcess() ? e.getProcess()->getPid() : -1); str << "/" << ((e.getThread()) ? e.getThread()->getLWP() : (Dyninst::LWP) -1); str << "\n"; return str; } class PC_EXPORT EventTerminate : public Event { friend void dyncompat::checked_delete(EventTerminate *) noexcept; friend void dyncompat::checked_delete(const EventTerminate *) noexcept; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventTerminate(EventType type_); virtual ~EventTerminate(); }; class PC_EXPORT EventExit : public EventTerminate { friend void dyncompat::checked_delete(EventExit *) noexcept; friend void dyncompat::checked_delete(const EventExit *) noexcept; private: int exitcode; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; int getExitCode() const; EventExit(EventType::Time eventtime, int exitcode_); virtual ~EventExit(); }; class PC_EXPORT EventCrash : public EventTerminate { friend void dyncompat::checked_delete(EventCrash *) noexcept; friend void dyncompat::checked_delete(const EventCrash *) noexcept; private: int termsig; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; int getTermSignal() const; EventCrash(int termsig); virtual ~EventCrash(); }; class PC_EXPORT EventForceTerminate : public EventTerminate { friend void dyncompat::checked_delete(EventForceTerminate *) noexcept; friend void dyncompat::checked_delete(const EventForceTerminate *) noexcept; private: int termsig; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; int getTermSignal() const; EventForceTerminate(int termsig); virtual ~EventForceTerminate(); }; class PC_EXPORT EventExec : public Event { friend void dyncompat::checked_delete(EventExec *) noexcept; friend void dyncompat::checked_delete(const EventExec *) noexcept; private: std::string execpath; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventExec(EventType::Time etime_, std::string path = std::string("")); virtual ~EventExec(); std::string getExecPath() const; void setExecPath(std::string path_); }; class PC_EXPORT EventStop : public Event { friend void dyncompat::checked_delete(EventStop *) noexcept; friend void dyncompat::checked_delete(const EventStop *) noexcept; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventStop(); virtual ~EventStop(); }; class PC_EXPORT EventNewThread : public Event { friend void dyncompat::checked_delete(EventNewThread *) noexcept; friend void dyncompat::checked_delete(const EventNewThread *) noexcept; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventNewThread(EventType et); virtual ~EventNewThread(); virtual Dyninst::LWP getLWP() const = 0; virtual Thread::const_ptr getNewThread() const = 0; }; class int_eventNewUserThread; class PC_EXPORT EventNewUserThread : public EventNewThread { friend void dyncompat::checked_delete(EventNewUserThread *) noexcept; friend void dyncompat::checked_delete(const EventNewUserThread *) noexcept; private: int_eventNewUserThread *iev; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventNewUserThread(); virtual ~EventNewUserThread(); int_eventNewUserThread *getInternalEvent() const; virtual Dyninst::LWP getLWP() const; virtual Thread::const_ptr getNewThread() const; }; class int_eventNewLWP; class PC_EXPORT EventNewLWP : public EventNewThread { friend void dyncompat::checked_delete(EventNewLWP *) noexcept; friend void dyncompat::checked_delete(const EventNewLWP *) noexcept; private: int_eventNewLWP *iev; Dyninst::LWP lwp; public: int_eventNewLWP *getInternalEvent(); typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventNewLWP(Dyninst::LWP lwp_, int status = 0); virtual ~EventNewLWP(); virtual Dyninst::LWP getLWP() const; virtual Thread::const_ptr getNewThread() const; }; class PC_EXPORT EventThreadDestroy : public Event { friend void dyncompat::checked_delete(EventThreadDestroy *) noexcept; friend void dyncompat::checked_delete(const EventThreadDestroy *) noexcept; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventThreadDestroy(EventType et); virtual ~EventThreadDestroy() = 0; }; class PC_EXPORT EventUserThreadDestroy : public EventThreadDestroy { friend void dyncompat::checked_delete(EventUserThreadDestroy *) noexcept; friend void dyncompat::checked_delete(const EventUserThreadDestroy *) noexcept; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventUserThreadDestroy(EventType::Time time_); virtual ~EventUserThreadDestroy(); }; class PC_EXPORT EventLWPDestroy : public EventThreadDestroy { friend void dyncompat::checked_delete(EventLWPDestroy *) noexcept; friend void dyncompat::checked_delete(const EventLWPDestroy *) noexcept; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventLWPDestroy(EventType::Time time_); virtual ~EventLWPDestroy(); }; class PC_EXPORT EventFork : public Event { friend void dyncompat::checked_delete(EventFork *) noexcept; friend void dyncompat::checked_delete(const EventFork *) noexcept; private: Dyninst::PID pid; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventFork(EventType::Time time_, Dyninst::PID pid_); virtual ~EventFork(); Dyninst::PID getPID() const; Process::const_ptr getChildProcess() const; }; class PC_EXPORT EventSignal : public Event { public: // causes of signal. unknown refers to all non-access violations. // this is needed for defensve mode. enum Cause { Unknown, ReadViolation, WriteViolation, ExecuteViolation }; friend void dyncompat::checked_delete(EventSignal *) noexcept; friend void dyncompat::checked_delete(const EventSignal *) noexcept; private: int sig; // address that caused the signal (if any), the cause, and // whether this is a first-cause exception (windows access violations). Address addr; Cause cause; bool first; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventSignal(int sig); EventSignal(int s, Address a, Cause c, bool f) : Event(EventType(EventType::None, EventType::Signal)), sig(s), addr(a), cause(c), first(f) { } virtual ~EventSignal(); int getSignal() const; void setThreadSignal(int newSignal) const; void clearThreadSignal() const; // used to get information about windows access violations. Address getAddress() const { return addr; } Cause getCause() const { return cause; } bool isFirst() const { return first; } }; class PC_EXPORT EventBootstrap : public Event { friend void dyncompat::checked_delete(EventBootstrap *) noexcept; friend void dyncompat::checked_delete(const EventBootstrap *) noexcept; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventBootstrap(); virtual ~EventBootstrap(); }; class PC_EXPORT EventPreBootstrap : public Event { friend void dyncompat::checked_delete(EventPreBootstrap *) noexcept; friend void dyncompat::checked_delete(const EventPreBootstrap *) noexcept; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventPreBootstrap(); virtual ~EventPreBootstrap(); }; class int_eventRPC; class PC_EXPORT EventRPC : public Event { friend void dyncompat::checked_delete(EventRPC *) noexcept; friend void dyncompat::checked_delete(const EventRPC *) noexcept; private: int_eventRPC *int_rpc; rpc_wrapper *wrapper; public: virtual bool suppressCB() const; rpc_wrapper *getllRPC(); typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventRPC(rpc_wrapper *wrapper_); virtual ~EventRPC(); IRPC::const_ptr getIRPC() const; int_eventRPC *getInternal() const; }; class PC_EXPORT EventRPCLaunch : public Event { friend void dyncompat::checked_delete(EventRPCLaunch *) noexcept; friend void dyncompat::checked_delete(const EventRPCLaunch *) noexcept; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; virtual bool procStopper() const; EventRPCLaunch(); virtual ~EventRPCLaunch(); }; class PC_EXPORT EventSingleStep : public Event { friend void dyncompat::checked_delete(EventSingleStep *) noexcept; friend void dyncompat::checked_delete(const EventSingleStep *) noexcept; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventSingleStep(); virtual ~EventSingleStep(); }; class PC_EXPORT EventSyscall : public Event { friend void dyncompat::checked_delete(EventSyscall *) noexcept; friend void dyncompat::checked_delete(const EventSyscall *) noexcept; friend MachSyscall makeFromEvent(const EventSyscall *); public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventSyscall(EventType type_); virtual ~EventSyscall(); Dyninst::Address getAddress() const; MachSyscall getSyscall() const; private: long getSyscallNumber() const; }; class PC_EXPORT EventPreSyscall : public EventSyscall { friend void dyncompat::checked_delete(EventPreSyscall *) noexcept; friend void dyncompat::checked_delete(const EventPreSyscall *) noexcept; friend MachSyscall makeFromEvent(const EventPreSyscall *); public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventPreSyscall(); virtual ~EventPreSyscall(); }; class PC_EXPORT EventPostSyscall : public EventSyscall { friend void dyncompat::checked_delete(EventPostSyscall *) noexcept; friend void dyncompat::checked_delete(const EventPostSyscall *) noexcept; friend MachSyscall makeFromEvent(const EventPostSyscall *); public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventPostSyscall(); virtual ~EventPostSyscall(); long getReturnValue() const; }; class int_eventBreakpoint; class PC_EXPORT EventBreakpoint : public Event { friend void dyncompat::checked_delete(EventBreakpoint *) noexcept; friend void dyncompat::checked_delete(const EventBreakpoint *) noexcept; private: int_eventBreakpoint *int_bp; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; int_eventBreakpoint *getInternal() const; EventBreakpoint(int_eventBreakpoint *ibp); virtual ~EventBreakpoint(); Dyninst::Address getAddress() const; void getBreakpoints(std::vector &bps) const; void getBreakpoints(std::vector &bps); virtual bool suppressCB() const; virtual bool procStopper() const; }; class int_eventBreakpointClear; class PC_EXPORT EventBreakpointClear : public Event { friend void dyncompat::checked_delete(EventBreakpointClear *) noexcept; friend void dyncompat::checked_delete(const EventBreakpointClear *) noexcept; private: int_eventBreakpointClear *int_bpc; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventBreakpointClear(); virtual ~EventBreakpointClear(); int_eventBreakpointClear *getInternal() const; virtual bool procStopper() const; }; class int_eventBreakpointRestore; class EventBreakpointRestore : public Event { friend void dyncompat::checked_delete(EventBreakpointRestore *) noexcept; friend void dyncompat::checked_delete(const EventBreakpointRestore *) noexcept; private: int_eventBreakpointRestore *int_bpr; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventBreakpointRestore(int_eventBreakpointRestore *iebpr); virtual ~EventBreakpointRestore(); int_eventBreakpointRestore *getInternal() const; }; class PC_EXPORT EventLibrary : public Event { friend void dyncompat::checked_delete(EventLibrary *) noexcept; friend void dyncompat::checked_delete(const EventLibrary *) noexcept; private: std::set added_libs; std::set rmd_libs; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventLibrary(); EventLibrary(const std::set &added_libs_, const std::set &rmd_libs_); virtual ~EventLibrary(); void setLibs(const std::set &added_libs_, const std::set &rmd_libs_); const std::set &libsAdded() const; const std::set &libsRemoved() const; }; class int_eventAsync; class PC_EXPORT EventAsync : public Event { friend void dyncompat::checked_delete(EventAsync *) noexcept; friend void dyncompat::checked_delete(const EventAsync *) noexcept; private: int_eventAsync *internal; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventAsync(int_eventAsync *ievent); virtual ~EventAsync(); int_eventAsync *getInternal() const; }; class PC_EXPORT EventChangePCStop : public Event { friend void dyncompat::checked_delete(EventChangePCStop *) noexcept; friend void dyncompat::checked_delete(const EventChangePCStop *) noexcept; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventChangePCStop(); virtual ~EventChangePCStop(); }; class int_eventDetach; class PC_EXPORT EventDetach : public Event { friend void dyncompat::checked_delete(EventDetach *) noexcept; friend void dyncompat::checked_delete(const EventDetach *) noexcept; int_eventDetach *int_detach; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventDetach(); virtual ~EventDetach(); int_eventDetach *getInternal() const; virtual bool procStopper() const; }; class PC_EXPORT EventIntBootstrap : public Event { friend void dyncompat::checked_delete(EventIntBootstrap *) noexcept; friend void dyncompat::checked_delete(const EventIntBootstrap *) noexcept; void *data; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventIntBootstrap(void *d = NULL); virtual ~EventIntBootstrap(); void *getData() const; void setData(void *v); }; class PC_EXPORT EventNop : public Event { friend void dyncompat::checked_delete(EventNop *) noexcept; friend void dyncompat::checked_delete(const EventNop *) noexcept; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventNop(); virtual ~EventNop(); }; class int_eventThreadDB; class PC_EXPORT EventThreadDB : public Event { friend void dyncompat::checked_delete(EventThreadDB *) noexcept; friend void dyncompat::checked_delete(const EventThreadDB *) noexcept; int_eventThreadDB *int_etdb; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; int_eventThreadDB *getInternal() const; EventThreadDB(); virtual ~EventThreadDB(); virtual bool triggersCB() const; }; class PC_EXPORT EventWinStopThreadDestroy : public EventThreadDestroy { friend void dyncompat::checked_delete(EventWinStopThreadDestroy *) noexcept; friend void dyncompat::checked_delete(const EventWinStopThreadDestroy *) noexcept; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventWinStopThreadDestroy(EventType::Time time_); virtual ~EventWinStopThreadDestroy(); }; class int_eventControlAuthority; class PC_EXPORT EventControlAuthority : public Event { friend void dyncompat::checked_delete(EventControlAuthority *) noexcept; friend void dyncompat::checked_delete(const EventControlAuthority *) noexcept; int_eventControlAuthority *iev; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; int_eventControlAuthority *getInternalEvent() const; EventControlAuthority(EventType::Time t, int_eventControlAuthority *iev_); virtual ~EventControlAuthority(); virtual bool procStopper() const; std::string otherToolName() const; unsigned int otherToolID() const; int otherToolPriority() const; typedef enum { ControlUnset, ControlLost, ControlGained, ControlNoChange } Trigger; Trigger eventTrigger() const; }; class int_eventAsyncIO; class PC_EXPORT EventAsyncIO : public Event { friend void dyncompat::checked_delete(EventAsyncIO *) noexcept; friend void dyncompat::checked_delete(const EventAsyncIO *) noexcept; protected: int_eventAsyncIO *iev; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; int_eventAsyncIO *getInternalEvent() const; EventAsyncIO(EventType et, int_eventAsyncIO *iev_); ~EventAsyncIO(); bool hadError() const; void *getOpaqueVal() const; }; class PC_EXPORT EventAsyncRead : public EventAsyncIO { friend void dyncompat::checked_delete(EventAsyncRead *) noexcept; friend void dyncompat::checked_delete(const EventAsyncRead *) noexcept; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventAsyncRead(int_eventAsyncIO *iev_); ~EventAsyncRead(); void *getMemory() const; size_t getSize() const; Dyninst::Address getAddress() const; }; class PC_EXPORT EventAsyncWrite : public EventAsyncIO { friend void dyncompat::checked_delete(EventAsyncWrite *) noexcept; friend void dyncompat::checked_delete(const EventAsyncWrite *) noexcept; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventAsyncWrite(int_eventAsyncIO *iev_); ~EventAsyncWrite(); size_t getSize() const; Dyninst::Address getAddress() const; }; class PC_EXPORT EventAsyncReadAllRegs : public EventAsyncIO { friend void dyncompat::checked_delete(EventAsyncReadAllRegs *) noexcept; friend void dyncompat::checked_delete(const EventAsyncReadAllRegs *) noexcept; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventAsyncReadAllRegs(int_eventAsyncIO *iev_); ~EventAsyncReadAllRegs(); const RegisterPool &getRegisters() const; }; class PC_EXPORT EventAsyncSetAllRegs : public EventAsyncIO { friend void dyncompat::checked_delete(EventAsyncSetAllRegs *) noexcept; friend void dyncompat::checked_delete(const EventAsyncSetAllRegs *) noexcept; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventAsyncSetAllRegs(int_eventAsyncIO *iev_); ~EventAsyncSetAllRegs(); }; class int_eventAsyncFileRead; class PC_EXPORT EventAsyncFileRead : public Event { friend void dyncompat::checked_delete(EventAsyncFileRead *) noexcept; friend void dyncompat::checked_delete(const EventAsyncFileRead *) noexcept; int_eventAsyncFileRead *iev; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; int_eventAsyncFileRead *getInternal(); EventAsyncFileRead(int_eventAsyncFileRead *iev_); ~EventAsyncFileRead(); std::string getFilename() const; size_t getReadSize() const; Dyninst::Offset getReadOffset() const; void *getBuffer() const; size_t getBufferSize() const; bool isEOF() const; int errorCode() const; }; class EventPostponedSyscall : public Event { friend void dyncompat::checked_delete(EventPostponedSyscall *) noexcept; friend void dyncompat::checked_delete(const EventPostponedSyscall *) noexcept; public: typedef dyncompat::shared_ptr ptr; typedef dyncompat::shared_ptr const_ptr; EventPostponedSyscall(); virtual ~EventPostponedSyscall(); }; } } #endif