X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;f=GdbTerminal.py;h=5e6ba6d75d821583107faaccb258991bdd56032a;hb=3c94180482e4ccd256f087ff182278f083a94276;hp=579849dea5816e2494894c7b606087d4f167d78c;hpb=e8f5eba24b3fd5cdd839bcfc170a2e3aa16dd05d;p=pygdb.git diff --git a/GdbTerminal.py b/GdbTerminal.py index 579849d..5e6ba6d 100755 --- a/GdbTerminal.py +++ b/GdbTerminal.py @@ -137,6 +137,15 @@ class GdbTerminal (DbgTerminal.DbgTerminal): 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\)"