• 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
8
9from dex.command.CommandBase import CommandBase
10from dex.dextIR import ValueIR
11
12
13class DexUnreachable(CommandBase):
14    """Expect the source line this is found on will never be stepped on to.
15
16    DexUnreachable()
17
18    See Commands.md for more info.
19    """
20
21    def __init(self):
22        super(DexUnreachable, self).__init__()
23        pass
24
25    @staticmethod
26    def get_name():
27        return __class__.__name__
28
29    def eval(self, step_info):
30        # If we're ever called, at all, then we're evaluating a line that has
31        # been marked as unreachable. Which means a failure.
32        vir = ValueIR(expression="Unreachable",
33                      value="True", type_name=None,
34                      error_string=None,
35                      could_evaluate=True,
36                      is_optimized_away=True,
37                      is_irretrievable=False)
38        return {'DexUnreachable' : vir}
39