40 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"""Command to instruct the debugger to inspect the value of some set of8expressions on the current source line.9"""10 11from dex.command.CommandBase import CommandBase12 13 14class DexWatch(CommandBase):15 """[Deprecated] Evaluate each given `expression` when the debugger steps onto the16 line this command is found on17 18 DexWatch(*expressions)19 20 See Commands.md for more info.21 """22 23 def __init__(self, *args):24 if not args:25 raise TypeError("expected some arguments")26 27 for arg in args:28 if not isinstance(arg, str):29 raise TypeError("invalid argument type")30 31 self._args = args32 super(DexWatch, self).__init__()33 34 @staticmethod35 def get_name():36 return __class__.__name__37 38 def eval(self, debugger):39 return {arg: debugger.evaluate_expression(arg) for arg in self._args}40