def _onitemactivated(self, item, expr, is_valid):
        default_value = self.GetItemText(item, VariablesList.COL_VALUE)[1:]

        if is_valid:
            desc = "The new expression will be evaluated at the debuggee and its value will be set to the item."
            labeltext = "New Expression:"
            style=wx.TE_MULTILINE
        else:
            desc = "The current value of the expression (read only)."
            labeltext = "Current Expression:"
            style=wx.TE_MULTILINE|wx.TE_READONLY

        expr_dialog = ExpressionDialog(self, default_value, "Enter Expression", desc, labeltext, (1000, -1), style)
        pos = self.GetPositionTuple()
        expr_dialog.SetPosition((pos[0] + 50, pos[1] + 50))
        r = expr_dialog.ShowModal()
        if r != wx.ID_OK:
            expr_dialog.Destroy()
            return

        _expr = expr_dialog.get_expression()

        expr_dialog.Destroy()

        _suite = "%s = %s" % (expr, _expr)

        worker = RunProcInThread(self.listtype, self._onitemactivatedcallback,
                                 RpdbDebugger().execute, _suite)
        worker.start()
    def _onitemactivated(self, item, expr, is_valid):
        default_value = self.GetItemText(item, VariablesList.COL_VALUE)[1:]

        if is_valid:
            desc = "The new expression will be evaluated at the debuggee and its value will be set to the item."
            labeltext = "New Expression:"
            style = wx.TE_MULTILINE
        else:
            desc = "The current value of the expression (read only)."
            labeltext = "Current Expression:"
            style = wx.TE_MULTILINE | wx.TE_READONLY

        expr_dialog = ExpressionDialog(self, default_value, "Enter Expression",
                                       desc, labeltext, (1000, -1), style)
        pos = self.GetPositionTuple()
        expr_dialog.SetPosition((pos[0] + 50, pos[1] + 50))
        r = expr_dialog.ShowModal()
        if r != wx.ID_OK:
            expr_dialog.Destroy()
            return

        _expr = expr_dialog.get_expression()

        expr_dialog.Destroy()

        _suite = "%s = %s" % (expr, _expr)

        worker = RunProcInThread(self.listtype, self._onitemactivatedcallback,
                                 RpdbDebugger().execute, _suite)
        worker.start()
 def do_refresh(self, event=None):
     host = self.m_entry_host.Value
     if not host:
         host = 'localhost'
     self.Parent._lasthost = host
     worker = RunProcInThread("DbgAttach", self._onserverlist,
                              RpdbDebugger().get_server_list, host)
     worker.start()
 def Evaluate(self, enabled, expression, idx):
     if not enabled or not expression or not RpdbDebugger().broken:
         return
     worker = RunProcInThread("Expr", self.fillexpressionvalue, \
                              RpdbDebugger().evaluate, expression)
     worker.pass_parameter(idx)
     worker.start()
     worker2 = RunProcInThread("Expr", self.fillexpressiontype, \
                              RpdbDebugger().evaluate, "type(%s).__name__" % expression)
     worker2.pass_parameter(idx)
     worker2.start()
Example #5
0
    def CatchUnhandledException(self):
        if not ToolConfig.GetConfigValue(ToolConfig.TLC_IGNORE_SYSEXIT, True):
            wx.CallAfter(self._unhandledexception)
            return
            
        expressionlist = [(RPDBEXCEPTIONSSTR, True)]

        worker = RunProcInThread(RPDBEXCEPTIONSSTR, self._issysexit,
                                 RpdbDebugger().catchexc_get_namespace,
                                 expressionlist, 0)
        worker.start()
