def __createModel(self):
- #Breakpoint number, position and a boolean flag indicating whether BP has been set
- #at debugger yet
+ #Breakpoint number, position and a boolean flag indicating
+ #whether BP has been set at debugger yet
model = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
return model
dialog.run()
dialog.destroy()
+ return no
+
+
+ def delBreakpoints(self, file, lineno):
+
+ def addIters(model, path, iter, iters):
+ expr = model.get_value(iter,1)
+ expr = string.split(expr, " if ")[0].strip()
+ if expr == "%s:%d"%(file,lineno):
+ iters += [iter]
+
+ iters = []
+ self.model.foreach(addIters, iters)
+
+ #Need reversed here since rows are moved
+ #when removing rows
+ for i in reversed(iters):
+ self.model.remove(i)
+
+
def applyConfiguration(self, conf):
for b in conf.breakpoints:
def delBtnClicked(self, btn):
+ self.delBreakpoints("main.cpp", 26)
+ return
+
if not self.debugger.isActive():
return
--- /dev/null
+#!/usr/bin/python
+#shuber, 2008-06-24
+
+__author__ = "shuber"
+
+
+
+class Controller:
+
+ def __init__(self, debugger, statuswnd):
+ self.debugger = debugger
+ self.watchframe = statuswnd.frames[1]
+ self.bpframe = statuswnd.frames[2]
+
+ def addWatch(self, expr):
+ self.watchframe.addWatch(expr)
+
+ def delWatches(self, expr):
+ self.watchframe.delWatches(expr)
+
+ def addBreakpoint(self, file, lineno, cond=None):
+ return self.bpframe.addBreakpoint(file, lineno, cond)
+
+ def delBreakpoints(self, file, lineno):
+ self.bpframe.delBreakpoints(file, lineno)
import gobject
import gtk
-import vte
-import DbgTerminal
import StatusFrame
iter = self.model.iter_next(iter)
- def addBtnClicked(self, btn):
+ def addWatch(self, expr):
+ if self.debugger.isActive():
+ res = self.debugger.getExpression(expr)
+ else:
+ res = expr
+
iter = self.model.append()
- self.model.set(iter, 0, "0", 1, "0", 2, True)
+ self.model.set(iter, 0, expr, 1, res, 2, True)
+
+
+ def delWatches(self, expr):
+
+ def addIters(model, path, iter, iters):
+ if model.get_value(iter, 0)==expr:
+ iters += [iter]
+
+ iters = []
+ self.model.foreach(addIters, iters)
+
+ #Need reversed here since rows are moved
+ #when removing rows
+ for i in reversed(iters):
+ self.model.remove(i)
+
+
+ def addBtnClicked(self, btn):
+ self.addWatch("0")
+
def delBtnClicked(self, btn):
+
selection = self.tv.get_selection()
model, paths = selection.get_selected_rows()