• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# DExTer : Debugging Experience Tester
2# ~~~~~~   ~         ~~         ~   ~~
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-exception
7
8from dex.command.CommandBase import CommandBase
9from dex.dextIR import LocIR
10from dex.dextIR import ValueIR
11
12class DexExpectStepOrder(CommandBase):
13    """Expect the line every `DexExpectStepOrder` is found on to be stepped on
14    in `order`. Each instance must have a set of unique ascending indicies.
15
16    DexExpectStepOrder(*order)
17
18    See Commands.md for more info.
19    """
20
21    def __init__(self, *args):
22        if not args:
23            raise TypeError('Need at least one order number')
24
25        self.sequence = [int(x) for x in args]
26        super(DexExpectStepOrder, self).__init__()
27
28    @staticmethod
29    def get_name():
30        return __class__.__name__
31
32    def eval(self, step_info):
33        return {'DexExpectStepOrder': ValueIR(expression=str(step_info.current_location.lineno),
34                      value=str(step_info.step_index), type_name=None,
35                      error_string=None,
36                      could_evaluate=True,
37                      is_optimized_away=True,
38                      is_irretrievable=False)}
39