Example #6
0
 def OnExecute(self, event):
     """Execute an expression"""
     desc = _("This code will be executed at the debuggee:")
     expr_dialog = ExpressionDialog(self, u"", _("Enter Code to Execute"),
                                    desc, None, (200, 200))
     pos = self.GetPositionTuple()
     expr_dialog.SetPosition((pos[0] + 50, pos[1] + 50))
     if expr_dialog.ShowModal() == wx.ID_OK:
         _expr = expr_dialog.get_expression()
         worker = RunProcInThread("DbgExec", self._oncodeexecuted,
                                  RpdbDebugger().execute, _expr)
         worker.start()
     expr_dialog.Destroy()
 def OnExecute(self, event):
     """Execute an expression"""
     desc = _("This code will be executed at the debuggee:")
     expr_dialog = ExpressionDialog(self, u"", _("Enter Code to Execute"),
                                    desc, None, (200, 200))
     pos = self.GetPositionTuple()
     expr_dialog.SetPosition((pos[0] + 50, pos[1] + 50))
     if expr_dialog.ShowModal() == wx.ID_OK:
         _expr = expr_dialog.get_expression()
         worker = RunProcInThread("DbgExec", self._oncodeexecuted,
                                  RpdbDebugger().execute, _expr)
         worker.start()
     expr_dialog.Destroy()
    def update_namespace(self, key, expressionlist):
        old_key = self.key
        old_expressionlist = self.get_expression_list()

        if key == old_key:
            expressionlist = old_expressionlist

        self.key = key

        if expressionlist is None:
            expressionlist = [(self.listtype, True)]

        worker = RunProcInThread(self.listtype, self.UpdateVariablesList,
                                 RpdbDebugger().catchexc_get_namespace,
                                 expressionlist, self.FilterLevel)
        worker.start()
        return (old_key, old_expressionlist)
    def update_namespace(self, key, expressionlist):
        old_key = self.key
        old_expressionlist = self.get_expression_list()

        if key == old_key:
            expressionlist = old_expressionlist

        self.key = key

        if expressionlist is None:
            expressionlist = [(self.listtype, True)]

        worker = RunProcInThread(self.listtype, self.UpdateVariablesList,
                                 RpdbDebugger().catchexc_get_namespace,
                                 expressionlist, self.FilterLevel)
        worker.start()
        return (old_key, old_expressionlist)
    def _onitemexpanding(self, item):
        self.DeleteChildren(item)

        child = self.AppendItem(item, _("Loading..."))
        self.SetItemText(child, u' ' + _("Loading..."), VariablesList.COL_VALUE)
        self.SetItemText(child, ' ' + _("Loading..."), VariablesList.COL_TYPE)
        self.SetItemPyData(child, (_("Loading..."), False))

        (expr, is_valid) = self.GetPyData(item)

        item = self.find_item(expr)
        if item == None:
            return

        worker = RunProcInThread(self.listtype, self._itemexpandingcallback,
                                 RpdbDebugger().get_namespace, [(expr, True)],
                                 self.FilterLevel)
        worker.pass_parameter(item)
        worker.start()
    def _onitemexpanding(self, item):
        self.DeleteChildren(item)

        child = self.AppendItem(item, _("Loading..."))
        self.SetItemText(child, u' ' + _("Loading..."),
                         VariablesList.COL_VALUE)
        self.SetItemText(child, ' ' + _("Loading..."), VariablesList.COL_TYPE)
        self.SetItemPyData(child, (_("Loading..."), False))

        (expr, is_valid) = self.GetPyData(item)

        item = self.find_item(expr)
        if item == None:
            return

        worker = RunProcInThread(self.listtype, self._itemexpandingcallback,
                                 RpdbDebugger().get_namespace, [(expr, True)],
                                 self.FilterLevel)
        worker.pass_parameter(item)
        worker.start()
Example #12
0
 def RunDebugger(self):
     self.debuggeewindow.calldebugger = None
     self.processcreator.restorepath()
     worker = RunProcInThread("Debug", None,
                              RpdbDebugger().attach, self.processcreator)
     worker.start()
 def Evaluate(self, enabled, expression, idx):
     if not enabled or not expression or not RpdbDebugger().broken:
         return
     worker = RunProcInThread("Expr", self.fillexpressionvalue, \
                              RpdbDebugger().evaluate, expression)
     worker.pass_parameter(idx)
     worker.start()
     worker2 = RunProcInThread("Expr", self.fillexpressiontype, \
                              RpdbDebugger().evaluate, "type(%s).__name__" % expression)
     worker2.pass_parameter(idx)
     worker2.start()
 def RunDebugger(self):                    
     self.debuggeewindow.calldebugger = None
     self.processcreator.restorepath()
     worker = RunProcInThread("Debug", None, RpdbDebugger().attach, self.processcreator)
     worker.start()