79daf702307a5ea72835a8bf81006fc8ff072c34
17 class GdbTerminal (DbgTerminal
.DbgTerminal
):
20 def __init__(self
, clientCmd
):
21 DbgTerminal
.DbgTerminal
.__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 his
= self
.getHistoryLen()
48 self
.feed_dbg("print " + expr
+ "\n")
50 rx
= re
.compile("^\$[1-9][0-9]* = .*$")
51 his
, response
= self
.waitForDbgRx(rx
, his
)
53 split
= string
.split(response
, "=")
54 return string
.join(split
[1:], "=").strip()
58 if __name__
== "__main__":
61 dbgterm
= GdbTerminal(string
.join(sys
.argv
[1:]))
62 dbgwnd
= DbgTerminal
.DbgWindow(dbgterm
)
64 DbgTerminal
.launchDebugger(dbgwnd
, dbgterm
)