[all-commits] [llvm/llvm-project] 0e0b50: [lldb-dap] Take two at refactoring the startup seq...

John Harrison via All-commits all-commits at lists.llvm.org
Fri May 16 19:28:56 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0e0b501bf53677105b539fa4f84cbfb76c46f74d
      https://github.com/llvm/llvm-project/commit/0e0b501bf53677105b539fa4f84cbfb76c46f74d
  Author: John Harrison <harjohn at google.com>
  Date:   2025-05-16 (Fri, 16 May 2025)

  Changed paths:
    M lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
    M lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
    M lldb/test/API/tools/lldb-dap/breakpoint-events/TestDAP_breakpointEvents.py
    M lldb/test/API/tools/lldb-dap/cancel/TestDAP_cancel.py
    M lldb/test/API/tools/lldb-dap/completions/TestDAP_completions.py
    M lldb/test/API/tools/lldb-dap/console/TestDAP_console.py
    M lldb/test/API/tools/lldb-dap/console/TestDAP_redirection_to_console.py
    M lldb/test/API/tools/lldb-dap/coreFile/TestDAP_coreFile.py
    M lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py
    M lldb/test/API/tools/lldb-dap/launch/TestDAP_launch.py
    M lldb/test/API/tools/lldb-dap/module-event/TestDAP_module_event.py
    M lldb/test/API/tools/lldb-dap/module/TestDAP_module.py
    M lldb/test/API/tools/lldb-dap/repl-mode/TestDAP_repl_mode_detection.py
    M lldb/test/API/tools/lldb-dap/restart/TestDAP_restart.py
    M lldb/test/API/tools/lldb-dap/send-event/TestDAP_sendEvent.py
    M lldb/test/API/tools/lldb-dap/stackTrace/TestDAP_stackTrace.py
    M lldb/test/API/tools/lldb-dap/stackTraceDisassemblyDisplay/TestDAP_stackTraceDisassemblyDisplay.py
    M lldb/test/API/tools/lldb-dap/startDebugging/TestDAP_startDebugging.py
    M lldb/test/API/tools/lldb-dap/stop-hooks/TestDAP_stop_hooks.py
    M lldb/test/API/tools/lldb-dap/threads/TestDAP_threads.py
    M lldb/test/API/tools/lldb-dap/variables/children/TestDAP_variables_children.py
    M lldb/tools/lldb-dap/DAP.cpp
    M lldb/tools/lldb-dap/DAP.h
    M lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp
    M lldb/tools/lldb-dap/Handler/ConfigurationDoneRequestHandler.cpp
    M lldb/tools/lldb-dap/Handler/InitializeRequestHandler.cpp
    M lldb/tools/lldb-dap/Handler/LaunchRequestHandler.cpp
    M lldb/tools/lldb-dap/Handler/RequestHandler.h
    M lldb/tools/lldb-dap/Protocol/ProtocolBase.h
    M lldb/tools/lldb-dap/Protocol/ProtocolRequests.h

  Log Message:
  -----------
  [lldb-dap] Take two at refactoring the startup sequence. (#140331)

This is more straight forward refactor of the startup sequence that
reverts parts of ba29e60f9a2222bd5e883579bb78db13fc5a7588. Unlike my
previous attempt, I ended up removing the pending request queue and not
including an `AsyncReqeustHandler` because I don't think we actually
need that at the moment.

The key is that during the startup flow there are 2 parallel operations
happening in the DAP that have different triggers.

* The `initialize` request is sent and once the response is received the
`launch` or `attach` is sent.
* When the `initialized` event is recieved the `setBreakpionts` and
other config requests are made followed by the `configurationDone`
event.

I moved the `initialized` event back to happen in the `PostRun` of the
`launch` or `attach` request handlers. This ensures that we have a valid
target by the time the configuration calls are made. I added also added
a few extra validations that to the `configurationeDone` handler to
ensure we're in an expected state.

I've also fixed up the tests to match the new flow. With the other
additional test fixes in 087a5d2ec7897cd99d3787820711fec76a8e1792 I
think we've narrowed down the main source of test instability that
motivated the startup sequence change.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list