]> git.tdb.fi Git - gldbg.git/blob - source/gldbg.h
543df05a580265b5d88e395f995ffb2b2a0f0438
[gldbg.git] / source / gldbg.h
1 /* $Id$
2
3 This file is part of gldbg
4 Copyright © 2009-2010  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 Tool;
22
23 class GlDbg: public Msp::Application
24 {
25 private:
26         CommandInterpreter cmd_interp;
27         Process process;
28         int sock_fd;
29         std::string buffer;
30         unsigned buf_offset;
31         bool flushing;
32         std::list<Tool *> tools;
33         Tracer tracer;
34         GlState glstate;
35         Profiler profiler;
36         bool got_sigchld;
37
38         static RegApp<GlDbg> reg;
39
40 public:
41         GlDbg(int, char **);
42         int main();
43         CommandInterpreter &get_command_interpreter() { return cmd_interp; }
44         Tracer &get_tracer() { return tracer; }
45         GlState &get_glstate() { return glstate; }
46         Profiler &get_profiler() { return profiler; }
47         Process &get_process() { return process; }
48         void launch();
49         void quit(bool);
50 private:
51         void tick();
52         void check_child();
53         void read_stream();
54         long ptrace(int, void *, void *);
55         virtual void sighandler(int);
56 };
57
58 #endif