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