projects
/
pygdb.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add LICENSE
[pygdb.git]
/
Configuration.py
diff --git
a/Configuration.py
b/Configuration.py
index 6f08a20b442bb2ab9073adc5e243fdecf5b583a6..778afb2334a15469d08b4c1548a0fbc35256a99f 100644
(file)
--- a/
Configuration.py
+++ b/
Configuration.py
@@
-21,6
+21,7
@@
class Configuration:
self.watches = []
self.ints = []
self.currfile, self.currlineno = None, 0
self.watches = []
self.ints = []
self.currfile, self.currlineno = None, 0
+ self.command = None
def load(self, filename):
def load(self, filename):
@@
-45,6
+46,8
@@
class Configuration:
self.parseInt(tail)
elif cmd == "currpos":
self.parseCurrpos(tail)
self.parseInt(tail)
elif cmd == "currpos":
self.parseCurrpos(tail)
+ elif cmd == "cmd":
+ self.parseCommand(tail)
else:
cnt -= 1
print "Unkown command", cmd
else:
cnt -= 1
print "Unkown command", cmd
@@
-71,6
+74,9
@@
class Configuration:
if self.isCurrposSet():
self.__writeCurrpos(f)
if self.isCurrposSet():
self.__writeCurrpos(f)
+ if self.getCommand() != None:
+ self.__writeCommand(f)
+
f.close()
return True
f.close()
return True
@@
-88,8
+94,8
@@
class Configuration:
print "Wrong breakpoint format:", tail
return
print "Wrong breakpoint format:", tail
return
- preif = string.split(tail, "
if
")[0].strip()
- postif = string.join( string.split(tail, "
if")[1:], "if
").strip()
+ preif = string.split(tail, "
if
")[0].strip()
+ postif = string.join( string.split(tail, "
if ")[1:], " if
").strip()
[file,lineno] = string.split(preif, ":")
lineno = int(lineno)
[file,lineno] = string.split(preif, ":")
lineno = int(lineno)
@@
-129,6
+135,9
@@
class Configuration:
self.setCurrpos(file, lineno)
self.setCurrpos(file, lineno)
+ def parseCommand(self, tail):
+ self.command = tail
+
def __writeBreak(self, f, b):
if b["cond"] != None:
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 __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}
def addBreak(self, file, lineno, cond=None):
bp = {"file" : file, "lineno" : lineno, "cond" : cond}
@@
-166,7
+178,16
@@
class Configuration:
def isCurrposSet(self):
return self.currfile!=None
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:
def findInt(self, name):
for i in self.ints: