brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 4b80de8 Raw
39 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"""A Command that tells dexter to set a function breakpoint and step through8the function after hitting it.9 10NOTE: Only supported for DAP-based debuggers.11"""12 13from dex.command.CommandBase import CommandBase14 15 16class DexStepFunction(CommandBase):17    def __init__(self, *args, **kwargs):18        if len(args) < 1:19            raise TypeError("expected 1 positional argument")20        self.function = str(args[0])21        self.hit_count = kwargs.pop("hit_count", None)22        if kwargs:23            raise TypeError(f"unexpected named args: {', '.join(kwargs)}")24        super(DexStepFunction, self).__init__()25 26    def eval(self):27        raise NotImplementedError("DexStepFunction commands cannot be evaled.")28 29    def get_function(self):30        return self.function31 32    @staticmethod33    def get_name():34        return __class__.__name__35 36    @staticmethod37    def get_subcommands() -> dict:38        return None39