microsoft / microsoft/java-debug

SetBreakpointsRequestHandler fails when supplied path is using forward slashes

Aperta
#318 3 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@testforstephen ci sta già lavorando.

Dal 7/2/2020.

ai-triaged bug enhancement
Lingua principale
Java
Stelle
409
Fork
204
Merge medio
1g 13h
PR unite (30g)
4

Descrizione

Description
When a DAP (debug adapter protocol) client sends a setBreakpoints request with a path that contains forward slashes the breakpoint is not set.
The server also (wrongfully?) reports back that the command was executed successfully.

Observed behavior
The code runs without halting at the breakpoint.

Expected behavior
The program should halt at the breakpoint and send a breakpoint event to the DAP client.

Logging with forward slashes (Not working)

Sending: 
{
  "command": "setBreakpoints",
  "arguments": {
    "source": {
      "name": "Hello.java",
      "path": "c:/project/src/main/java/Hello.java"
    },
    "breakpoints": [
      {
        "line": 6
      }
    ],
    "sourceModified": false,
    "lines": [
      6
    ]
  },
  "type": "request",
  "seq": 3
}

Received:
{
  "type": "response",
  "seq": 4,
  "body": {
    "breakpoints": [
      {
        "message": "",
        "line": 6,
        "verified": null,
        "id": 1
      }
    ]
  },
  "command": "setBreakpoints",
  "request_seq": 3,
  "success": true
}

Logging with backward slashes (Working)

Sending: 
{
  "command": "setBreakpoints",
  "arguments": {
    "source": {
      "name": "Hello.java",
      "path": "c:\project\src\main\java\Hello.java"
    },
    "breakpoints": [
      {
        "line": 6
      }
    ],
    "sourceModified": false,
    "lines": [
      6
    ]
  },
  "type": "request",
  "seq": 3
}

Received:
{
  "type": "response",
  "seq": 4,
  "body": {
    "breakpoints": [
      {
        "message": "",
        "line": 6,
        "verified": true,
        "id": 1
      }
    ]
  },
  "command": "setBreakpoints",
  "request_seq": 3,
  "success": true
}

Suggestion
I think the "offending" code is here
This line behaves differently depending if forward or backward slashes have been used.
Maybe replace all forward slashes with backward slashes if we are on windows.
Could be implemented before/after the drive letter fix.

System
Windows 10
DAP Client: emacs with lsp-mode/dap-mode
DAP Server: jdtls (Eclipse language server)

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.