Giter Club home page Giter Club logo

Comments (5)

gregg-miskelly avatar gregg-miskelly commented on May 21, 2024

What is the advantage of having this in the debug protocol as opposed to just opaque output sent as an OutputEvent in response to an evaluation?

from debug-adapter-protocol.

zjturner avatar zjturner commented on May 21, 2024

One possible use case would be if you wanted to implement a type information browser in your debugger client that the user could interact with in a similar way as (for example) the Class Browser in Visual Studio. You would not want such a user interface to simply request all type information though because it would be a huge amount of data sent over the wire. So instead, the user might be able to enter a type name, or part of a type name, and then have some kind of tree view built up which the user could explore.

To come up with more examples, I think I need to understand exactly what you mean by "in response to an evaluation" though. Do you mean "in response to an Evaluate request?" Because I was under the impression that that request was reserved for evaluating expressions in the context of a stack frame. So you might get an evaluate request for something like (foo[0]->*pfn)(42) but not for some arbitrary debugger command like dt MyType. Am I mistaken here? I guess it could be possible for an adapter to implement this with an extension syntax like !!myadapter!!dt MyType and the adapter could handle this specially. That seems like not the intended use case for the Evaluate request though, so I'm not sure if it's what what you had in mind.

from debug-adapter-protocol.

gregg-miskelly avatar gregg-miskelly commented on May 21, 2024

You could think of the debug console in VS Code or the immediate window in VS as a window that accepts a line of text from the user and evaluates it. Certainly normally this would be some sort of expression in the context of the current stack frame, but the UI doesn't understand this, so you could certainly also accept commands. The VS Code C++ debugger for example accepts arbitrary GDB commands this way. You could certainly imagine doing this with windbg as that is exactly how the windbg command window works.

from debug-adapter-protocol.

zjturner avatar zjturner commented on May 21, 2024

I guess the only other thing I can think of is that it could help to implement a visualizer language in your debugger client if the debugger client had type information. Otherwise, it becomes the responsibility of the debug adapter to provide visualizers, which means that users will get a different experience for every debug adapter they try to use, rather than having 1 visualizer syntax that just works regardless of debug adapter.

from debug-adapter-protocol.

weinand avatar weinand commented on May 21, 2024

A fundamental principle of the debug adapter protocol (DAP) is to only support "strings for rendering" a debugger UI.
DAP was not designed for extracting fine-grained type information about the runtime representation of the program to be debugged.

So if you want to convey type information via DAP you can extend the protocol privately and use it between your client and your debug adapter. But we will not make this type information protocol official part of DAP.

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.