]> git.tdb.fi Git - gldbg.git/blob - source/process.h
Replace per-file license notices with License.txt
[gldbg.git] / source / process.h
1 #ifndef PROCESS_H_
2 #define PROCESS_H_
3
4 #include <map>
5 #include <string>
6 #include <vector>
7
8 class Process
9 {
10 public:
11         enum State
12         {
13                 INACTIVE,
14                 STARTING,
15                 RUNNING,
16                 STOPPED
17         };
18
19 private:
20         std::vector<std::string> args;
21         std::map<std::string, std::string> env;
22         int pid;
23         State state;
24
25 public:
26         Process(const std::vector<std::string> &);
27         void setenv(const std::string &, const std::string &);
28         void launch();
29         int check();
30         void stop();
31         void resume(int = 0);
32         void kill();
33         State get_state() const { return state; }
34 private:
35         long ptrace(int, void *, void *);
36 };
37
38 #endif