]> git.tdb.fi Git - gldbg.git/blob - source/gldbg.h
e42e4aa1d1425cb5c105bca4528d6835ad81ad77
[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 "profiler.h"
19 #include "tracer.h"
20
21 class GlDbg: public Msp::Application
22 {
23 private:
24         CommandInterpreter cmd_interp;
25         Process process;
26         int sock_fd;
27         std::string buffer;
28         unsigned buf_offset;
29         bool flushing;
30         Tracer tracer;
31         GlState glstate;
32         Profiler profiler;
33         bool got_sigchld;
34
35         static RegApp<GlDbg> reg;
36
37 public:
38         GlDbg(int, char **);
39         int main();
40         Tracer &get_tracer() { return tracer; }
41         GlState &get_glstate() { return glstate; }
42         Profiler &get_profiler() { return profiler; }
43         Process &get_process() { return process; }
44         void launch();
45         void quit(bool);
46 private:
47         void tick();
48         void check_child();
49         void read_stream();
50         long ptrace(int, void *, void *);
51         virtual void sighandler(int);
52 };
53
54 #endif