#This line does not contain the file!
if not rxpos.search(line):
- i += 1
- line = bplines[i]
+ continue
pos = string.split(line)[-1]
[file,lineno] = string.split(pos,":")
if i+1<len(bplines) and rxcond.search(bplines[i+1]):
i +=1
line = bplines[i]
- pre,cond = string.split(line,"if")
+ cond = string.join(string.split(line," if ")[1:], " if ")
cond = cond.strip()
bpnts += [[no, file, lineno, cond]]
split = string.split(answer, "=")
return string.join(split[1:], "=").strip()
+
+ def listCodeSnippet(self):
+ starthis = self.getHistoryLen()
+ self.feed_child("list\n")
+ endhis, response = self.waitForPrompt(starthis)
+
+ text = string.join(self.history[starthis:endhis], "\n")
+ return text
+
def waitForPrompt(self, his):
rx = "^\(gdb\)"
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