# Path: debugger/enums.py
# class ProcessState(Enum):
#     """
#     Represents the debugged process' state.
#     """
#     Attaching = 3
#     Connected = 2
#     Crashed = 8
#     Detached = 9
#     Exited = 10
#     Invalid = 0
#     Launching = 4
#     Running = 6
#     Stepping = 7
#     Stopped = 5
#     Suspended = 11
#     Unloaded = 1
# 
# Path: debugger/util.py
# class Logger(object):
#     """
#     Helper class for logging.
#     """
#     logger = None
# 
#     @staticmethod
#     def init_logger(level):
#         logging.basicConfig()
#         Logger.logger = logging.getLogger("debugger")
#         Logger.logger.setLevel(level)
# 
#     @staticmethod
#     def debug(message, *args, **kwargs):
#         Logger.logger.debug(message, *args, **kwargs)
# 
#     @staticmethod
#     def info(message, *args, **kwargs):
#         Logger.logger.info(message, *args, **kwargs)


from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import Pango
from debugger.enums import ProcessState
from debugger.util import Logger
from gui_util import require_gui_thread, run_on_gui
import select
import threading
import time
import traceback
        Console.__init__(self, width, height)

        self.textview.set_editable(True)

        self.tag_stdout = self.get_buffer().create_tag("stdout",
                                                       foreground="black",
                                                       editable=False)
        self.tag_stderr = self.get_buffer().create_tag("stderr",
                                                       foreground="red",
                                                       editable=False)
        self.tag_stdin = self.get_buffer().create_tag("stdin",
                                                      foreground="blue",
                                                      editable=True)
        self.tag_handled = self.get_buffer().create_tag("handled",
                                                        editable=False)

        self.watch_thread = None
        self.stop_thread = threading.Event()

        self.textview.connect_after("key-release-event",
                                    lambda widget, key: self._handle_key(key))

        self.debugger = None
        self.last_handled_char = Gtk.TextMark.new("last-checked-text", True)
        self.get_buffer().add_mark(self.last_handled_char,
                                   self.get_buffer().get_start_iter())

        self.textview.set_editable(False)

    def _handle_process_state_change(self, state, event_data):

# Path: debugger/enums.py
# class ProcessState(Enum):
#     """
#     Represents the debugged process' state.
#     """
#     Attaching = 3
#     Connected = 2
#     Crashed = 8
#     Detached = 9
#     Exited = 10
#     Invalid = 0
#     Launching = 4
#     Running = 6
#     Stepping = 7
#     Stopped = 5
#     Suspended = 11
#     Unloaded = 1
# 
# Path: debugger/util.py
# class Logger(object):
#     """
#     Helper class for logging.
#     """
#     logger = None
# 
#     @staticmethod
#     def init_logger(level):
#         logging.basicConfig()
#         Logger.logger = logging.getLogger("debugger")
#         Logger.logger.setLevel(level)
# 
#     @staticmethod
#     def debug(message, *args, **kwargs):
#         Logger.logger.debug(message, *args, **kwargs)
# 
#     @staticmethod
#     def info(message, *args, **kwargs):
#         Logger.logger.info(message, *args, **kwargs)


# Path: gui/console.py
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import Pango
from debugger.enums import ProcessState
from debugger.util import Logger
from gui_util import require_gui_thread, run_on_gui
import select
import threading
import time
import traceback

        Console.__init__(self, width, height)

        self.textview.set_editable(True)

        self.tag_stdout = self.get_buffer().create_tag("stdout",
                                                       foreground="black",
                                                       editable=False)
        self.tag_stderr = self.get_buffer().create_tag("stderr",
                                                       foreground="red",
                                                       editable=False)
        self.tag_stdin = self.get_buffer().create_tag("stdin",
                                                      foreground="blue",
                                                      editable=True)
        self.tag_handled = self.get_buffer().create_tag("handled",
                                                        editable=False)

        self.watch_thread = None
        self.stop_thread = threading.Event()

        self.textview.connect_after("key-release-event",
                                    lambda widget, key: self._handle_key(key))

        self.debugger = None
        self.last_handled_char = Gtk.TextMark.new("last-checked-text", True)
        self.get_buffer().add_mark(self.last_handled_char,
                                   self.get_buffer().get_start_iter())

        self.textview.set_editable(False)

    def _handle_process_state_change(self, state, event_data):

        if state == ProcessState.Running: