Skip to content

ManManson/so-latch

Repository files navigation

SoLatch

SoLatch is a VSCode debugging extension that attaches to unstarted processes. It watches running processes for a command-line pattern and starts a CodeLLDB attach session when a match appears.

Main Features

  • Wait for a future process without racing the launch or adding temporary sleep calls just to attach the debugger.
  • Match target processes by regular expression against their command line.
  • Start monitoring either from the Command Palette or from a reusable debug configuration.
  • Reuse recent process patterns when attaching from the Command Palette.
  • Cancel the wait from the VS Code progress notification or debug toolbar.

CodeLLDB Dependency

SoLatch delegates the real debugging session to CodeLLDB, published as vadimcn.vscode-lldb.

Because of that, supported languages, platforms, debugger features, and attach behavior come from CodeLLDB. SoLatch only adds the waiting layer before the CodeLLDB attach session starts.

Wait From The Command Palette

Use this mode when you want to attach once without creating a launch configuration.

  1. Open the VS Code Command Palette.
  2. Run SoLatch: Attach to Unstarted Process.
  3. Select a recent process pattern or choose Enter new process pattern.
  4. Enter a regular expression that matches the target process command line.
  5. Start the target process.

SoLatch shows a cancellable progress notification while it waits. When a matching process starts, SoLatch launches a CodeLLDB attach session for that process.

Wait From A Debug Configuration

Use this mode when the same process pattern should be part of your normal Run and Debug workflow.

Add a so-latch attach configuration to .vscode/launch.json:

{
  "type": "so-latch",
  "request": "attach",
  "name": "SoLatch: Attach to Server",
  "processPattern": "my-server(\\s|$)",
  "haltOnAttach": false,
  "ignoreCommonJvmSignals": false
}

Run the configuration from VS Code as usual. VS Code starts an inline SoLatch facade debug session first. That session waits until a process matches processPattern, then starts the real CodeLLDB attach session and forwards control to it. Stopping the facade session cancels the wait.

Extension-specific fields:

  • processPattern: regular expression matched against each process command line.
  • haltOnAttach: when true, asks CodeLLDB to stop the process immediately after attaching.
  • ignoreCommonJvmSignals: when true, configures CodeLLDB to ignore common JVM signals such as SIGSEGV, SIGBUS; useful when attaching to JVM-based applications.

Examples

The scripts directory includes createTestRustProcess.sh, which compiles and starts a small Rust process named test_rust_process you can use to check that SoLatch properly detects and attaches to a new process.

Troubleshooting

The extension comes with a soLatch.logging.level configuration option, which you may need to adjust while investigating problems related to the extension itself. Supported values are debug, info, warning, and error (the default is info).

License

SoLatch is licensed under the MIT License. See LICENSE for details.

About

VSCode extension that provides functionality similar to IntelliJ IDEA’s “Attach to an Unstarted Process” command.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors