X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgldbg.h;h=99f0863c2c3f72cf91852ea0e356781aed23994c;hb=6d297b506314c07bff3d77c2853a5f59380cfcb0;hp=ff844518ed68f715e0e3a5036be9b7d4ab95716c;hpb=ee7f1e3a5912789664648ac5be85127e62c1cda5;p=gldbg.git diff --git a/source/gldbg.h b/source/gldbg.h index ff84451..99f0863 100644 --- a/source/gldbg.h +++ b/source/gldbg.h @@ -1,7 +1,7 @@ /* $Id$ This file is part of gldbg -Copyright © 2009 Mikko Rasa, Mikkosoft Productions +Copyright © 2009-2010 Mikko Rasa, Mikkosoft Productions Distributed under the GPL */ @@ -13,38 +13,65 @@ Distributed under the GPL #include #include #include "commandinterpreter.h" -#include "glstate.h" +#include "packet.h" #include "process.h" -#include "tracer.h" + +class Tool; class GlDbg: public Msp::Application { private: + typedef std::list ToolList; + + struct Breakpoint + { + unsigned short function; + unsigned char flag; + ToolList owners; + + Breakpoint(unsigned short, unsigned char); + + void add_owner(Tool *); + bool has_owner(Tool *) const; + void remove_owner(Tool *); + }; + + typedef std::list BreakList; + CommandInterpreter cmd_interp; Process process; int sock_fd; std::string buffer; unsigned buf_offset; bool flushing; - Tracer tracer; - GlState glstate; + ToolList tools; bool got_sigchld; + int stop_reason; + BreakList breakpoints; + const Breakpoint *current_break; + ToolList break_holders; static RegApp reg; public: GlDbg(int, char **); + ~GlDbg(); + int main(); - Tracer &get_tracer() { return tracer; } - GlState &get_glstate() { return glstate; } + CommandInterpreter &get_command_interpreter() { return cmd_interp; } Process &get_process() { return process; } void launch(); - void quit(); + void send(GlPacket *); + void hold(); + void set_breakpoint(unsigned short, unsigned char, Tool *); + void clear_breakpoint(unsigned short, unsigned char, Tool *); + void resume_from_break(Tool *); + void quit(bool); private: void tick(); void check_child(); void read_stream(); - long ptrace(int, void *, void *); + Breakpoint *get_breakpoint(unsigned short, unsigned char); virtual void sighandler(int); };