Shadow Stack  0.2
 All Classes Namespaces Files Functions Variables Typedefs Macros
group.hpp
Go to the documentation of this file.
1 
2 #ifndef __GROUP_HPP__
3 #define __GROUP_HPP__
4 
5 
6 /*********************************************************/
7 /* */
8 /* Class Declarations */
9 /* */
10 /*********************************************************/
11 
12 
18  private:
19  // Delete unwanted 'constructors'
23 
24  // If enabled, terminate_group on destruction
25  bool enabled;
26 
27  public:
31 
35 
37  void disable();
38 };
39 
40 
41 // Note: DynamoRIO does NOT play well with pthreads.
42 // Since group.cpp is compiled into the DynamoRIO client
43 // group.cpp may NOT include proc_rc.hpp. This leads
44 // to a few oddities of the Group class
45 
46 
48 struct Group {
49 
58  static void setup();
59 
68  [[noreturn]] static void terminate( const char *const msg, bool is_error = true );
69 
70  private:
72  static bool setup_complete;
73 };
74 
75 
76 #endif
static bool setup_complete
Used to tell if the process group has started.
Definition: group.hpp:72
~TerminateOnDestruction()
Destructor On destruction, terminate the group if enabled.
Definition: group.cpp:86
A class that terminates the group when its destructor is called This is called even if a C++ exceptio...
Definition: group.hpp:17
bool enabled
Definition: group.hpp:25
static void setup()
Setup the group This function should NOT be called by the dynamorio client.
Definition: group.cpp:103
TerminateOnDestruction & operator=(const TerminateOnDestruction &)=delete
static void terminate(const char *const msg, bool is_error=true)
Terminates the process group via SIGKILL If is_error is set to true, msg is logged to the ERROR file...
Definition: group.cpp:137
A static class holding the group functions.
Definition: group.hpp:48
void disable()
Disable termination of the group on destruction.
Definition: group.cpp:93
TerminateOnDestruction()
Constructor Enabled terminateion on destruction by default.
Definition: group.cpp:83