]> git.tdb.fi Git - gldbg.git/blobdiff - source/gldbg.cpp
Consolidate genwrap.py and genenum.py into generate.py
[gldbg.git] / source / gldbg.cpp
index 5a4ad191f65c29a6c760deae5c329657b44b21b0..d18ff51bba753b9c2ccbb97cb510d48169fa957a 100644 (file)
@@ -26,6 +26,7 @@ Application::RegApp<GlDbg> GlDbg::reg;
 GlDbg::GlDbg(int argc, char **argv):
        cmd_interp(*this),
        process(vector<string>(argv+1, argv+argc)),
+       buf_offset(0),
        flushing(false),
        got_sigchld(false)
 {
@@ -39,7 +40,13 @@ int GlDbg::main()
        catch_signal(SIGCHLD);
        set_loop_mode(TICK_BUSY);
 
+       IO::print("GLdbg 0.0\n");
+       IO::print("Copyright © 2009 Mikkosoft Productions\n");
+       IO::print("Type \"help\" for a list of commands\n");
+
        Application::main();
+
+       return 0;
 }
 
 void GlDbg::launch()
@@ -59,9 +66,9 @@ void GlDbg::launch()
        close(fds[1]);
 }
        
-void GlDbg::quit()
+void GlDbg::quit(bool force)
 {
-       if(process.get_state()!=Process::INACTIVE)
+       if(!force && process.get_state()!=Process::INACTIVE)
                throw InvalidState("Program is still running");
        exit(0);
 }
@@ -127,6 +134,8 @@ void GlDbg::read_stream()
                                if(size<0)
                                        break;
                                tracer.decode(data, len);
+                               glstate.decode(data, len);
+                               profiler.decode(data, len);
                                buf_offset += size;
                        }
                        if(buf_offset>8192)