brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 75e6dcb Raw
41 lines · python
1# DExTer : Debugging Experience Tester2# ~~~~~~   ~         ~~         ~   ~~3#4# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.5# See https://llvm.org/LICENSE.txt for license information.6# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception7"""List debuggers tool."""8 9from dex.debugger.Debuggers import add_debugger_tool_base_arguments10from dex.debugger.Debuggers import handle_debugger_tool_base_options11from dex.debugger.Debuggers import Debuggers12from dex.tools import ToolBase13from dex.utils import Timer14from dex.utils.Exceptions import DebuggerException, Error15from dex.utils.ReturnCode import ReturnCode16 17 18class Tool(ToolBase):19    """List all of the potential debuggers that DExTer knows about and whether20    there is currently a valid interface available for them.21    """22 23    @property24    def name(self):25        return "DExTer list debuggers"26 27    def add_tool_arguments(self, parser, defaults):28        parser.description = Tool.__doc__29        add_debugger_tool_base_arguments(parser, defaults)30 31    def handle_options(self, defaults):32        handle_debugger_tool_base_options(self.context, defaults)33 34    def go(self) -> ReturnCode:35        with Timer("list debuggers"):36            try:37                Debuggers(self.context).list()38            except DebuggerException as e:39                raise Error(e)40        return ReturnCode.OK41