diff options
Diffstat (limited to 'gui/test')
| -rw-r--r-- | gui/test/lenses.py | 89 |
1 files changed, 87 insertions, 2 deletions
diff --git a/gui/test/lenses.py b/gui/test/lenses.py index 9d287fa..528c656 100644 --- a/gui/test/lenses.py +++ b/gui/test/lenses.py @@ -27,6 +27,33 @@ console break checkpoint console continue await execution 1 frames 40 +# Offsets, including negative/zero/positive ones, address their stack storage. +move 0 0 +frames 30 +screenshot {out / 'offset-before.png'} +move 185 863 +frames 30 +screenshot {out / 'offset-hover.png'} +expect-different-screenshot {out / 'offset-before.png'} {out / 'offset-hover.png'} 156 852 42 24 +click 250 863 +print lenses[0].address +key escape +click 185 863 +print lenses[0].address +key escape +console mouse-button 3 185 863 +expect focus stack +print nav[1].place.address +expect nav[1].place.follow false +key f +frames 40 +click 185 935 +print lenses[0].address +key escape +click 185 959 +print lenses[0].address +key escape +expect execution 1 console lens {code} expect lens_count 1 expect lenses[0].first {code} @@ -141,6 +168,60 @@ frames 30 print stops expect execution 1 key escape +# Computed operands use this stop's registers; future register operands stay inert. +hold left_shift +key f +release left_shift +console break operand_stack +key c +await execution 2 +expect pc {symbols['operand_stack']} +console set source false +console set annotations false +console goto code {symbols['operand_stack']} +frames 40 +click 400 180 +expect lens_count 0 +move 0 0 +frames 30 +screenshot {out / 'operand-before.png'} +move 400 156 +frames 30 +screenshot {out / 'operand-hover.png'} +expect-different-screenshot {out / 'operand-before.png'} {out / 'operand-hover.png'} 348 144 108 24 +click 400 156 +expect lens_count 1 +print lenses[0].address +key escape +console mouse-button 3 400 156 +expect focus stack +print nav[1].place.address +# RIP-relative storage is independent of future register values. +click 400 204 +expect lenses[0].address {head} +key escape +console mouse-button 3 400 204 +expect focus memory +expect nav[2].place.address {head} +key s +await execution 3 +expect pc {symbols['operand_indexed']} +frames 40 +click 400 180 +expect lenses[0].address {head + 16} +key escape +console mouse-button 3 400 180 +expect focus memory +expect nav[2].place.address {head + 16} +# Historical operands use historical registers, without another execution. +key left_bracket +expect following false +console goto code {symbols['operand_stack']} +frames 40 +click 400 156 +print lenses[0].address +key escape +expect execution 3 expect-no-log CommandFailed expect-no-log backdrop shader ''' @@ -155,9 +236,13 @@ expect-no-log backdrop shader first = int(re.search(r'lenses\[0\].first = (\d+)', stderr)[1]) assert first > code, (first, code) stack_addresses = re.findall(r'(?:lenses\[0\].address|nav\[1\].place.address) = (\d+)', stderr) - assert len(stack_addresses) == 2 and stack_addresses[0] == stack_addresses[1], stack_addresses + assert len(stack_addresses) == 10, stack_addresses + base, negative, followed, zero, positive, pointer, pointer_followed, operand, operand_followed, historical = map(int, stack_addresses) + assert base == negative == followed and zero == base + 24 and positive == base + 32, stack_addresses + assert pointer == pointer_followed, stack_addresses + assert operand == operand_followed == historical == pointer + 8, stack_addresses stops = re.findall(r'stops = (\d+)', stderr) assert len(stops) == 2 and stops[0] == stops[1], stops for recording in Path('/tmp').glob(f'ztrace-gui-{run.pid}-*.ztrace'): recording.unlink() - print(('Native' if a.native else 'Headless') + ': code/data lenses, context scrolling, pointer recursion, memory formats and historical isolation passed') + print(('Native' if a.native else 'Headless') + ': lenses, stack offsets, computed operands, pointer bytes, formats and historical isolation passed') |
