projects
/
pygdb.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixing bug: parsing cond. breakpoint
[pygdb.git]
/
GdbTerminal.py
diff --git
a/GdbTerminal.py
b/GdbTerminal.py
old mode 100755
(executable)
new mode 100644
(file)
index
579849d
..
ff6dc6b
--- a/
GdbTerminal.py
+++ b/
GdbTerminal.py
@@
-104,8
+104,7
@@
class GdbTerminal (DbgTerminal.DbgTerminal):
#This line does not contain the file!
if not rxpos.search(line):
#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,":")
pos = string.split(line)[-1]
[file,lineno] = string.split(pos,":")
@@
-114,7
+113,7
@@
class GdbTerminal (DbgTerminal.DbgTerminal):
if i+1<len(bplines) and rxcond.search(bplines[i+1]):
i +=1
line = bplines[i]
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]]
cond = cond.strip()
bpnts += [[no, file, lineno, cond]]
@@
-137,6
+136,15
@@
class GdbTerminal (DbgTerminal.DbgTerminal):
split = string.split(answer, "=")
return string.join(split[1:], "=").strip()
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\)"
def waitForPrompt(self, his):
rx = "^\(gdb\)"
@@
-155,11
+163,14
@@
class GdbTerminal (DbgTerminal.DbgTerminal):
if string.find(line, "Program exited") == 0:
code = string.split(line)[-1]
if string.find(line, "Program exited") == 0:
code = string.split(line)[-1]
- code = code[1:-1]
codeno = 0
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
return "exited", codeno