# DAP Server

The DebuggerDapServerPlugin provides a very simple adapter allowing access to the Ghidra debugger by standard DAP clients. The plugin provides two actions, Start server and Stop server, and two options, IP Address and Port. The server will remain running until the stop command is issued. Ghidra debugger agents may launch and kill sessions without restarting the server, and DAP clients may connect, disconnect, and reconnect. Running multiple sessions simultaneously has not been tested extensively and requires, at a minimum, changing port values.

# DAP Clients

Exact configuration and use of the DAP client will be largely client-dependent, particularly with regard to supported commands. Attach and launch are again largely untested, as the server assumes an active agent session. As a starting example, the DAP server may be accessed from `VSCode` by writing a `config.yaml` file, and pointing a new or existing debuggger configuration at it. For example, pointing `"Python Debugger: Remote Attach"` to the following `config.yaml` will allow F5 to establish a local connection to a DAP server running at port `54321`:

-     {
          "version": "0.2.0",
          "configurations": [
              {
                  "name": "Python Debugger: Remote Attach",
                  "type": "debugpy",
                  "request": "attach",
                  "connect": {
                      "host": "localhost",
                      "port": 54321
                  },
                  "pathMappings": [
                      {
                          "localRoot": "${workspaceFolder}",
                          "remoteRoot": "."
                      }
                  ]
              }
          ]
      }