]> git.tdb.fi Git - gldbg.git/blob - source/process.h
847b845d5cb814f3c073a7bc2186cbf5b428179a
[gldbg.git] / source / process.h
1 /* $Id$
2
3 This file is part of gldbg
4 Copyright © 2009  Mikko Rasa, Mikkosoft Productions
5 Distributed under the GPL
6 */
7
8 #ifndef PROCESS_H_
9 #define PROCESS_H_
10
11 #include <map>
12 #include <string>
13 #include <vector>
14
15 class Process
16 {
17 public:
18         enum State
19         {
20                 INACTIVE,
21                 STARTING,
22                 RUNNING,
23                 STOPPED
24         };
25
26 private:
27         std::vector<std::string> args;
28         std::map<std::string, std::string> env;
29         int pid;
30         State state;
31
32 public:
33         Process(const std::vector<std::string> &);
34         void setenv(const std::string &, const std::string &);
35         void launch();
36         int check();
37         void stop();
38         void resume(int = 0);
39         void kill();
40         State get_state() const { return state; }
41 private:
42         long ptrace(int, void *, void *);
43 };
44
45 #endif