Code Monkey home page Code Monkey logo

Comments (8)

connor4312 avatar connor4312 commented on June 3, 2024

There's no "disabled" state in DAP. In VS Code, a disabled breakpoint is simply not sent to the debugger.

from debug-adapter-protocol.

demin-han avatar demin-han commented on June 3, 2024

There's no "disabled" state in DAP. In VS Code, a disabled breakpoint is simply not sent to the debugger.

it is OK from editor to debugger. what about from debugger to editor?
if I disabled breakpoints through debug console, the breakpoint's status would be inconsistent.
In debugger side, the breakpoint is disabled, but in VS Code side, the breakpoint is still enabled.
The breakpoint changed event seems not work for this, because of no "disabled" state in breakpoint response.

from debug-adapter-protocol.

connor4312 avatar connor4312 commented on June 3, 2024

That's correct, the debug adapter does not control the breakpoint enablement state. If it fails to set a breakpoint, it can signal that by marking it as unverified with a message. But the adapter is driven by the client, not the other way around.

Is there a use case you have in mind where having the DA disable a breakpoint would be useful?

from debug-adapter-protocol.

demin-han avatar demin-han commented on June 3, 2024

As I know the unverified status is for pending.
I think it's a common case(or debug workflow) for users who like use debug console.

Could this be improved in future dap version?
1 Add "disabled" field or
2 Reuse "reason" field ?

from debug-adapter-protocol.

connor4312 avatar connor4312 commented on June 3, 2024

That sounds like something that clients should implement in their "debug console"s rather than in DAP.

from debug-adapter-protocol.

demin-han avatar demin-han commented on June 3, 2024

when I input CMD in debug console, it's a "evaluate" REQ, I think the client don't understand these CMD.
Current breakpoint definition of DAP can't tell or distinguish the disable of breakpoint , the client receives the change event, but don't know the reason which is breakpoint disable.

from debug-adapter-protocol.

connor4312 avatar connor4312 commented on June 3, 2024

That is up to the client. There's no requirement in the protocol that a debug console exists or how it should behave.

There is no notion of disabled breakpoints in DAP. And I would not implement it the way you describe e.g. in VS Code, because it would not play nice if there were multiple concurrent debug sessions happening at the same time: a UI breakpoint is not owned by a debug adapter.

It sounds like the way to do what you want would just be to set verified: false with some message like "Disabled by the user" or something along those lines.

from debug-adapter-protocol.

demin-han avatar demin-han commented on June 3, 2024

It sounds like the way to do what you want would just be to set verified: false with some message like "Disabled by the user" or something along those lines.

Yes, something like this. Currently, just set "verified: false" the checkbox is still checked in VS code UI.
The "verified" field is set just according to breakpoint pending status for several gdb adapter .
If the "message" or "reason" field are not defined formally, how different dap clients to parse the meaning of message ?

/**

  • A message about the state of the breakpoint.
  • This is shown to the user and can be used to explain why a breakpoint could
  • not be verified.
    */
    message?: string;

/**

  • A machine-readable explanation of why a breakpoint may not be verified. If
  • a breakpoint is verified or a specific reason is not known, the adapter
  • should omit this property. Possible values include:
    • pending: Indicates a breakpoint might be verified in the future, but
  • the adapter cannot verify it in the current state.
    • failed: Indicates a breakpoint was not able to be verified, and the
  • adapter does not believe it can be verified without intervention.
  • Values: 'pending', 'failed'
    */
    reason?: 'pending' | 'failed';

from debug-adapter-protocol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.