From 6e96e757d011b60496311171a18983c5c7407399 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Mon, 23 Jun 2008 13:32:30 +0100 Subject: [PATCH] pygdb saves command now --- Configuration.py | 18 ++++++++++++++++++ StatusWindow.py | 2 ++ pygdb.vim | 6 ++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Configuration.py b/Configuration.py index d97e1c4..778afb2 100644 --- a/Configuration.py +++ b/Configuration.py @@ -21,6 +21,7 @@ class Configuration: self.watches = [] self.ints = [] self.currfile, self.currlineno = None, 0 + self.command = None def load(self, filename): @@ -45,6 +46,8 @@ class Configuration: self.parseInt(tail) elif cmd == "currpos": self.parseCurrpos(tail) + elif cmd == "cmd": + self.parseCommand(tail) else: cnt -= 1 print "Unkown command", cmd @@ -71,6 +74,9 @@ class Configuration: if self.isCurrposSet(): self.__writeCurrpos(f) + if self.getCommand() != None: + self.__writeCommand(f) + f.close() return True @@ -129,6 +135,9 @@ class Configuration: self.setCurrpos(file, lineno) + def parseCommand(self, tail): + self.command = tail + def __writeBreak(self, f, b): if b["cond"] != None: @@ -145,6 +154,9 @@ class Configuration: def __writeCurrpos(self, f): f.write("currpos %s:%d\n" % (self.currfile, self.currlineno)) + def __writeCommand(self, f): + f.write("cmd %s\n" % self.command) + def addBreak(self, file, lineno, cond=None): bp = {"file" : file, "lineno" : lineno, "cond" : cond} @@ -166,10 +178,16 @@ class Configuration: def isCurrposSet(self): return self.currfile!=None + def delCurrpos(self): self.currfile = None + def setCommand(self,cmd): + self.command = cmd + + def getCommand(self): + return self.command def findInt(self, name): for i in self.ints: diff --git a/StatusWindow.py b/StatusWindow.py index 07abd4c..99382ff 100644 --- a/StatusWindow.py +++ b/StatusWindow.py @@ -89,6 +89,8 @@ class StatusWindow (gtk.Window): conf.addInt("statuswnd-paned1", self.paned1.get_position()) conf.addInt("statuswnd-paned2", self.paned2.get_position()) + conf.setCommand( self.debugger.clientCmd ) + for f in self.frames: f.fillConfiguration(conf) diff --git a/pygdb.vim b/pygdb.vim index d7b68e7..d50d240 100644 --- a/pygdb.vim +++ b/pygdb.vim @@ -215,8 +215,6 @@ def gdbLoadConfig(): global clientcmd, gdbBps, cmdset - - #Load configuration conf = Configuration.Configuration() conf.load(".pygdb.conf") @@ -229,6 +227,10 @@ def gdbLoadConfig(): for bp in conf.breakpoints: bp["file"] = toAbsPath( bp["file"] ) addBreakpoint(bp["file"], bp["lineno"], bp["cond"]) + + #Set the command from config + if conf.getCommand() != None: + clientcmd = conf.getCommand() #Set current execution line if conf.isCurrposSet(): -- 2.39.5