Files
llvm/cross-project-tests/debuginfo-tests
Stephen Tozer 5446eb9275 [Dexter] Adjust launch sequencing to align closer with DAP spec (#170523)
Following PR #169744 the DAP launch sequencing of Dexter was changed to
complete a launch request/response before performing configuration
steps. This matches LLDB's current behaviour, but is not compatible with
the DAP specification and causes issues interfacing with other
debuggers.

This patch tries to bridge the gap by using a sequencing that is mostly
DAP-compliant while still interfacing correctly with lldb-dap: we send a
launch request first, then perform all configuration steps and send
configurationDone, and then await the launch response. For lldb-dap, we
do not wait for the launch response and may send configuration requests
before it is received, but lldb-dap appears to handle this without
issue. For other debug adapters, the launch request will be ignored
until the configurationDone request is received and responded to, at
which point the launch request will be acted upon and responded to.

As an additional note, the initialized event should be sent after the
initialize response and before the launch request according to the spec,
but as LLDB currently sends it after the launch response Dexter has
avoided checking for it. Since the initialized event is now being sent
after the launch response by LLDB, we can start checking for it earlier
in the sequence as well (though technically the client should receive
the initialized event before it sends the launch request).
2025-12-09 11:32:09 +00:00
..

                                                                   -*- rst -*-
This is a collection of tests to check debugging information generated by 
compiler. This test suite can be checked out inside clang/test folder. This 
will enable 'make test' for clang to pick up these tests.

Some tests (in the 'llgdb-tests' directory) are written with debugger
commands and checks for the intended debugger output in the source file,
using DEBUGGER: and CHECK: as prefixes respectively.

For example::

  define i32 @f1(i32 %i) nounwind ssp {
  ; DEBUGGER: break f1
  ; DEBUGGER: r
  ; DEBUGGER: p i 
  ; CHECK: $1 = 42 
  entry:
  }

is a testcase where the debugger is asked to break at function 'f1' and 
print value of argument 'i'. The expected value of 'i' is 42 in this case.

Other tests are written for use with the 'Dexter' tool (in the 'dexter-tests'
and 'dexter' directories respectively). These use a domain specific language
in comments to describe the intended debugger experience in a more abstract
way than debugger commands. This allows for testing integration across
multiple debuggers from one input language.

For example::

  void __attribute__((noinline, optnone)) bar(int *test) {}
  int main() {
    int test;
    test = 23;
    bar(&test); // DexLabel('before_bar')
    return test; // DexLabel('after_bar')
  }

  // DexExpectWatchValue('test', '23', on_line='before_bar')
  // DexExpectWatchValue('test', '23', on_line='after_bar')

Labels two lines with the names 'before_bar' and 'after_bar', and records that
the 'test' variable is expected to have the value 23 on both of them.