GithubHelp home page GithubHelp logo

Comments (5)

colin-grant-work avatar colin-grant-work commented on July 29, 2024

I believe this would be a very desirable enhancement. It does not seem very logical to allow a different set of breakpoint types to be created from the frontend than those whose creation can be sent as an event from the adapter.

from debug-adapter-protocol.

puremourning avatar puremourning commented on July 29, 2024

the response to setFunctionBreakpoints is an array of Breakpoints, not an array of "function breakpoints". i.e. the server always tells the client explicit source/ine for the "resolved" breakpoints.

I think the point is that the DA resolves the function bp into a line bp as that's what it will actually break on (typically?), no? and the client can then render a marker on the source line where the 'Function' breakpoint resolved to.

from debug-adapter-protocol.

colin-grant-work avatar colin-grant-work commented on July 29, 2024

How the debugger or the adapter resolves a breakpoint is entirely an internal matter, and it's certainly not the case that every breakpoint will always be resolved to a source breakpoint. For one thing, it's possible to debug a binary for which no source information is available. And if symbol information is available but not source information, then it might be possible to set a breakpoint that can be resolved as an instruction breakpoint but can't be resolved as a source breakpoint at all. If everything could really be reduced to a source breakpoint, then there wouldn't be any point in adding the other breakpoint varieties to the protocol at all - we could just always expect users to find the right place in source to put one. More realistically, all breakpoints boil down to instruction breakpoints, but we certainly wouldn't want to make users input them as such, and we wouldn't want to present them as such, either.

Beyond the theoretical issue, there's also an issue of presentation. Suppose a function breakpoint is added by a user in the debugger directly (by typing in a GDB terminal, say). Since function breakpoints are supported by GDB natively, the user would expect to see a function breakpoint in the UI, but the current protocol forces the adapter to transform it in the breakpoint event, creating a mismatch on a quite practical level, even if the source can be resolved.

from debug-adapter-protocol.

puremourning avatar puremourning commented on July 29, 2024

Sure, my point was that the response to setFunctionBreakpoints may need to change, in the sense that it might be a simpler API change to add metadata to the Breakpoint object.

from debug-adapter-protocol.

colin-grant-work avatar colin-grant-work commented on July 29, 2024

Yes, I agree with that. I think it's odd that the breakpoint variants don't extend a core Breakpoint interface, but are just declared separately - it's backed the protocol into a corner on this point, a bit.

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.