]> git.tdb.fi Git - gldbg.git/blob - source/gldbg.h
Enable bidirectional communication between gldbg and glwrap.so
[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 "process.h"
17
18 class Tool;
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         std::list<Tool *> tools;
30         bool got_sigchld;
31
32         static RegApp<GlDbg> reg;
33
34 public:
35         GlDbg(int, char **);
36         ~GlDbg();
37
38         int main();
39         CommandInterpreter &get_command_interpreter() { return cmd_interp; }
40         Process &get_process() { return process; }
41         void launch();
42         void set_breakpoint(unsigned short, char);
43         void clear_breakpoint(unsigned short, char);
44         void quit(bool);
45 private:
46         void tick();
47         void check_child();
48         void read_stream();
49         virtual void sighandler(int);
50 };
51
52 #endif