iter = self.model.get_iter_first()
while iter != None:
spec, = self.model.get(iter, 1)
- conf.parseBreak(spec)
+
+ #Replacing file by absolute path
+ file = string.split(spec, ":")[0]
+ file = self.debugger.toAbsPath(file)
+ postfile = string.join( string.split(spec,":")[1:], ":")
+
+ conf.parseBreak(file + ":" + postfile )
iter = self.model.iter_next(iter)
os.kill(self.childpid, 15);
self.childpid = None
+ def getClientExecuteable(self):
+ return string.split(self.clientCmd)[0]
+
+
+ def toAbsPath(self, path):
+ """convert path to an absolute path relative to the client
+ executable we debug."""
+
+ #Current working dir
+ pwd = os.getcwd() + "/"
+
+ #executeable path
+ client = self.getClientExecuteable()
+ client = relToAbsPath(pwd, client)
+
+ return relToAbsPath(client, path)
+
+
def checkActivityChanged(self):
try:
except:
pass
+def relToAbsPath(absfile, relfile):
+ """When an absfile is given and a relfile is given by
+ relative paths relative to absfile, determine the abs
+ path of relfile"""
+
+ #Get directories except for "." parts
+ relsplit = filter(lambda x: x!=".", string.split(relfile, os.sep))
+ #Get the directories of absfile withouth the trailing filename
+ abssplit = string.split(absfile, os.sep)[:-1]
+
+ #Determine number of ".." and remove them
+ up=0
+ while relsplit[0] == "..":
+ up += 1
+ del relsplit[0]
+ del abssplit[-1]
+
+ return string.join(abssplit + relsplit, os.sep)
class DbgWindow (gtk.Window):
if string.find(line, "Program exited") == 0:
code = string.split(line)[-1]
- code = code[1:-1]
codeno = 0
- for c in code:
- codeno = codeno*8 + int(c)
+
+ #Parse the octal number
+ if code[0] == "O":
+ code = code[1:-1]
+ for c in code:
+ codeno = codeno*8 + int(c)
return "exited", codeno
import vim
import Configuration
+import DbgTerminal
print "%(file)s:%(lineno)d" % bp
-def getAbsPath(absfile, relfile):
- """When an absfile is given and a relfile is given by
- relative paths relative to absfile, determine the abs
- path of relfile"""
- #Get directories except for "." parts
- relsplit = filter(lambda x: x!=".", string.split(relfile, os.sep))
- #Get the directories of absfile withouth the trailing filename
- abssplit = string.split(absfile, os.sep)[:-1]
-
- #Determine number of ".." and remove them
- up=0
- while relsplit[0] == "..":
- up += 1
- del relsplit[0]
- del abssplit[-1]
-
- return string.join(abssplit + relsplit, os.sep)
-
-
-#Change to absolute path
def toAbsPath(path):
global clientcmd, cmdset
#Get the dirs where executeable is in
relcmd = string.split(clientcmd)[0]
- abscmd = getAbsPath(getCurrentFile(), relcmd)
- path = getAbsPath(abscmd, path)
+ abscmd = DbgTerminal.relToAbsPath(getCurrentFile(), relcmd)
+ path = DbgTerminal.relToAbsPath(abscmd, path)
assert(path[0] == "/")