blob: 8ad8d3a8c49ea40ad5d620d867dad756d6785f1a [file] [log] [blame]
Daniel Maleae33c4ba2013-10-11 17:13:07 +00001##===-- eventwin.py ------------------------------------------*- Python -*-===##
2##
Kate Stoneb9c1b512016-09-06 20:57:50 +00003# The LLVM Compiler Infrastructure
Daniel Maleae33c4ba2013-10-11 17:13:07 +00004##
Kate Stoneb9c1b512016-09-06 20:57:50 +00005# This file is distributed under the University of Illinois Open Source
6# License. See LICENSE.TXT for details.
Daniel Maleae33c4ba2013-10-11 17:13:07 +00007##
8##===----------------------------------------------------------------------===##
9
Daniel Malea4c3261d2013-10-09 22:11:30 +000010import cui
Kate Stoneb9c1b512016-09-06 20:57:50 +000011import lldb
12import lldbutil
13
Daniel Malea4c3261d2013-10-09 22:11:30 +000014
15class EventWin(cui.TitledWin):
Daniel Malea4c3261d2013-10-09 22:11:30 +000016
Kate Stoneb9c1b512016-09-06 20:57:50 +000017 def __init__(self, x, y, w, h):
18 super(EventWin, self).__init__(x, y, w, h, 'LLDB Event Log')
19 self.win.scrollok(1)
20 super(EventWin, self).draw()
Daniel Malea4c3261d2013-10-09 22:11:30 +000021
Kate Stoneb9c1b512016-09-06 20:57:50 +000022 def handleEvent(self, event):
23 if isinstance(event, lldb.SBEvent):
24 self.win.scroll()
25 h = self.win.getmaxyx()[0]
26 self.win.addstr(h - 1, 0, lldbutil.get_description(event))
27 return