]> git.tdb.fi Git - gldbg.git/blobdiff - source/process.h
Make gldbg interactive
[gldbg.git] / source / process.h
diff --git a/source/process.h b/source/process.h
new file mode 100644 (file)
index 0000000..847b845
--- /dev/null
@@ -0,0 +1,45 @@
+/* $Id$
+
+This file is part of gldbg
+Copyright © 2009  Mikko Rasa, Mikkosoft Productions
+Distributed under the GPL
+*/
+
+#ifndef PROCESS_H_
+#define PROCESS_H_
+
+#include <map>
+#include <string>
+#include <vector>
+
+class Process
+{
+public:
+       enum State
+       {
+               INACTIVE,
+               STARTING,
+               RUNNING,
+               STOPPED
+       };
+
+private:
+       std::vector<std::string> args;
+       std::map<std::string, std::string> env;
+       int pid;
+       State state;
+
+public:
+       Process(const std::vector<std::string> &);
+       void setenv(const std::string &, const std::string &);
+       void launch();
+       int check();
+       void stop();
+       void resume(int = 0);
+       void kill();
+       State get_state() const { return state; }
+private:
+       long ptrace(int, void *, void *);
+};
+
+#endif