]> git.tdb.fi Git - gldbg.git/blob - source/gldbg.h
Prompt to terminate target process in exit command if it's still running
[gldbg.git] / source / gldbg.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 GLDBG_H_
9 #define GLDBG_H_
10
11 #include <string>
12 #include <vector>
13 #include <msp/core/application.h>
14 #include <msp/fs/path.h>
15 #include "commandinterpreter.h"
16 #include "glstate.h"
17 #include "process.h"
18 #include "tracer.h"
19
20 class GlDbg: public Msp::Application
21 {
22 private:
23         CommandInterpreter cmd_interp;
24         Process process;
25         int sock_fd;
26         std::string buffer;
27         unsigned buf_offset;
28         bool flushing;
29         Tracer tracer;
30         GlState glstate;
31         bool got_sigchld;
32
33         static RegApp<GlDbg> reg;
34
35 public:
36         GlDbg(int, char **);
37         int main();
38         Tracer &get_tracer() { return tracer; }
39         GlState &get_glstate() { return glstate; }
40         Process &get_process() { return process; }
41         void launch();
42         void quit(bool);
43 private:
44         void tick();
45         void check_child();
46         void read_stream();
47         long ptrace(int, void *, void *);
48         virtual void sighandler(int);
49 };
50
51 #endif