summaryrefslogtreecommitdiff
path: root/cross-project-tests
diff options
context:
space:
mode:
Diffstat (limited to 'cross-project-tests')
-rw-r--r--cross-project-tests/debuginfo-tests/dexter/Commands.md7
-rw-r--r--cross-project-tests/debuginfo-tests/dexter/dex/command/commands/DexExpectStepOrder.py11
-rw-r--r--cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ControllerHelpers.py4
-rw-r--r--cross-project-tests/debuginfo-tests/dexter/dex/heuristic/Heuristic.py2
-rw-r--r--cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_order.cpp14
5 files changed, 29 insertions, 9 deletions
diff --git a/cross-project-tests/debuginfo-tests/dexter/Commands.md b/cross-project-tests/debuginfo-tests/dexter/Commands.md
index d5bd999f5adf..a98261a50009 100644
--- a/cross-project-tests/debuginfo-tests/dexter/Commands.md
+++ b/cross-project-tests/debuginfo-tests/dexter/Commands.md
@@ -101,13 +101,16 @@ frame.</br>
---
## DexExpectStepOrder
- DexExpectStepOrder(*order)
+ DexExpectStepOrder(*order [,**on_line])
Arg list:
order (int): One or more indices.
+ Keyword args:
+ on_line (int): Expect this line to be stepped on in the order given.
+
### Description
-Expect the line every `DexExpectStepOrder` is found on to be stepped on in
+Expect the line every `DexExpectStepOrder` is found on, or given from `on_line`, to be stepped on in
`order`. Each instance must have a set of unique ascending indices.
### Heuristic
diff --git a/cross-project-tests/debuginfo-tests/dexter/dex/command/commands/DexExpectStepOrder.py b/cross-project-tests/debuginfo-tests/dexter/dex/command/commands/DexExpectStepOrder.py
index 700dc5420431..d5cfc3c82f41 100644
--- a/cross-project-tests/debuginfo-tests/dexter/dex/command/commands/DexExpectStepOrder.py
+++ b/cross-project-tests/debuginfo-tests/dexter/dex/command/commands/DexExpectStepOrder.py
@@ -18,10 +18,16 @@ class DexExpectStepOrder(CommandBase):
See Commands.md for more info.
"""
- def __init__(self, *args):
+ def __init__(self, *args, **kwargs):
if not args:
raise TypeError('Need at least one order number')
+ if 'on_line' in kwargs:
+ try:
+ on_line = kwargs.pop('on_line')
+ self.on_line = int(on_line)
+ except ValueError:
+ raise ValueError('on_line value \'{0}\' cannot be parsed to an integer'.format(on_line))
self.sequence = [int(x) for x in args]
super(DexExpectStepOrder, self).__init__()
@@ -29,6 +35,9 @@ class DexExpectStepOrder(CommandBase):
def get_name():
return __class__.__name__
+ def get_line(self):
+ return self.on_line if hasattr(self, 'on_line') else self.lineno
+
def eval(self, step_info):
return {'DexExpectStepOrder': ValueIR(expression=str(step_info.current_location.lineno),
value=str(step_info.step_index), type_name=None,
diff --git a/cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ControllerHelpers.py b/cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ControllerHelpers.py
index 014f15da2af0..8044f3982f40 100644
--- a/cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ControllerHelpers.py
+++ b/cross-project-tests/debuginfo-tests/dexter/dex/debugger/DebuggerControllers/ControllerHelpers.py
@@ -19,8 +19,8 @@ def in_source_file(source_files, step_info):
for f in source_files)
def have_hit_line(watch, loc):
- if hasattr(watch, '_on_line'):
- return watch._on_line == loc.lineno
+ if hasattr(watch, 'on_line'):
+ return watch.on_line == loc.lineno
elif hasattr(watch, '_from_line'):
return watch._from_line <= loc.lineno and watch._to_line >= loc.lineno
elif watch.lineno == loc.lineno:
diff --git a/cross-project-tests/debuginfo-tests/dexter/dex/heuristic/Heuristic.py b/cross-project-tests/debuginfo-tests/dexter/dex/heuristic/Heuristic.py
index 1582e7b3b706..52ba7e1e897c 100644
--- a/cross-project-tests/debuginfo-tests/dexter/dex/heuristic/Heuristic.py
+++ b/cross-project-tests/debuginfo-tests/dexter/dex/heuristic/Heuristic.py
@@ -253,7 +253,7 @@ class Heuristic(object):
cmds = steps.commands['DexExpectStepOrder']
# Form a list of which line/cmd we _should_ have seen
- cmd_num_lst = [(x, c.lineno) for c in cmds
+ cmd_num_lst = [(x, c.get_line()) for c in cmds
for x in c.sequence]
# Order them by the sequence number
cmd_num_lst.sort(key=lambda t: t[0])
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_order.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_order.cpp
index cbcb5063c10f..c6e992df7ad9 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_order.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/expect_step_order.cpp
@@ -9,8 +9,16 @@
int main()
{
- volatile int x = 1; // DexExpectStepOrder(1)
- volatile int y = 1; // DexExpectStepOrder(2)
- volatile int z = 1; // DexExpectStepOrder(3)
+ volatile int a = 1; // DexExpectStepOrder(1)
+ volatile int b = 1; // DexExpectStepOrder(2)
+ volatile int c = 1; // DexExpectStepOrder(3)
+
+ volatile int x = 1;
+ volatile int y = 1;
+ volatile int z = 1;
return 0;
}
+
+// DexExpectStepOrder(4, on_line=16);
+// DexExpectStepOrder(5, on_line=17);
+// DexExpectStepOrder(6, on_line=18);