[llvm] Revert "[Dexter] Add rewriting for aggregate variables (#202800)" (PR #206495)
Stephen Tozer via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 29 06:55:45 PDT 2026
https://github.com/SLTozer created https://github.com/llvm/llvm-project/pull/206495
This reverts commit 2cf48dca3338951a7fbe83fecc9e6d35caaa9b11.
The original commit is failing sometimes in pre-commit CI for linux builds, possibly due to some unspecified environmental dependency.
>From 5bf495456b9898c45c437b8dadae21417d04a9a5 Mon Sep 17 00:00:00 2001
From: Stephen Tozer <stephen.tozer at sony.com>
Date: Mon, 29 Jun 2026 14:53:27 +0100
Subject: [PATCH] Revert "[Dexter] Add rewriting for aggregate variables
(#202800)"
This reverts commit 2cf48dca3338951a7fbe83fecc9e6d35caaa9b11.
The original commit is failing sometimes in pre-commit CI for linux builds.
---
.../dexter/dex/debugger/lldb/LLDB.py | 1 -
.../dexter/dex/evaluation/ExpectRewriter.py | 26 +------
.../Inputs/rewrite_aggregates_expected.cpp | 70 -------------------
.../rewrite_list_aggregates_expected.cpp | 58 ---------------
.../scripts/rewriting/rewrite_aggregates.cpp | 53 --------------
.../rewriting/rewrite_list_aggregates.cpp | 48 -------------
6 files changed, 3 insertions(+), 253 deletions(-)
delete mode 100644 cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/rewriting/Inputs/rewrite_aggregates_expected.cpp
delete mode 100644 cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/rewriting/Inputs/rewrite_list_aggregates_expected.cpp
delete mode 100644 cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/rewriting/rewrite_aggregates.cpp
delete mode 100644 cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/rewriting/rewrite_list_aggregates.cpp
diff --git a/cross-project-tests/debuginfo-tests/dexter/dex/debugger/lldb/LLDB.py b/cross-project-tests/debuginfo-tests/dexter/dex/debugger/lldb/LLDB.py
index 4b92da9e0f38c..8f90981f67e4c 100644
--- a/cross-project-tests/debuginfo-tests/dexter/dex/debugger/lldb/LLDB.py
+++ b/cross-project-tests/debuginfo-tests/dexter/dex/debugger/lldb/LLDB.py
@@ -510,7 +510,6 @@ def _evaluate_result_value(
"couldn't read from memory",
"Cannot access memory at address",
"invalid address (fault address:",
- "error: parent is NULL",
]
)
diff --git a/cross-project-tests/debuginfo-tests/dexter/dex/evaluation/ExpectRewriter.py b/cross-project-tests/debuginfo-tests/dexter/dex/evaluation/ExpectRewriter.py
index 5f8829287efe4..7519d96a02a6d 100644
--- a/cross-project-tests/debuginfo-tests/dexter/dex/evaluation/ExpectRewriter.py
+++ b/cross-project-tests/debuginfo-tests/dexter/dex/evaluation/ExpectRewriter.py
@@ -25,20 +25,7 @@ class ExpectedValueRewriter:
def __init__(self, expect: Expect, value: ValueIR):
self.expect = expect
self.root_value = value
- self.expected_value: Union[Dict, str, None] = None
- if sub_values := self.root_value.sub_values:
- self.expected_value = {
- sub_value.expression: expected_value
- for sub_value in sub_values
- if (
- expected_value := ExpectedValueRewriter(
- expect, sub_value
- ).expected_value
- )
- is not None
- }
- if not self.expected_value:
- self.expected_value = expect.get_variable_result(value)
+ self.expected_value = expect.get_variable_result(value)
def unique_expected_values(elements: List[ExpectedValueRewriter]):
@@ -46,21 +33,14 @@ def unique_expected_values(elements: List[ExpectedValueRewriter]):
values, or a single item if there is only one non-duplicated expected value in the list, or None if there are no
valid expected values."""
- def freeze(input):
- assert input is not None, "Unexpected 'None' in an expected_value"
- if isinstance(input, dict):
- return tuple(sorted((str(k), freeze(v)) for k, v in input.items()))
- return input
-
unique_set = set()
result = []
for element in elements:
expected_value = element.expected_value
if expected_value is None:
continue
- frozen_value = freeze(expected_value)
- if frozen_value not in unique_set:
- unique_set.add(frozen_value)
+ if expected_value not in unique_set:
+ unique_set.add(expected_value)
result.append(expected_value)
if not result:
return None
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/rewriting/Inputs/rewrite_aggregates_expected.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/rewriting/Inputs/rewrite_aggregates_expected.cpp
deleted file mode 100644
index 8f9c5206e6480..0000000000000
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/rewriting/Inputs/rewrite_aggregates_expected.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-// RUN: rm -rf %t
-// RUN: mkdir %t
-// RUN: %dexter_regression_test_cxx_build %s -o %t/test
-// RUN: %dexter_regression_test_run --use-script --binary %t/test \
-// RUN: --results-directory %t/results -- %s 2>&1 | FileCheck %s
-// RUN: diff %t/results/%{s:basename} %S/Inputs/rewrite_aggregates_expected.cpp
-
-/// Test that Dexter can write disaggregated expected values for aggregates,
-/// including falling back to the parent value if sub_values contain errors,
-/// e.g. for pointers that are not dereferencable.
-
-/// NB: The exact contents of this file are compared against the expect file in
-/// the Inputs/ directory; any changes to this file, including comments,
-/// will require updating the corresponding expected file.
-
-// CHECK: Rewrote script to add 5 expected values.
-
-// CHECK: total_watched_steps: 5
-// CHECK: correct_steps: 5
-// CHECK: incorrect_steps: 0
-// CHECK: seen_values: 16
-// CHECK: missing_values: 0
-
-struct Point {
- int X;
- int Y;
- int Z;
-};
-
-struct Rect {
- Point TopLeft;
- Point BottomRight;
-};
-
-int main() {
- Point P{1, 2, 3};
- int *I = &P.X;
- Rect R{{1, 1, 1}, {2, 2, 2}};
- int L[] = {0, 1, 2, 3, 4};
- int *InvalidPtr = nullptr;
- return 0; // !dex_label ret
-}
-
-/*
----
-? !where {lines: !label 'ret'}
-: !value 'P':
- X: '1'
- Y: '2'
- Z: '3'
- !value 'I':
- '*I': '1'
- !value 'R':
- BottomRight:
- X: '2'
- Y: '2'
- Z: '2'
- TopLeft:
- X: '1'
- Y: '1'
- Z: '1'
- !value 'L':
- '[0]': '0'
- '[1]': '1'
- '[2]': '2'
- '[3]': '3'
- '[4]': '4'
- !value 'InvalidPtr': '0x0000000000000000'
-...
-*/
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/rewriting/Inputs/rewrite_list_aggregates_expected.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/rewriting/Inputs/rewrite_list_aggregates_expected.cpp
deleted file mode 100644
index 630ed6e887413..0000000000000
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/rewriting/Inputs/rewrite_list_aggregates_expected.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-// RUN: rm -rf %t
-// RUN: mkdir %t
-// RUN: %dexter_regression_test_cxx_build %s -o %t/test
-// RUN: %dexter_regression_test_run --use-script --binary %t/test \
-// RUN: --results-directory %t/results -- %s 2>&1 | FileCheck %s
-// RUN: diff %t/results/%{s:basename} \
-// RUN: %S/Inputs/rewrite_list_aggregates_expected.cpp
-
-/// Test that Dexter can write expects for variables that are aggregates and
-/// have more than one value, without writing any duplicate expected values.
-
-/// NB: The exact contents of this file are compared against the expect file in
-/// the Inputs/ directory; any changes to this file, including comments,
-/// will require updating the corresponding expected file.
-
-// CHECK: Rewrote script to add 1 expected values.
-
-struct Point {
- int X;
- int Y;
-};
-
-int main() {
- Point P{1, 2};
- P.X = 3; // !dex_label start
- P.Y = 0;
- P.X = 1;
- P.Y = 2;
- P = {0, 0};
- return 0; // !dex_label end
-}
-
-// CHECK: total_watched_steps: 6
-// CHECK: correct_steps: 6
-// CHECK: incorrect_steps: 0
-// CHECK: partial_step_correctness: 6.0
-// CHECK: missing_var_steps: 0
-// CHECK: unexpected_value_steps: 0
-// CHECK: correct_step_coverage: 100.0% (6/6)
-// CHECK: seen_values: 10
-// CHECK: missing_values: 0
-
-/*
----
-? !where {lines: !range [!label 'start', !label 'end']}
-: !value 'P':
- - X: '1'
- Y: '2'
- - X: '3'
- Y: '2'
- - X: '3'
- Y: '0'
- - X: '1'
- Y: '0'
- - X: '0'
- Y: '0'
-...
-*/
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/rewriting/rewrite_aggregates.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/rewriting/rewrite_aggregates.cpp
deleted file mode 100644
index da55a3345093c..0000000000000
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/rewriting/rewrite_aggregates.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-// RUN: rm -rf %t
-// RUN: mkdir %t
-// RUN: %dexter_regression_test_cxx_build %s -o %t/test
-// RUN: %dexter_regression_test_run --use-script --binary %t/test \
-// RUN: --results-directory %t/results -- %s 2>&1 | FileCheck %s
-// RUN: diff %t/results/%{s:basename} %S/Inputs/rewrite_aggregates_expected.cpp
-
-/// Test that Dexter can write disaggregated expected values for aggregates,
-/// including falling back to the parent value if sub_values contain errors,
-/// e.g. for pointers that are not dereferencable.
-
-/// NB: The exact contents of this file are compared against the expect file in
-/// the Inputs/ directory; any changes to this file, including comments,
-/// will require updating the corresponding expected file.
-
-// CHECK: Rewrote script to add 5 expected values.
-
-// CHECK: total_watched_steps: 5
-// CHECK: correct_steps: 5
-// CHECK: incorrect_steps: 0
-// CHECK: seen_values: 16
-// CHECK: missing_values: 0
-
-struct Point {
- int X;
- int Y;
- int Z;
-};
-
-struct Rect {
- Point TopLeft;
- Point BottomRight;
-};
-
-int main() {
- Point P{1, 2, 3};
- int *I = &P.X;
- Rect R{{1, 1, 1}, {2, 2, 2}};
- int L[] = {0, 1, 2, 3, 4};
- int *InvalidPtr = nullptr;
- return 0; // !dex_label ret
-}
-
-/*
----
-!where {lines: !label ret}:
- ? !value P
- ? !value I
- ? !value R
- ? !value L
- ? !value InvalidPtr
-...
-*/
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/rewriting/rewrite_list_aggregates.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/rewriting/rewrite_list_aggregates.cpp
deleted file mode 100644
index ab517d1342b2f..0000000000000
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/scripts/rewriting/rewrite_list_aggregates.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-// RUN: rm -rf %t
-// RUN: mkdir %t
-// RUN: %dexter_regression_test_cxx_build %s -o %t/test
-// RUN: %dexter_regression_test_run --use-script --binary %t/test \
-// RUN: --results-directory %t/results -- %s 2>&1 | FileCheck %s
-// RUN: diff %t/results/%{s:basename} \
-// RUN: %S/Inputs/rewrite_list_aggregates_expected.cpp
-
-/// Test that Dexter can write expects for variables that are aggregates and
-/// have more than one value, without writing any duplicate expected values.
-
-/// NB: The exact contents of this file are compared against the expect file in
-/// the Inputs/ directory; any changes to this file, including comments,
-/// will require updating the corresponding expected file.
-
-// CHECK: Rewrote script to add 1 expected values.
-
-struct Point {
- int X;
- int Y;
-};
-
-int main() {
- Point P{1, 2};
- P.X = 3; // !dex_label start
- P.Y = 0;
- P.X = 1;
- P.Y = 2;
- P = {0, 0};
- return 0; // !dex_label end
-}
-
-// CHECK: total_watched_steps: 6
-// CHECK: correct_steps: 6
-// CHECK: incorrect_steps: 0
-// CHECK: partial_step_correctness: 6.0
-// CHECK: missing_var_steps: 0
-// CHECK: unexpected_value_steps: 0
-// CHECK: correct_step_coverage: 100.0% (6/6)
-// CHECK: seen_values: 10
-// CHECK: missing_values: 0
-
-/*
----
-!where {lines: !range [!label start, !label end]}:
- ? !value P
-...
-*/
More information about the llvm-commits
mailing list