annotate lldb/utils/lui/eventwin.py @ 182:0f533c0a1429

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 31 May 2020 19:50:32 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ##===-- eventwin.py ------------------------------------------*- Python -*-===##
anatofuz
parents:
diff changeset
2 ##
anatofuz
parents:
diff changeset
3 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
anatofuz
parents:
diff changeset
4 # See https://llvm.org/LICENSE.txt for license information.
anatofuz
parents:
diff changeset
5 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
anatofuz
parents:
diff changeset
6 ##
anatofuz
parents:
diff changeset
7 ##===----------------------------------------------------------------------===##
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 import cui
anatofuz
parents:
diff changeset
10 import lldb
anatofuz
parents:
diff changeset
11 import lldbutil
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 class EventWin(cui.TitledWin):
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 def __init__(self, x, y, w, h):
anatofuz
parents:
diff changeset
17 super(EventWin, self).__init__(x, y, w, h, 'LLDB Event Log')
anatofuz
parents:
diff changeset
18 self.win.scrollok(1)
anatofuz
parents:
diff changeset
19 super(EventWin, self).draw()
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 def handleEvent(self, event):
anatofuz
parents:
diff changeset
22 if isinstance(event, lldb.SBEvent):
anatofuz
parents:
diff changeset
23 self.win.scroll()
anatofuz
parents:
diff changeset
24 h = self.win.getmaxyx()[0]
anatofuz
parents:
diff changeset
25 self.win.addstr(h - 1, 0, lldbutil.get_description(event))
anatofuz
parents:
diff changeset
26 return