xref: /llvm-project/lldb/utils/lui/eventwin.py (revision 602e47c5f9fd2e14c7bfb6111e6558fa0d27c87f)
193f50594SJonas Devlieghere##===-- eventwin.py ------------------------------------------*- Python -*-===##
293f50594SJonas Devlieghere##
393f50594SJonas Devlieghere# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
493f50594SJonas Devlieghere# See https://llvm.org/LICENSE.txt for license information.
593f50594SJonas Devlieghere# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
693f50594SJonas Devlieghere##
793f50594SJonas Devlieghere##===----------------------------------------------------------------------===##
893f50594SJonas Devlieghere
993f50594SJonas Devlieghereimport cui
1093f50594SJonas Devlieghereimport lldb
1193f50594SJonas Devlieghereimport lldbutil
1293f50594SJonas Devlieghere
1393f50594SJonas Devlieghere
1493f50594SJonas Devlieghereclass EventWin(cui.TitledWin):
1593f50594SJonas Devlieghere    def __init__(self, x, y, w, h):
16*602e47c5SDavid Spickett        super(EventWin, self).__init__(x, y, w, h, "LLDB Event Log")
1793f50594SJonas Devlieghere        self.win.scrollok(1)
1893f50594SJonas Devlieghere        super(EventWin, self).draw()
1993f50594SJonas Devlieghere
2093f50594SJonas Devlieghere    def handleEvent(self, event):
2193f50594SJonas Devlieghere        if isinstance(event, lldb.SBEvent):
2293f50594SJonas Devlieghere            self.win.scroll()
2393f50594SJonas Devlieghere            h = self.win.getmaxyx()[0]
2493f50594SJonas Devlieghere            self.win.addstr(h - 1, 0, lldbutil.get_description(event))
2593f50594SJonas Devlieghere        return
26