[all-commits] [llvm/llvm-project] bb2642: [vscode-lldb] Fix race condition when changing lld...

royitaqi via All-commits all-commits at lists.llvm.org
Wed Aug 6 10:24:30 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bb2642fab70fb4d59e431e01e319dcf6b90d88d8
      https://github.com/llvm/llvm-project/commit/bb2642fab70fb4d59e431e01e319dcf6b90d88d8
  Author: royitaqi <royitaqi at users.noreply.github.com>
  Date:   2025-08-06 (Wed, 06 Aug 2025)

  Changed paths:
    M lldb/tools/lldb-dap/src-ts/lldb-dap-server.ts

  Log Message:
  -----------
  [vscode-lldb] Fix race condition when changing lldb-dap arguments (#151828)

# Problem

When the user changes lldb-dap's arguments (e.g. path), there is a race
condition, where the new lldb-dap process could be started first and
have set the extension's `serverProcess` and `serverInfo` according to
the new process, while the old lldb-dap process exits later and wipes
out these two fields.

Consequences:
1. This causes `getServerProcess()` to return `undefined` when it should
return the new process.
2. This also causes wrong behavior when starting the next debug session
that a new lldb-dap process will be started and the old not reused nor
killed.

# Fix

When wiping the two fields, check if `serverProcess` equals to the
process captured by the handler. If they equal, wipe the fields. If not,
then the fields have already been updated (either new process has
started, or the fields were already wiped out by another handler), and
so the wiping should be skipped.



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