https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/204366
>From ca61168412c33b5b483c0cd38e8335953529139c Mon Sep 17 00:00:00 2001 From: Stephen Tozer <[email protected]> Date: Wed, 17 Jun 2026 13:46:31 +0100 Subject: [PATCH 1/5] backport: add optimized out metric --- .../debuginfo-tests/dexter/dex/evaluation/Metrics.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cross-project-tests/debuginfo-tests/dexter/dex/evaluation/Metrics.py b/cross-project-tests/debuginfo-tests/dexter/dex/evaluation/Metrics.py index 06fba16c6e6e5..c4bc92d3bba73 100644 --- a/cross-project-tests/debuginfo-tests/dexter/dex/evaluation/Metrics.py +++ b/cross-project-tests/debuginfo-tests/dexter/dex/evaluation/Metrics.py @@ -107,6 +107,7 @@ def get_variable_metrics( all_expected_values = get_expected_value_set(expected_values) seen_expected_values = set() num_correct_steps = 0 + num_optimized_out_steps = 0 num_missing_var_steps = 0 num_unexpected_value_steps = 0 partial_step_correctness = 0.0 @@ -118,7 +119,10 @@ def get_variable_metrics( if match.match_result == MatchResult.TRUE: num_correct_steps += 1 elif match.actual_result is None: - num_missing_var_steps += 1 + if match.actual and match.actual.is_optimized_away: + num_optimized_out_steps += 1 + else: + num_missing_var_steps += 1 else: num_unexpected_value_steps += 1 assert all( @@ -143,6 +147,8 @@ def get_variable_metrics( ), # The sum of the 0.0-1.0 "correctness value" of matches across each step. "partial_step_correctness": ScalarMetric(partial_step_correctness), + # The number of steps where the watched variable/expression was marked "optimized out" in the debugger. + "optimized_out_steps": ScalarMetric(num_optimized_out_steps, improves_asc=False), # The number of steps where the watched variable/expression was not available in the debugger. "missing_var_steps": ScalarMetric(num_missing_var_steps, improves_asc=False), # The number of steps where the watched variable/expression had a value not in the set of expected values. >From 6690a887944a5618430fa08935b4fc43c600e409 Mon Sep 17 00:00:00 2001 From: Stephen Tozer <[email protected]> Date: Wed, 17 Jun 2026 15:48:56 +0100 Subject: [PATCH 2/5] Fix: Account for weird function name endings in lldb-dap --- .../debuginfo-tests/dexter/dex/debugger/lldb/LLDB.py | 5 +++++ 1 file changed, 5 insertions(+) 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 6ab06d066dfe6..6383036a8e1f1 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 @@ -436,6 +436,11 @@ def frames_below_main(self): "_start", ] + def _sanitize_function_name(self, name: str): # pylint: disable=no-self-use + if name.endswith(" [opt]"): + name = name[:-len(" [opt]")] + return name + def _post_step_hook(self): """Hook to be executed after completing a step request.""" if self._debugger_state.stopped_reason == "step": >From bf524bf2b7ab8faff7ca096429157278957687cb Mon Sep 17 00:00:00 2001 From: Stephen Tozer <[email protected]> Date: Wed, 17 Jun 2026 15:49:30 +0100 Subject: [PATCH 3/5] Add irretrievable metric --- .../debuginfo-tests/dexter/dex/evaluation/Metrics.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cross-project-tests/debuginfo-tests/dexter/dex/evaluation/Metrics.py b/cross-project-tests/debuginfo-tests/dexter/dex/evaluation/Metrics.py index c4bc92d3bba73..40d0db823d91d 100644 --- a/cross-project-tests/debuginfo-tests/dexter/dex/evaluation/Metrics.py +++ b/cross-project-tests/debuginfo-tests/dexter/dex/evaluation/Metrics.py @@ -108,6 +108,7 @@ def get_variable_metrics( seen_expected_values = set() num_correct_steps = 0 num_optimized_out_steps = 0 + num_irretrievable_steps = 0 num_missing_var_steps = 0 num_unexpected_value_steps = 0 partial_step_correctness = 0.0 @@ -121,6 +122,8 @@ def get_variable_metrics( elif match.actual_result is None: if match.actual and match.actual.is_optimized_away: num_optimized_out_steps += 1 + elif match.actual and match.actual.is_irretrievable: + num_irretrievable_steps += 1 else: num_missing_var_steps += 1 else: @@ -149,6 +152,8 @@ def get_variable_metrics( "partial_step_correctness": ScalarMetric(partial_step_correctness), # The number of steps where the watched variable/expression was marked "optimized out" in the debugger. "optimized_out_steps": ScalarMetric(num_optimized_out_steps, improves_asc=False), + # The number of steps where the watched variable/expression had an inaccessible address in the debugger. + "irretrievable_steps": ScalarMetric(num_irretrievable_steps, improves_asc=False), # The number of steps where the watched variable/expression was not available in the debugger. "missing_var_steps": ScalarMetric(num_missing_var_steps, improves_asc=False), # The number of steps where the watched variable/expression had a value not in the set of expected values. >From de04b0a48e2678520000975e63dc9fe502d40b9b Mon Sep 17 00:00:00 2001 From: Stephen Tozer <[email protected]> Date: Wed, 17 Jun 2026 16:27:00 +0100 Subject: [PATCH 4/5] format --- .../debuginfo-tests/dexter/dex/debugger/lldb/LLDB.py | 2 +- .../debuginfo-tests/dexter/dex/evaluation/Metrics.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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 6383036a8e1f1..7f4af13ad8481 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 @@ -438,7 +438,7 @@ def frames_below_main(self): def _sanitize_function_name(self, name: str): # pylint: disable=no-self-use if name.endswith(" [opt]"): - name = name[:-len(" [opt]")] + name = name[: -len(" [opt]")] return name def _post_step_hook(self): diff --git a/cross-project-tests/debuginfo-tests/dexter/dex/evaluation/Metrics.py b/cross-project-tests/debuginfo-tests/dexter/dex/evaluation/Metrics.py index 40d0db823d91d..09c2ba5f6cf5c 100644 --- a/cross-project-tests/debuginfo-tests/dexter/dex/evaluation/Metrics.py +++ b/cross-project-tests/debuginfo-tests/dexter/dex/evaluation/Metrics.py @@ -151,9 +151,13 @@ def get_variable_metrics( # The sum of the 0.0-1.0 "correctness value" of matches across each step. "partial_step_correctness": ScalarMetric(partial_step_correctness), # The number of steps where the watched variable/expression was marked "optimized out" in the debugger. - "optimized_out_steps": ScalarMetric(num_optimized_out_steps, improves_asc=False), + "optimized_out_steps": ScalarMetric( + num_optimized_out_steps, improves_asc=False + ), # The number of steps where the watched variable/expression had an inaccessible address in the debugger. - "irretrievable_steps": ScalarMetric(num_irretrievable_steps, improves_asc=False), + "irretrievable_steps": ScalarMetric( + num_irretrievable_steps, improves_asc=False + ), # The number of steps where the watched variable/expression was not available in the debugger. "missing_var_steps": ScalarMetric(num_missing_var_steps, improves_asc=False), # The number of steps where the watched variable/expression had a value not in the set of expected values. >From 1825a9161b732f2abd1207a4af95feb9a4551432 Mon Sep 17 00:00:00 2001 From: Stephen Tozer <[email protected]> Date: Wed, 24 Jun 2026 14:56:12 +0100 Subject: [PATCH 5/5] Remove all tags that LLDB may add --- .../debuginfo-tests/dexter/dex/debugger/lldb/LLDB.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 7f4af13ad8481..7f42a86dde600 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 @@ -437,8 +437,11 @@ def frames_below_main(self): ] def _sanitize_function_name(self, name: str): # pylint: disable=no-self-use - if name.endswith(" [opt]"): - name = name[: -len(" [opt]")] + # Remove the tags that LLDB may insert at the end of a function name; these appear in a fixed order, and we + # strip them in the reverse of that order below. + for tag in ["artificial", "inlined", "opt"]: + if name.endswith(f" [{tag}]"): + name = name[: -len(f" [{tag}]")] return name def _post_step_hook(self): _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
