[llvm] [Dexter] Update Dexter lit substitutions, making lldb-dap the default (PR #155838)

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 29 04:34:44 PDT 2025


https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/155838

>From 987839143c056d6c3b66d90ba2d23d99625987ae Mon Sep 17 00:00:00 2001
From: Stephen Tozer <stephen.tozer at sony.com>
Date: Thu, 28 Aug 2025 14:50:11 +0100
Subject: [PATCH 1/5] [Dexter] Update Dexter lit substitutions, making lldb-dap
 the default

This patch updates Dexter's lit test setup, making lldb-dap the default
debugger where available; as part of this, I've replaced references to
`--debugger lldb` with new substitutions that provide the debugger and
executable path: one substitution returns just lldb for the tests that
require it, and the other which provides the system-preferred preferred
debugger for the tests that should be able to run with any debugger.

As a small note, one test generates output that differs between lldb and
lldb-dap - for this test specifically, we add an lldb-dap feature so that
it can be marked XFAIL if we fall back to using LLDB.
---
 .../dexter-tests/aggregate-indirect-arg.cpp   |  2 +-
 .../dexter-tests/asan-deque.cpp               |  2 +-
 .../debuginfo-tests/dexter-tests/asan.c       |  2 +-
 .../debuginfo-tests/dexter-tests/ctor.cpp     |  2 +-
 .../debuginfo-tests/dexter-tests/dbg-arg.c    |  2 +-
 .../dexter-tests/deferred_globals.cpp         |  2 +-
 .../dexter-tests/memvars/bitcast.c            |  2 +-
 .../dexter-tests/memvars/const-branch.c       |  2 +-
 .../dexter-tests/memvars/ctrl-flow.c          |  2 +-
 .../dexter-tests/memvars/implicit-ptr.c       |  2 +-
 .../memvars/inline-escaping-function.c        |  2 +-
 .../dexter-tests/memvars/inlining-dse.c       |  2 +-
 .../dexter-tests/memvars/inlining.c           |  2 +-
 .../dexter-tests/memvars/loop.c               |  2 +-
 .../dexter-tests/memvars/merged-store.c       |  2 +-
 .../dexter-tests/memvars/ptr-to.c             |  2 +-
 .../dexter-tests/memvars/struct-dse.c         |  2 +-
 .../memvars/unused-merged-value.c             |  2 +-
 .../dexter-tests/namespace.cpp                |  2 +-
 .../dexter-tests/nrvo-string.cpp              |  4 +-
 .../dexter-tests/optnone-fastmath.cpp         |  4 +-
 .../dexter-tests/optnone-loops.cpp            |  2 +-
 .../dexter-tests/optnone-simple-functions.cpp |  4 +-
 .../optnone-struct-and-methods.cpp            |  4 +-
 .../optnone-vectors-and-functions.cpp         |  4 +-
 .../debuginfo-tests/dexter-tests/stack-var.c  |  2 +-
 .../debuginfo-tests/dexter-tests/vla.c        |  2 +-
 .../expression_address.cpp                    |  5 ++-
 .../dex_finish_test/limit_steps_simple.cpp    |  7 +--
 .../subtools/test/err_label_kwarg.cpp         |  2 +-
 .../test/err_limit_steps_no_values.cpp        |  2 +-
 .../feature_tests/subtools/test/err_paren.cpp |  2 +-
 .../subtools/test/err_paren_mline.cpp         |  2 +-
 .../subtools/test/err_syntax.cpp              |  2 +-
 .../test/err_syntax_dexdeclarefile.cpp        |  2 +-
 .../subtools/test/err_syntax_mline.cpp        |  2 +-
 .../feature_tests/subtools/test/err_type.cpp  |  2 +-
 .../subtools/test/err_type_mline.cpp          |  2 +-
 .../subtools/test/source-root-dir.cpp         |  6 +--
 cross-project-tests/lit.cfg.py                | 45 ++++++++-----------
 40 files changed, 70 insertions(+), 75 deletions(-)

diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/aggregate-indirect-arg.cpp b/cross-project-tests/debuginfo-tests/dexter-tests/aggregate-indirect-arg.cpp
index f20b7ce1d3e4d..4e06ba5d375ce 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/aggregate-indirect-arg.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/aggregate-indirect-arg.cpp
@@ -3,7 +3,7 @@
 //
 // RUN: %clang++ -std=gnu++11 -O0 -g %s -o %t
 // RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary %t --debugger 'lldb' -- %s
+// RUN:     --binary %t %dexter_lldb_args -- %s
 // Radar 8945514
 
 class SVal {
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/asan-deque.cpp b/cross-project-tests/debuginfo-tests/dexter-tests/asan-deque.cpp
index 08540145dc4ee..d807fa1906080 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/asan-deque.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/asan-deque.cpp
@@ -10,7 +10,7 @@
 
 // RUN: %clang++ -std=gnu++11 -O1 -glldb -fsanitize=address -arch x86_64 %s -o %t
 // RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary %t --debugger 'lldb' -- %s
+// RUN:     --binary %t %dexter_lldb_args -- %s
 #include <deque>
 
 struct A {
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/asan.c b/cross-project-tests/debuginfo-tests/dexter-tests/asan.c
index e52494c585d82..9105e1d8801b5 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/asan.c
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/asan.c
@@ -6,7 +6,7 @@
 // RUN: %clang -std=gnu11 --driver-mode=gcc -O0 -glldb -fblocks -arch x86_64 \
 // RUN:     -fsanitize=address %s -o %t
 // RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary %t --debugger 'lldb' -- %s
+// RUN:     --binary %t %dexter_lldb_args -- %s
 
 struct S {
   int a[8];
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/ctor.cpp b/cross-project-tests/debuginfo-tests/dexter-tests/ctor.cpp
index 48482ceb31b95..6b6dc3ef309b7 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/ctor.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/ctor.cpp
@@ -3,7 +3,7 @@
 //
 // RUN: %clang++ -std=gnu++11 -O0 -glldb %s -o %t
 // RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary %t --debugger 'lldb' -- %s
+// RUN:     --binary %t %dexter_lldb_args -- %s
 
 class A {
 public:
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/dbg-arg.c b/cross-project-tests/debuginfo-tests/dexter-tests/dbg-arg.c
index ff000f584db03..f1f145c7ff384 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/dbg-arg.c
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/dbg-arg.c
@@ -4,7 +4,7 @@
 // This test case checks debug info during register moves for an argument.
 // RUN: %clang -std=gnu11 -m64 -mllvm -fast-isel=false -g %s -o %t
 // RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary %t --debugger 'lldb' -- %s
+// RUN:     --binary %t %dexter_lldb_args -- %s
 //
 // Radar 8412415
 
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/deferred_globals.cpp b/cross-project-tests/debuginfo-tests/dexter-tests/deferred_globals.cpp
index 5954f5297be0c..570708d4fa918 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/deferred_globals.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/deferred_globals.cpp
@@ -6,7 +6,7 @@
 // UNSUPPORTED: system-windows
 // RUN: %clang++ -std=gnu++11 -O0 -g %s -o %t
 // RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary  %t --debugger 'lldb' -v -- %s
+// RUN:     --binary  %t %dexter_lldb_args -v -- %s
 
 const int d = 100;
 
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/bitcast.c b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/bitcast.c
index 314fd3b31c42f..69e3b8035511a 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/bitcast.c
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/bitcast.c
@@ -4,7 +4,7 @@
 // REQUIRES: lldb
 // UNSUPPORTED: system-windows
 // RUN: %clang -std=gnu11 -O3 -glldb %s -o %t
-// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
+// RUN: %dexter --fail-lt 1.0 -w %dexter_lldb_args --binary %t -- %s
 
 //// Adapted from https://bugs.llvm.org/show_bug.cgi?id=34136#c1
 //// LowerDbgDeclare has since been updated to look through bitcasts. We still
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/const-branch.c b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/const-branch.c
index 42629c556ffa0..c67dd0a3747b2 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/const-branch.c
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/const-branch.c
@@ -4,7 +4,7 @@
 // REQUIRES: lldb
 // UNSUPPORTED: system-windows
 // RUN: %clang -std=gnu11 -O3 -glldb %s -o %t
-// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
+// RUN: %dexter --fail-lt 1.0 -w %dexter_lldb_args --binary %t -- %s
 
 //// Adapted from https://bugs.llvm.org/show_bug.cgi?id=34136#c4
 
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/ctrl-flow.c b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/ctrl-flow.c
index 16ad91ec8ca0c..4fa4e6e0120d2 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/ctrl-flow.c
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/ctrl-flow.c
@@ -1,7 +1,7 @@
 // REQUIRES: lldb
 // UNSUPPORTED: system-windows
 // RUN: %clang -std=gnu11 -O2 -glldb %s -o %t
-// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
+// RUN: %dexter --fail-lt 1.0 -w %dexter_lldb_args --binary %t -- %s
 
 //// Check that we give good locations to a variable ('local') which is escaped
 //// down some control paths and not others. This example is handled well currently.
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/implicit-ptr.c b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/implicit-ptr.c
index c43b992414451..5c11fe426d91d 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/implicit-ptr.c
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/implicit-ptr.c
@@ -4,7 +4,7 @@
 // REQUIRES: lldb
 // UNSUPPORTED: system-windows
 // RUN: %clang -std=gnu11 -O3 -glldb %s -o %t
-// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
+// RUN: %dexter --fail-lt 1.0 -w %dexter_lldb_args --binary %t -- %s
 
 //// Check that 'param' in 'fun' can be read throughout, and that 'pa' and 'pb'
 //// can be dereferenced in the debugger even if we can't provide the pointer
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/inline-escaping-function.c b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/inline-escaping-function.c
index 3c03603736f73..541f003c26156 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/inline-escaping-function.c
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/inline-escaping-function.c
@@ -4,7 +4,7 @@
 // REQUIRES: lldb
 // UNSUPPORTED: system-windows
 // RUN: %clang -std=gnu11 -O3 -glldb %s -o %t
-// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
+// RUN: %dexter --fail-lt 1.0 -w %dexter_lldb_args --binary %t -- %s
 
 // 1. param is escaped by inlineme(&param) so it is not promoted by
 //    SROA/mem2reg.
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/inlining-dse.c b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/inlining-dse.c
index d5bdc3e01fa17..cded557f4e16b 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/inlining-dse.c
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/inlining-dse.c
@@ -4,7 +4,7 @@
 // REQUIRES: lldb
 // UNSUPPORTED: system-windows
 // RUN: %clang -std=gnu11 -O2 -glldb %s -o %t
-// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
+// RUN: %dexter --fail-lt 1.0 -w %dexter_lldb_args --binary %t -- %s
 //
 //// Check that once-escaped variable 'param' can still be read after we
 //// perform inlining + mem2reg, and that we see the DSE'd value 255.
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/inlining.c b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/inlining.c
index dd7b3452f2b02..7d02b2d4bc8cb 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/inlining.c
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/inlining.c
@@ -1,7 +1,7 @@
 // REQUIRES: lldb
 // UNSUPPORTED: system-windows
 // RUN: %clang -std=gnu11 -O2 -glldb %s -o %t
-// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
+// RUN: %dexter --fail-lt 1.0 -w %dexter_lldb_args --binary %t -- %s
 //
 //// Check that the once-escaped variable 'param' can still be read after
 //// we perform inlining + mem2reg. See D89810 and D85555.
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/loop.c b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/loop.c
index 8ce358b4aada7..d74432579c3bb 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/loop.c
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/loop.c
@@ -4,7 +4,7 @@
 // REQUIRES: lldb
 // UNSUPPORTED: system-windows
 // RUN: %clang -std=gnu11 -O3 -glldb %s -o %t
-// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
+// RUN: %dexter --fail-lt 1.0 -w %dexter_lldb_args --binary %t -- %s
 
 //// Check that escaped local 'param' in function 'fun' has sensible debug info
 //// after the escaping function 'use' gets arg promotion (int* -> int). Currently
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/merged-store.c b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/merged-store.c
index bbd806a08819f..492e42dfce0b1 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/merged-store.c
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/merged-store.c
@@ -4,7 +4,7 @@
 // REQUIRES: lldb
 // UNSUPPORTED: system-windows
 // RUN: %clang -std=gnu11 -O3 -glldb %s -o %t
-// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
+// RUN: %dexter --fail-lt 1.0 -w %dexter_lldb_args --binary %t -- %s
 
 // 1. parama is escaped by esc(&parama) so it is not promoted by
 //    SROA/mem2reg.
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/ptr-to.c b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/ptr-to.c
index 26adc2e4d9788..632b499eebd10 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/ptr-to.c
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/ptr-to.c
@@ -5,7 +5,7 @@
 // REQUIRES: lldb
 // UNSUPPORTED: system-windows
 // RUN: %clang -std=gnu11 -O2 -glldb %s -o %t
-// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
+// RUN: %dexter --fail-lt 1.0 -w %dexter_lldb_args --binary %t -- %s
 //
 //// Check that a pointer to a variable living on the stack dereferences to the
 //// variable value.
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/struct-dse.c b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/struct-dse.c
index 2975b88e8bc63..5a36bbe598736 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/struct-dse.c
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/struct-dse.c
@@ -5,7 +5,7 @@
 // REQUIRES: lldb
 // UNSUPPORTED: system-windows
 // RUN: %clang -std=gnu11 -O2 -glldb %s -o %t
-// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
+// RUN: %dexter --fail-lt 1.0 -w %dexter_lldb_args --binary %t -- %s
 //
 //// Check debug-info for the escaped struct variable num is reasonable.
 
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/unused-merged-value.c b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/unused-merged-value.c
index 38a9b644be504..2cf3e968ca757 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/memvars/unused-merged-value.c
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/memvars/unused-merged-value.c
@@ -6,7 +6,7 @@
 // REQUIRES: lldb
 // UNSUPPORTED: system-windows
 // RUN: %clang -std=gnu11 -O3 -glldb %s -o %t
-// RUN: %dexter --fail-lt 0.1 -w --debugger lldb --binary %t -- %s
+// RUN: %dexter --fail-lt 0.1 -w %dexter_lldb_args --binary %t -- %s
 // See NOTE at end for more info about the RUN command.
 
 // 1. SROA/mem2reg fully promotes parama.
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/namespace.cpp b/cross-project-tests/debuginfo-tests/dexter-tests/namespace.cpp
index e6709cc807db6..ba910644de4e9 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/namespace.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/namespace.cpp
@@ -7,7 +7,7 @@
 
 // RUN: %clang++ -g -O0 %s -o %t
 // RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary %t --debugger 'lldb' -v -- %s
+// RUN:     --binary %t %dexter_lldb_args -v -- %s
 
 #include <stdio.h>
 
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/nrvo-string.cpp b/cross-project-tests/debuginfo-tests/dexter-tests/nrvo-string.cpp
index 5df190a07a4e9..42a7110151b24 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/nrvo-string.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/nrvo-string.cpp
@@ -9,11 +9,11 @@
 //
 // RUN: %clang++ -std=gnu++11 -O0 -glldb -fno-exceptions %s -o %t
 // RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary %t --debugger 'lldb' -- %s
+// RUN:     --binary %t %dexter_lldb_args -- %s
 //
 // RUN: %clang++ -std=gnu++11 -O1 -glldb -fno-exceptions %s -o %t
 // RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary %t --debugger 'lldb' -- %s
+// RUN:     --binary %t %dexter_lldb_args -- %s
 //
 // PR34513
 volatile int sideeffect = 0;
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/optnone-fastmath.cpp b/cross-project-tests/debuginfo-tests/dexter-tests/optnone-fastmath.cpp
index 6053488dc6808..3f21a8711b3d5 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/optnone-fastmath.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/optnone-fastmath.cpp
@@ -1,9 +1,9 @@
 // RUN: %clang++ -std=gnu++11 -O2 -ffast-math -g %s -o %t
 // RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary %t --debugger 'lldb' -- %s
+// RUN:     --binary %t %dexter_lldb_args -- %s
 // RUN: %clang++ -std=gnu++11 -O0 -ffast-math -g %s -o %t
 // RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary %t --debugger 'lldb' -- %s
+// RUN:     --binary %t %dexter_lldb_args -- %s
 
 // REQUIRES: lldb
 // Currently getting intermittent failures on darwin.
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/optnone-loops.cpp b/cross-project-tests/debuginfo-tests/dexter-tests/optnone-loops.cpp
index 230998c6d4e0d..f760b7afe6cb9 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/optnone-loops.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/optnone-loops.cpp
@@ -7,7 +7,7 @@
 
 // RUN: %clang++ -std=gnu++11 -O2 -g %s -o %t
 // RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary %t --debugger 'lldb' -- %s
+// RUN:     --binary %t %dexter_lldb_args -- %s
 
 // A simple loop of assignments.
 // With optimization level > 0 the compiler reorders basic blocks
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/optnone-simple-functions.cpp b/cross-project-tests/debuginfo-tests/dexter-tests/optnone-simple-functions.cpp
index e585c20f4a018..cc693cc7c967b 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/optnone-simple-functions.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/optnone-simple-functions.cpp
@@ -1,9 +1,9 @@
 // RUN: %clang++ -std=gnu++11 -O2 -g %s -o %t
 // RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary %t --debugger 'lldb' -- %s
+// RUN:     --binary %t %dexter_lldb_args -- %s
 // RUN: %clang++ -std=gnu++11 -O0 -g %s -o %t
 // RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary %t --debugger 'lldb' -- %s
+// RUN:     --binary %t %dexter_lldb_args -- %s
 
 // REQUIRES: lldb, D136396
 // Currently getting intermittent failures on darwin.
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp b/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp
index 6aebd502614fe..94934356ac7e3 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp
@@ -1,9 +1,9 @@
 // RUN: %clang++ -std=gnu++11 -O2 -g %s -o %t
 // RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary %t --debugger 'lldb' -v -- %s
+// RUN:     --binary %t %dexter_lldb_args -v -- %s
 // RUN: %clang++ -std=gnu++11 -O0 -g %s -o %t
 // RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary %t --debugger 'lldb' -- %s
+// RUN:     --binary %t %dexter_lldb_args -- %s
 
 // REQUIRES: lldb
 // Currently getting intermittent failures on darwin.
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/optnone-vectors-and-functions.cpp b/cross-project-tests/debuginfo-tests/dexter-tests/optnone-vectors-and-functions.cpp
index 5c4cfc0b9c432..fd244fbafdb7e 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/optnone-vectors-and-functions.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/optnone-vectors-and-functions.cpp
@@ -1,9 +1,9 @@
 // RUN: %clang++ -std=gnu++11 -O2 -g %s -o %t
 // RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary %t --debugger 'lldb' -v -- %s
+// RUN:     --binary %t %dexter_lldb_args -v -- %s
 // RUN: %clang++ -std=gnu++11 -O0 -g %s -o %t
 // RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary %t --debugger 'lldb' -- %s
+// RUN:     --binary %t %dexter_lldb_args -- %s
 
 // REQUIRES: lldb
 // Currently getting intermittent failures on darwin.
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/stack-var.c b/cross-project-tests/debuginfo-tests/dexter-tests/stack-var.c
index 7e3c4b5d0ce1b..8447dd1cad290 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/stack-var.c
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/stack-var.c
@@ -2,7 +2,7 @@
 // UNSUPPORTED: system-windows
 //
 // RUN: %clang -std=gnu11 -O -glldb %s -o %t
-// RUN: %dexter --fail-lt 1.0 -w --binary %t --debugger 'lldb' -- %s
+// RUN: %dexter --fail-lt 1.0 -w --binary %t %dexter_lldb_args -- %s
 
 void __attribute__((noinline, optnone)) bar(int *test) {}
 int main() {
diff --git a/cross-project-tests/debuginfo-tests/dexter-tests/vla.c b/cross-project-tests/debuginfo-tests/dexter-tests/vla.c
index ff5297f890e7a..6978b5b91fa3b 100644
--- a/cross-project-tests/debuginfo-tests/dexter-tests/vla.c
+++ b/cross-project-tests/debuginfo-tests/dexter-tests/vla.c
@@ -3,7 +3,7 @@
 // UNSUPPORTED: system-windows
 //
 // RUN: %clang -std=gnu11 -O0 -glldb %s -o %t
-// RUN: %dexter --fail-lt 1.0 -w --binary %t --debugger 'lldb' -- %s
+// RUN: %dexter --fail-lt 1.0 -w --binary %t %dexter_lldb_args -- %s
 
 void init_vla(int size) {
   int i;
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_declare_address/expression_address.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_declare_address/expression_address.cpp
index 2bb83850e2a16..5335fdd6445f6 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_declare_address/expression_address.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_declare_address/expression_address.cpp
@@ -2,6 +2,9 @@
 //      Test that a \DexDeclareAddress value can be used to compare the
 //      addresses of two local variables that refer to the same address.
 //
+// NB: This test passes with `--debugger lldb-dap` but fails with --debugger lldb
+// XFAIL: !system-windows && !lldb-dap
+//
 // RUN: %dexter_regression_test_cxx_build %s -o %t
 // RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
 // CHECK: expression_address.cpp
@@ -14,4 +17,4 @@ int main() {
 
 // DexDeclareAddress('x_addr', '&x', on_line=ref('test_line'))
 // DexExpectWatchValue('&x', address('x_addr'), on_line=ref('test_line'))
-// DexExpectWatchValue('&y', address('x_addr'), on_line=ref('test_line'))
+// DexExpectWatchValue('y', address('x_addr'), on_line=ref('test_line'))
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_finish_test/limit_steps_simple.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_finish_test/limit_steps_simple.cpp
index 27505d5a3f5a0..923f596ab84ed 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_finish_test/limit_steps_simple.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_finish_test/limit_steps_simple.cpp
@@ -12,10 +12,11 @@
 // CHECK: limit_steps_simple.cpp
 
 int main() {
-    int x = 0; // DexLabel('start')
-    x = 1;
+    int x = 0;
+    x = 1; // DexLabel('start')
     x = 2; // DexLabel('finish_line')
-} // DexLabel('finish')
+    return 0; // DexLabel('finish')
+}
 
 // DexLimitSteps(from_line=ref('start'), to_line=ref('finish'))
 // DexFinishTest(on_line=ref('finish_line'))
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_label_kwarg.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_label_kwarg.cpp
index b0bd50a248d12..da15735252533 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_label_kwarg.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_label_kwarg.cpp
@@ -2,7 +2,7 @@
 //    Check that bad keyword args in \DexLabel are reported.
 //    Use --binary switch to trick dexter into skipping the build step.
 //
-// RUN: not %dexter_base test --binary %s --debugger 'lldb' -- %s | FileCheck %s
+// RUN: not %dexter_base test --binary %s %dexter_regression_test_debugger_args -- %s | FileCheck %s
 // CHECK: parser error:{{.*}}err_label_kwarg.cpp(8): unexpected named args: bad_arg
 
 // DexLabel('test', bad_arg=0)
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_limit_steps_no_values.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_limit_steps_no_values.cpp
index 64e41495ece10..978450eeb8cd8 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_limit_steps_no_values.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_limit_steps_no_values.cpp
@@ -3,7 +3,7 @@
 //    in a \DexLimitSteps command results in a useful error message.
 //    Use --binary switch to trick dexter into skipping the build step.
 //
-// RUN: not %dexter_base test --binary %s --debugger 'lldb' -- %s | FileCheck %s
+// RUN: not %dexter_base test --binary %s %dexter_regression_test_debugger_args -- %s | FileCheck %s
 // CHECK: parser error:{{.*}}err_limit_steps_no_values.cpp(9): expected 0 or at least 2 positional arguments
 
 // DexLimitSteps('test')
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren.cpp
index 5a35b3a512bef..7987e0d775b28 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren.cpp
@@ -8,7 +8,7 @@
 //       as the test should finish before lldb would be invoked.
 //
 // RUN: %dexter_regression_test_cxx_build %s -o %t
-// RUN: not %dexter_base test --binary %t --debugger 'lldb' \
+// RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args \
 // RUN:     -v -- %s | FileCheck %s --match-full-lines --strict-whitespace
 //
 // CHECK:parser error:{{.*}}err_paren.cpp(22): Unbalanced parenthesis starting here
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren_mline.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren_mline.cpp
index 0044b3b6eff01..cd9d1d1f83321 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren_mline.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren_mline.cpp
@@ -8,7 +8,7 @@
 //       as the test should finish before lldb would be invoked.
 //
 // RUN: %dexter_regression_test_cxx_build %s -o %t
-// RUN: not %dexter_base test --binary %t --debugger "lldb" \
+// RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args \
 // RUN:     -v -- %s | FileCheck %s --match-full-lines --strict-whitespace
 //
 // CHECK:parser error:{{.*}}err_paren_mline.cpp(23): Unbalanced parenthesis starting here
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax.cpp
index 5992025442132..092d1e5045320 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax.cpp
@@ -8,7 +8,7 @@
 //       as the test should finish before lldb would be invoked.
 //
 // RUN: %dexter_regression_test_cxx_build %s -o %t
-// RUN: not %dexter_base test --binary %t --debugger "lldb" \
+// RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args \
 // RUN:     -v -- %s | FileCheck %s --match-full-lines --strict-whitespace
 //
 // CHECK:parser error:{{.*}}err_syntax.cpp(21): invalid syntax
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_dexdeclarefile.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_dexdeclarefile.cpp
index 40cc1581f85fa..0fdf255eded8f 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_dexdeclarefile.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_dexdeclarefile.cpp
@@ -3,7 +3,7 @@
 //      they appeared in rather than the current declared file.
 //
 // RUN: %dexter_regression_test_cxx_build %s -o %t
-// RUN: not %dexter_base test --binary %t --debugger 'lldb' -v -- %s \
+// RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args -v -- %s \
 // RUN:     | FileCheck %s --implicit-check-not=FAIL-FILENAME-MATCH
 
 // CHECK: err_syntax_dexdeclarefile.cpp(14): Undeclared address: 'not_been_declared'
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_mline.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_mline.cpp
index 71b23a2a3a8b9..57afe5787efab 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_mline.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_mline.cpp
@@ -8,7 +8,7 @@
 //       as the test should finish before lldb would be invoked.
 //
 // RUN: %dexter_regression_test_cxx_build %s -o %t
-// RUN: not %dexter_base test --binary %t --debugger "lldb" \
+// RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args \
 // RUN:     -v -- %s | FileCheck %s --match-full-lines --strict-whitespace
 //
 // CHECK:parser error:{{.*}}err_syntax_mline.cpp(24): invalid syntax
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type.cpp
index 264515496f1c1..e9700fc2fe781 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type.cpp
@@ -8,7 +8,7 @@
 //       as the test should finish before lldb would be invoked.
 //
 // RUN: %dexter_regression_test_cxx_build %s -o %t
-// RUN: not %dexter_base test --binary %t --debugger "lldb" \
+// RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args \
 // RUN:     -v -- %s | FileCheck %s --match-full-lines --strict-whitespace
 //
 // CHECK:parser error:{{.*}}err_type.cpp(21): expected at least two args
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type_mline.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type_mline.cpp
index 5cbcd2d88808e..85d0d12cb1033 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type_mline.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type_mline.cpp
@@ -8,7 +8,7 @@
 //       as the test should finish before lldb would be invoked.
 //
 // RUN: %dexter_regression_test_cxx_build %s -o %t
-// RUN: not %dexter_base test --binary %t --debugger "lldb" \
+// RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args \
 // RUN:     -v -- %s | FileCheck %s --match-full-lines --strict-whitespace
 //
 // CHECK:parser error:{{.*}}err_type_mline.cpp(22): expected at least two args
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/source-root-dir.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/source-root-dir.cpp
index af24c5d8e572c..edbafdc6bfc10 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/source-root-dir.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/source-root-dir.cpp
@@ -2,10 +2,8 @@
 // XFAIL:*
 // RUN: %dexter_regression_test_cxx_build \
 // RUN:     -fdebug-prefix-map=%S=/changed %s -o %t
-// RUN: %dexter --fail-lt 1.0 -w \
-// RUN:     --binary %t \
-// RUN:     --debugger %dexter_regression_test_debugger \
-// RUN:     --source-root-dir=%S --debugger-use-relative-paths -- %s
+// RUN: %dexter_regression_test_run \
+// RUN:     --binary %t --source-root-dir=%S --debugger-use-relative-paths -- %s
 
 #include <stdio.h>
 int main() {
diff --git a/cross-project-tests/lit.cfg.py b/cross-project-tests/lit.cfg.py
index a3af729f8fff3..7fa7d2b9220a6 100644
--- a/cross-project-tests/lit.cfg.py
+++ b/cross-project-tests/lit.cfg.py
@@ -103,9 +103,16 @@ def get_required_attr(config, attr_name):
 
 # Check which debuggers are available:
 lldb_path = llvm_config.use_llvm_tool("lldb", search_env="LLDB")
+lldb_dap_path = llvm_config.use_llvm_tool("lldb-dap")
 
+# We prefer to use lldb-dap if possible, but we assume that there will never be a case where lldb-dap is available and
+# lldb isn't, so use the existence of lldb as the lowest common denominator.
 if lldb_path is not None:
     config.available_features.add("lldb")
+# There are some small niche differences in the output between lldb and lldb-dap, so we add this feature as a way to
+# disable the tests that will fail if we fall back to lldb.
+if lldb_dap_path is not None:
+    config.available_features.add("lldb-dap")
 
 if llvm_config.use_llvm_tool("llvm-ar"):
     config.available_features.add("llvm-ar")
@@ -117,10 +124,11 @@ def configure_dexter_substitutions():
     dexter_path = os.path.join(
         config.cross_project_tests_src_root, "debuginfo-tests", "dexter", "dexter.py"
     )
-    dexter_test_cmd = '"{}" "{}" test'.format(sys.executable, dexter_path)
-    if lldb_path is not None:
-        dexter_test_cmd += ' --lldb-executable "{}"'.format(lldb_path)
-    tools.append(ToolSubst("%dexter", dexter_test_cmd))
+    tools.append(ToolSubst("%dexter", f'"{sys.executable}" "{dexter_path}" test'))
+    if lldb_dap_path is not None:
+        tools.append(ToolSubst("%dexter_lldb_args", f'--lldb-executable "{lldb_dap_path}" --debugger lldb-dap'))
+    elif lldb_path is not None:
+        tools.append(ToolSubst("%dexter_lldb_args", f'--lldb-executable "{lldb_path}" --debugger lldb'))
 
     # For testing other bits of dexter that aren't under the "test" subcommand,
     # have a %dexter_base substitution.
@@ -144,32 +152,17 @@ def configure_dexter_substitutions():
         dependencies = ["clang", "lldb"]
         dexter_regression_test_c_builder = "clang"
         dexter_regression_test_cxx_builder = "clang++"
-        dexter_regression_test_debugger = "lldb"
+        if lldb_dap_path is not None:
+            dexter_regression_test_debugger = "lldb-dap"
+            dexter_regression_test_additional_flags = f'--lldb-executable "{lldb_dap_path}"'
+        else:
+            dexter_regression_test_debugger = "lldb"
+            dexter_regression_test_additional_flags = f'--lldb-executable "{lldb_path}"'
         dexter_regression_test_c_flags = "-O0 -glldb -std=gnu11"
         dexter_regression_test_cxx_flags = "-O0 -glldb -std=gnu++11"
-        dexter_regression_test_additional_flags = '--lldb-executable "{}"'.format(
-            lldb_path
-        )
 
     tools.append(
-        ToolSubst("%dexter_regression_test_c_builder", dexter_regression_test_c_builder)
-    )
-    tools.append(
-        ToolSubst(
-            "%dexter_regression_test_cxx_builder", dexter_regression_test_cxx_builder
-        )
-    )
-    tools.append(
-        ToolSubst("%dexter_regression_test_debugger", dexter_regression_test_debugger)
-    )
-    # We don't need to distinguish cflags and ldflags because for Dexter
-    # regression tests we use clang to drive the linker, and so all flags will be
-    # passed in a single command.
-    tools.append(
-        ToolSubst("%dexter_regression_test_c_flags", dexter_regression_test_c_flags)
-    )
-    tools.append(
-        ToolSubst("%dexter_regression_test_cxx_flags", dexter_regression_test_cxx_flags)
+        ToolSubst("%dexter_regression_test_debugger_args", f"--debugger {dexter_regression_test_debugger} {dexter_regression_test_additional_flags}")
     )
 
     # Typical command would take the form:

>From 54ea31fcec4429b649fd19ef042bdc018ccf8d67 Mon Sep 17 00:00:00 2001
From: Stephen Tozer <stephen.tozer at sony.com>
Date: Thu, 28 Aug 2025 15:14:36 +0100
Subject: [PATCH 2/5] Remove prior note referencing lldb being used as the
 debugger

---
 .../dexter/feature_tests/subtools/test/err_paren.cpp           | 3 ---
 .../dexter/feature_tests/subtools/test/err_paren_mline.cpp     | 3 ---
 .../dexter/feature_tests/subtools/test/err_syntax.cpp          | 3 ---
 .../dexter/feature_tests/subtools/test/err_syntax_mline.cpp    | 3 ---
 .../dexter/feature_tests/subtools/test/err_type.cpp            | 3 ---
 .../dexter/feature_tests/subtools/test/err_type_mline.cpp      | 3 ---
 6 files changed, 18 deletions(-)

diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren.cpp
index 7987e0d775b28..e986831ac79ce 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren.cpp
@@ -4,9 +4,6 @@
 //      Check directives are in check.txt to prevent dexter reading any embedded
 //      commands.
 //
-// Note: Despite using 'lldb' as the debugger, lldb is not actually required
-//       as the test should finish before lldb would be invoked.
-//
 // RUN: %dexter_regression_test_cxx_build %s -o %t
 // RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args \
 // RUN:     -v -- %s | FileCheck %s --match-full-lines --strict-whitespace
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren_mline.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren_mline.cpp
index cd9d1d1f83321..f9d705fd97c49 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren_mline.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren_mline.cpp
@@ -4,9 +4,6 @@
 //      Check directives are in check.txt to prevent dexter reading any embedded
 //      commands.
 //
-// Note: Despite using 'lldb' as the debugger, lldb is not actually required
-//       as the test should finish before lldb would be invoked.
-//
 // RUN: %dexter_regression_test_cxx_build %s -o %t
 // RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args \
 // RUN:     -v -- %s | FileCheck %s --match-full-lines --strict-whitespace
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax.cpp
index 092d1e5045320..f26b392a588c5 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax.cpp
@@ -4,9 +4,6 @@
 //      Check directives are in check.txt to prevent dexter reading any embedded
 //      commands.
 //
-// Note: Despite using 'lldb' as the debugger, lldb is not actually required
-//       as the test should finish before lldb would be invoked.
-//
 // RUN: %dexter_regression_test_cxx_build %s -o %t
 // RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args \
 // RUN:     -v -- %s | FileCheck %s --match-full-lines --strict-whitespace
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_mline.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_mline.cpp
index 57afe5787efab..793721edb3df6 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_mline.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_mline.cpp
@@ -4,9 +4,6 @@
 //      Check directives are in check.txt to prevent dexter reading any embedded
 //      commands.
 //
-// Note: Despite using 'lldb' as the debugger, lldb is not actually required
-//       as the test should finish before lldb would be invoked.
-//
 // RUN: %dexter_regression_test_cxx_build %s -o %t
 // RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args \
 // RUN:     -v -- %s | FileCheck %s --match-full-lines --strict-whitespace
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type.cpp
index e9700fc2fe781..3a4512ee0f03c 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type.cpp
@@ -4,9 +4,6 @@
 //      Check directives are in check.txt to prevent dexter reading any embedded
 //      commands.
 //
-// Note: Despite using 'lldb' as the debugger, lldb is not actually required
-//       as the test should finish before lldb would be invoked.
-//
 // RUN: %dexter_regression_test_cxx_build %s -o %t
 // RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args \
 // RUN:     -v -- %s | FileCheck %s --match-full-lines --strict-whitespace
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type_mline.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type_mline.cpp
index 85d0d12cb1033..e0a43e88c3cff 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type_mline.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type_mline.cpp
@@ -4,9 +4,6 @@
 //      Check directives are in check.txt to prevent dexter reading any embedded
 //      commands.
 //
-// Note: Despite using 'lldb' as the debugger, lldb is not actually required
-//       as the test should finish before lldb would be invoked.
-//
 // RUN: %dexter_regression_test_cxx_build %s -o %t
 // RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args \
 // RUN:     -v -- %s | FileCheck %s --match-full-lines --strict-whitespace

>From 0f2cc36419cb304b8a4edb1a939df3b2ad1a2e49 Mon Sep 17 00:00:00 2001
From: Stephen Tozer <stephen.tozer at sony.com>
Date: Thu, 28 Aug 2025 16:01:34 +0100
Subject: [PATCH 3/5] Remove lldb fallback

---
 .../expression_address.cpp                    |  3 ---
 cross-project-tests/lit.cfg.py                | 20 +++----------------
 2 files changed, 3 insertions(+), 20 deletions(-)

diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_declare_address/expression_address.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_declare_address/expression_address.cpp
index 5335fdd6445f6..0f4463338bba6 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_declare_address/expression_address.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/perfect/dex_declare_address/expression_address.cpp
@@ -2,9 +2,6 @@
 //      Test that a \DexDeclareAddress value can be used to compare the
 //      addresses of two local variables that refer to the same address.
 //
-// NB: This test passes with `--debugger lldb-dap` but fails with --debugger lldb
-// XFAIL: !system-windows && !lldb-dap
-//
 // RUN: %dexter_regression_test_cxx_build %s -o %t
 // RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
 // CHECK: expression_address.cpp
diff --git a/cross-project-tests/lit.cfg.py b/cross-project-tests/lit.cfg.py
index 7fa7d2b9220a6..10265925a26e6 100644
--- a/cross-project-tests/lit.cfg.py
+++ b/cross-project-tests/lit.cfg.py
@@ -102,17 +102,9 @@ def get_required_attr(config, attr_name):
     config.available_features.add("compiler-rt")
 
 # Check which debuggers are available:
-lldb_path = llvm_config.use_llvm_tool("lldb", search_env="LLDB")
 lldb_dap_path = llvm_config.use_llvm_tool("lldb-dap")
-
-# We prefer to use lldb-dap if possible, but we assume that there will never be a case where lldb-dap is available and
-# lldb isn't, so use the existence of lldb as the lowest common denominator.
-if lldb_path is not None:
-    config.available_features.add("lldb")
-# There are some small niche differences in the output between lldb and lldb-dap, so we add this feature as a way to
-# disable the tests that will fail if we fall back to lldb.
 if lldb_dap_path is not None:
-    config.available_features.add("lldb-dap")
+    config.available_features.add("lldb")
 
 if llvm_config.use_llvm_tool("llvm-ar"):
     config.available_features.add("llvm-ar")
@@ -127,8 +119,6 @@ def configure_dexter_substitutions():
     tools.append(ToolSubst("%dexter", f'"{sys.executable}" "{dexter_path}" test'))
     if lldb_dap_path is not None:
         tools.append(ToolSubst("%dexter_lldb_args", f'--lldb-executable "{lldb_dap_path}" --debugger lldb-dap'))
-    elif lldb_path is not None:
-        tools.append(ToolSubst("%dexter_lldb_args", f'--lldb-executable "{lldb_path}" --debugger lldb'))
 
     # For testing other bits of dexter that aren't under the "test" subcommand,
     # have a %dexter_base substitution.
@@ -152,12 +142,8 @@ def configure_dexter_substitutions():
         dependencies = ["clang", "lldb"]
         dexter_regression_test_c_builder = "clang"
         dexter_regression_test_cxx_builder = "clang++"
-        if lldb_dap_path is not None:
-            dexter_regression_test_debugger = "lldb-dap"
-            dexter_regression_test_additional_flags = f'--lldb-executable "{lldb_dap_path}"'
-        else:
-            dexter_regression_test_debugger = "lldb"
-            dexter_regression_test_additional_flags = f'--lldb-executable "{lldb_path}"'
+        dexter_regression_test_debugger = "lldb-dap"
+        dexter_regression_test_additional_flags = f'--lldb-executable "{lldb_dap_path}"'
         dexter_regression_test_c_flags = "-O0 -glldb -std=gnu11"
         dexter_regression_test_cxx_flags = "-O0 -glldb -std=gnu++11"
 

>From 74f5725341f8c2c83b83dc49a89c63ecd974c4f2 Mon Sep 17 00:00:00 2001
From: Stephen Tozer <stephen.tozer at sony.com>
Date: Thu, 28 Aug 2025 16:14:15 +0100
Subject: [PATCH 4/5] Fix newly-offset line numbers

---
 .../dexter/feature_tests/subtools/test/err_paren.cpp            | 2 +-
 .../dexter/feature_tests/subtools/test/err_paren_mline.cpp      | 2 +-
 .../dexter/feature_tests/subtools/test/err_syntax.cpp           | 2 +-
 .../dexter/feature_tests/subtools/test/err_syntax_mline.cpp     | 2 +-
 .../dexter/feature_tests/subtools/test/err_type.cpp             | 2 +-
 .../dexter/feature_tests/subtools/test/err_type_mline.cpp       | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren.cpp
index e986831ac79ce..e80b34da24ac4 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren.cpp
@@ -8,7 +8,7 @@
 // RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args \
 // RUN:     -v -- %s | FileCheck %s --match-full-lines --strict-whitespace
 //
-// CHECK:parser error:{{.*}}err_paren.cpp(22): Unbalanced parenthesis starting here
+// CHECK:parser error:{{.*}}err_paren.cpp(19): Unbalanced parenthesis starting here
 // CHECK:// {{Dex}}ExpectWatchValue(
 // CHECK:                      ^
 
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren_mline.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren_mline.cpp
index f9d705fd97c49..8d5a9b0575996 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren_mline.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_paren_mline.cpp
@@ -8,7 +8,7 @@
 // RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args \
 // RUN:     -v -- %s | FileCheck %s --match-full-lines --strict-whitespace
 //
-// CHECK:parser error:{{.*}}err_paren_mline.cpp(23): Unbalanced parenthesis starting here
+// CHECK:parser error:{{.*}}err_paren_mline.cpp(20): Unbalanced parenthesis starting here
 // CHECK:{{Dex}}ExpectWatchValue(
 // CHECK:                   ^
 
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax.cpp
index f26b392a588c5..7e019df26e9bd 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax.cpp
@@ -8,7 +8,7 @@
 // RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args \
 // RUN:     -v -- %s | FileCheck %s --match-full-lines --strict-whitespace
 //
-// CHECK:parser error:{{.*}}err_syntax.cpp(21): invalid syntax
+// CHECK:parser error:{{.*}}err_syntax.cpp(18): invalid syntax
 // CHECK:// {{Dex}}ExpectWatchValue(,'a', 3, 3, 3, 3, on_line=0)
 // CHECK:                       ^
 
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_mline.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_mline.cpp
index 793721edb3df6..342f2a53010ec 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_mline.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_syntax_mline.cpp
@@ -8,7 +8,7 @@
 // RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args \
 // RUN:     -v -- %s | FileCheck %s --match-full-lines --strict-whitespace
 //
-// CHECK:parser error:{{.*}}err_syntax_mline.cpp(24): invalid syntax
+// CHECK:parser error:{{.*}}err_syntax_mline.cpp(21): invalid syntax
 // CHECK:    ,'a', 3, 3, 3, 3, on_line=0)
 // CHECK:    ^
 
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type.cpp
index 3a4512ee0f03c..2865304101939 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type.cpp
@@ -8,7 +8,7 @@
 // RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args \
 // RUN:     -v -- %s | FileCheck %s --match-full-lines --strict-whitespace
 //
-// CHECK:parser error:{{.*}}err_type.cpp(21): expected at least two args
+// CHECK:parser error:{{.*}}err_type.cpp(18): expected at least two args
 // CHECK:// {{Dex}}ExpectWatchValue()
 // CHECK:                      ^
 
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type_mline.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type_mline.cpp
index e0a43e88c3cff..1062d2816b397 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type_mline.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/test/err_type_mline.cpp
@@ -8,7 +8,7 @@
 // RUN: not %dexter_base test --binary %t %dexter_regression_test_debugger_args \
 // RUN:     -v -- %s | FileCheck %s --match-full-lines --strict-whitespace
 //
-// CHECK:parser error:{{.*}}err_type_mline.cpp(22): expected at least two args
+// CHECK:parser error:{{.*}}err_type_mline.cpp(19): expected at least two args
 // CHECK:{{Dex}}ExpectWatchValue(
 // CHECK:                   ^
 

>From 9cdd31942dcae5bf0effc4d1d5ab5ecac1a65afb Mon Sep 17 00:00:00 2001
From: Stephen Tozer <stephen.tozer at sony.com>
Date: Fri, 29 Aug 2025 12:34:29 +0100
Subject: [PATCH 5/5] darker

---
 cross-project-tests/lit.cfg.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/cross-project-tests/lit.cfg.py b/cross-project-tests/lit.cfg.py
index 10265925a26e6..b783f6639c933 100644
--- a/cross-project-tests/lit.cfg.py
+++ b/cross-project-tests/lit.cfg.py
@@ -118,7 +118,12 @@ def configure_dexter_substitutions():
     )
     tools.append(ToolSubst("%dexter", f'"{sys.executable}" "{dexter_path}" test'))
     if lldb_dap_path is not None:
-        tools.append(ToolSubst("%dexter_lldb_args", f'--lldb-executable "{lldb_dap_path}" --debugger lldb-dap'))
+        tools.append(
+            ToolSubst(
+                "%dexter_lldb_args",
+                f'--lldb-executable "{lldb_dap_path}" --debugger lldb-dap',
+            )
+        )
 
     # For testing other bits of dexter that aren't under the "test" subcommand,
     # have a %dexter_base substitution.
@@ -148,7 +153,10 @@ def configure_dexter_substitutions():
         dexter_regression_test_cxx_flags = "-O0 -glldb -std=gnu++11"
 
     tools.append(
-        ToolSubst("%dexter_regression_test_debugger_args", f"--debugger {dexter_regression_test_debugger} {dexter_regression_test_additional_flags}")
+        ToolSubst(
+            "%dexter_regression_test_debugger_args",
+            f"--debugger {dexter_regression_test_debugger} {dexter_regression_test_additional_flags}",
+        )
     )
 
     # Typical command would take the form:



More information about the llvm-commits mailing list