-
Notifications
You must be signed in to change notification settings - Fork 765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
debug: allow to pass custom commands to debugger #592
Comments
@msaf1980 We hear you, and the issue100 and so on mention the possibility of extending the Debug Console beyond the basic expression evaluation. We decided to start with support for only Some subset of settings configurable with the FYI here is some configuration knobs corresponding to An alternative approach I can think of is to utilize the |
@msaf1980 To adjust max string length, you can set In general, we are limited by what functionality we can provide by the Debug Adapter Protocol. Typing commands in the Debug Console triggers an EvaluateRequest, whose return value is an anonymous variable. It is not designed to support commands with arbitrary return values. We would have to hack those into a fake string variable to display the results as a flat string and you would not get any of the interactive UI features. Also, delve backend does not have an API to accept text commands. So to pass those over to Delve we would either need to reimplement its command-line client in vscode or convince Delve devs to add a text interface, which is unlikely. |
@hyangah +1 to having a parallel CLI client. I think this will give us the best of both worlds. |
If we allow setting config options via Debug Console, we would also need a way to print their values.
|
@polinasok , in VS code C/C++ debugging. To pass a command to gdb, in debugger console, you can run "-exec command" to pass any (entire) gdb command to gdb. Can VS code go do sth similar? Thanks |
My vote is for examinemem. My current workaround is to add a hex dump to the code, recompile, and run again, which can get cumbersome. |
@kgflying
Dlv has a split client/server architecture. There is the server backend (what you run with dlv --headless). And then there are different frontend clients that you can connect to it. Vscode is one such client. Dlv terminal is another one. The commands that you are familiar with are supported by the dlv terminal client. It doesn't run when vscode client connects to a headless dlv backend. The server backend uses a different API. Abstraction- and effort-wise there is not a clearcut way to move the text command parsing logic into the backend. But we are keeping this option on the backburner (hence the still open satus of this issue). At the same time, graphical clients like vscode and the underlying Debug Adapter Protocol have rich UIs, and should be able to support many equivalent features that dlv cli supports natively and with additional interactive features. We are currently migrating to a new dlv-dap adapter. It is part of the delve codebase and is written in Go, so addition of any new features should be easier in the future. We are open to feedback and community PRs. |
Does ReadMemoryRequest sound like a proper equivalent? Upvote client-side support here. |
Update on the status of using dlv text commands. The legacy adapter (enabled with
This opens the door to additional configuration settings ( This does not offer a way to update In addition, we have updated the headless dlv server to accept either legacy JSON-RPC clients or DAP clients. So if you really need access to the entire dlv's command-line, you can use an external headless server with I am going to close this issue since the original request has been addressed and there is now a workaround for |
Delve debugger has some commands, that not realized in interface.
Like
config max-string-len
for display large string and etc.May be add a way to interact with debugger and pass commands ?
The text was updated successfully, but these errors were encountered: