Skip to content
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

Passing custom arguments while debugging via dap #440

Closed
csyJoy opened this issue Jan 28, 2023 · 5 comments
Closed

Passing custom arguments while debugging via dap #440

csyJoy opened this issue Jan 28, 2023 · 5 comments
Labels
complexity:low Low-risk, unlikely to cause distant/indirect damage dap Debug Adapter related issues enhancement New feature or request

Comments

@csyJoy
Copy link
Contributor

csyJoy commented Jan 28, 2023

Feature description

well,I find out that our dap configuration is lack of passing custom arguments ability when I'm debugging some c++ programs that require the user to enter their own arguments. thus I wonder whether we should change the dap configuration to support custom arguments, or just let users do it themselves?

Additional information

No response

@csyJoy csyJoy added the enhancement New feature or request label Jan 28, 2023
@Jint-lzxy
Copy link
Collaborator

You mean to accept command line arguments or stdin (user input)?

Command line arguments can be passed in through preRunCommands = {'settings set -- target.run-args "<your>" "<args>"'}, just add a query function to read and separate the arguments. If this is what you request, I will add this feature later. (After #394)

btw, as different debuggers have their own initialization methods, it is impossible to make a feature available on all debuggers at the same time. The best way is to read the documentation of a debugger and add the corresponding options in the configuration.

If you mean redirecting user input, the best way I can think of now is to redirect stdin to a file. I will look into this issue later.

@Jint-lzxy Jint-lzxy added question Further information is requested complexity:low Low-risk, unlikely to cause distant/indirect damage dap Debug Adapter related issues labels Jan 28, 2023
@Jint-lzxy
Copy link
Collaborator

(preRunCommands = {'settings set -- target.input-path <file>'})

@csyJoy
Copy link
Contributor Author

csyJoy commented Jan 28, 2023

You mean to accept command line arguments or stdin (user input)?

Command line arguments can be passed in through preRunCommands = {'settings set -- target.run-args "<your>" "<args>"'}, just add a query function to read and separate the arguments. If this is what you request, I will add this feature later. (After #394)

btw, as different debuggers have their own initialization methods, it is impossible to make a feature available on all debuggers at the same time. The best way is to read the documentation of a debugger and add the corresponding options in the configuration.

If you mean redirecting user input, the best way I can think of now is to redirect stdin to a file. I will look into this issue later.

sorry for my vague expression, actually I mean user input, I've read the dap document and found the arg field can pass user inputs while launching dap, it works good for me.

I think your comment to this issue is right, It's better to let users config themselves, should I close this issue?

@Jint-lzxy
Copy link
Collaborator

sorry for my vague expression, actually I mean user input, I've read the dap document and found the arg field can pass user inputs while launching dap, it works good for me.

hmm my interpretation of the issue is to allow users to input interactively during a debugging session.. But if this works for you, you may close this issue at any time 👍

@Jint-lzxy Jint-lzxy removed the question Further information is requested label Jan 28, 2023
@Jint-lzxy
Copy link
Collaborator

IMO there are many options available, and we should leave the choices to users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity:low Low-risk, unlikely to cause distant/indirect damage dap Debug Adapter related issues enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants