17 class GdbWindow (DbgWindow
.DbgWindow
):
20 def __init__(self
, clientCmd
):
21 DbgWindow
.DbgWindow
.__init
__(self
, clientCmd
)
24 return ["gdb", "--fullname", string
.split(self
.clientCmd
)[0]]
26 def setDbgPty(self
, pty
):
27 ttyname
= os
.ttyname(pty
)
28 self
.feed_dbg("set inferior-tty %s\n" % (ttyname
,))
31 argv
= string
.join(string
.split(self
.clientCmd
)[1:])
32 self
.feed_dbg("run " + argv
+ "\n")
35 self
.feed_dbg("quit\n")
36 self
.waitForDbgNewline()
39 def setDbgContinue(self
):
40 self
.feed_dbg("cont\n");
42 def setDbgBreakpoint(self
, file, lineno
):
43 self
.feed_dbg("break %s:%d\n" % (file, lineno
))
45 def getDbgExpression(self
, expr
):
47 self
.waitForDbgNewline()
48 self
.feed_dbg("print " + expr
+ "\n")
50 rx
= re
.compile("^\$[1-9][0-9]* = .*$")
51 response
= self
.waitForDbgRx(rx
)
53 split
= string
.split(response
, "=")
54 return string
.join(split
[1:], "=").strip()
58 if __name__
== "__main__":
61 gdbwnd
= GdbWindow(string
.join(sys
.argv
[1:]))
62 DbgWindow
.launchDebugger(gdbwnd
)