2 * See the dyninst/COPYRIGHT file for copyright information.
4 * We provide the Paradyn Tools (below described as "Paradyn")
5 * on an AS IS basis, and do not warrant its validity or performance.
6 * We reserve the right to update, modify, or discontinue this
7 * software at any time. We shall have no obligation to supply such
8 * updates or modifications or any other form of support to you.
10 * By your use of Paradyn, you understand and agree that we (or any
11 * other person or entity with proprietary rights in Paradyn) are
12 * under no obligation to provide either maintenance services,
13 * update services, notices of latent defects, or correction of
14 * defects for Paradyn.
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License as published by the Free Software Foundation; either
19 * version 2.1 of the License, or (at your option) any later version.
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
30 #if !defined(EVENTTYPE_H_)
36 namespace ProcControlAPI {
38 class PC_EXPORT EventType
41 static const int Error = -1;
42 static const int Unset = 0;
43 static const int Exit = 1;
44 static const int Crash = 2;
45 static const int Fork = 3;
46 static const int Exec = 4;
47 static const int UserThreadCreate = 5;
48 static const int LWPCreate = 6;
49 static const int UserThreadDestroy = 7;
50 static const int LWPDestroy = 8;
51 static const int Stop = 9;
52 static const int Signal = 10;
53 static const int LibraryLoad = 11;
54 static const int LibraryUnload = 12;
55 static const int Bootstrap = 13;
56 static const int Breakpoint = 14;
57 static const int RPC = 15;
58 static const int SingleStep = 16;
59 static const int Library = 17;
60 static const int ForceTerminate = 18;
61 static const int ControlAuthority = 20;
62 static const int AsyncRead = 21;
63 static const int AsyncWrite = 22;
64 static const int AsyncReadAllRegs = 23;
65 static const int AsyncSetAllRegs = 24;
66 static const int AsyncFileRead = 25;
67 static const int PreSyscall = 26;
68 static const int PostSyscall = 27;
70 //These aren't completely real events. They can have callbacks registered, but won't be delivered.
71 // Instead, a real event will be delivered to their callback. E.g, a callback registered for
72 // Terminate will actually get Exit or Crash events.
73 static const int Terminate = 400;
74 static const int ThreadCreate = 401;
75 static const int ThreadDestroy = 402;
76 static const int AsyncIO = 403;
78 //Users do not recieve CBs for the below event types--ProcControlAPI internal
79 static const int InternalEvents = 500;
80 static const int BreakpointClear = 500;
81 static const int BreakpointRestore = 501;
82 static const int Async = 502;
83 static const int ChangePCStop = 503; // Used for bug_freebsd_change_pc
84 static const int Detach = 504;
85 static const int Detached = 505;
86 static const int IntBootstrap = 506;
87 static const int Nop = 507;
88 static const int ThreadDB = 508;
89 static const int RPCLaunch = 509;
90 static const int ThreadInfo = 510;
91 static const int WinStopThreadDestroy = 511;
92 static const int PreBootstrap = 512;
93 static const int Continue = 513;
94 static const int PostponedSyscall = 514;
96 //Users should define their own events at this value or higher.
97 static const int MaxProcCtrlEvent = 1000;
107 Code code() const { return ecode; }
108 Time time() const { return etime; }
110 EventType(Code e) : ecode(e), etime(Any) {}
111 EventType(Time t, Code e) : ecode(e), etime(t) {}
112 EventType() : ecode(Unset), etime(None) {}
114 std::string name() const;
122 bool operator()(const EventType &a, const EventType &b) const
124 if (a.code() < b.code())
126 if (a.code() > b.code())
128 return ((int) a.time() < (int) b.time());