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:
print "got inactive: ", res
for cb in self.gotInactiveCallback:
cb(status, param)
- except:
- pass
+ except Exception, e:
+ print e
return True
def setStepin(self):
raise NotImplementedError()
+ def setStepout(self):
+ raise NotImplementedError()
+
def setQuit(self):
raise NotImplementedError()
def getExpression(self, expr):
raise NotImplementedError()
+ def listCodeSnippet(self):
+ raise NotImplementedError()
+
+ def getBacktrace(self):
+ raise NotImplementedError()
+
def waitForPrompt(self, his):
raise NotImplementedError()
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):