-
Notifications
You must be signed in to change notification settings - Fork 186
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
How to run an executable with command line options? #88
Comments
Take a look at https://github.com/WebFreak001/code-debug/blob/master/package.json#L72 . It lists all arguments that you can pass to the debug adapter. Then in dap-mode you could do |
Thanks for the tip. I was able to edit the configuration and have the executable run. However now it just runs to completion without giving me a chance to set breakpoints. Is there a way to load the executable without immediately running it? |
You should be able to place the breakpoints before starting the program or you are asking something else? AFAIK native debug have some limitations, you may read about them in its readme. |
I am trying to place breakpoints before starting the program. I run dap-debug and select my template and then the program executes and runs to completion. When in the process would I set the breakpoints? Do you recommend I follow the instructions for LLDB here: https://github.com/emacs-lsp/dap-mode#lldb instead of the native debug solution? |
You could do dap-breakpoint-toggle/add/remove or click in the fringe before starting the application. AFAIK Native debug has this limitation: "Adding breakpoints while the program runs will not interrupt it immediately. For that you need to pause & resume the program once first. However adding breakpoints while its paused works as expected." And also it does work with multiple threads.
IMO in the long term, it will be the prefered solution since that debug adapter is implemented by lldb team. There is one more debug adapter for lldb which I think will work much better ATM but we do not have integration with it: https://github.com/vadimcn/vscode-lldb . But like I mentioned I am not using this debug adapter and I cannot tell for sure. |
I can't understand these instructions. Does this mean that in the template I'm editing, if I wanted to change the To be extremely specific: I need to launch I've tried (dap-debug (list :type "gdb"
:request "launch"
:name "gdb-multiarch"
:dap-server-path dap-gdb-lldb-debug-program
:gdbpath "/usr/bin/gdb-multiarch"
:target "/home/bjc/src/MyStuff/bleusb/target/thumbv6m-none-eabi/release/usb"
:cwd "/home/bjc/src/MyStuff/bleusb/usb")) and it seems to still launch the default |
After trying again, it turns out that setting |
Put a breakpoint in main and debug as usual. To find main, you can use helm-lsp-workspace-symbol or lsp-ivy-worskspace-symbol. |
@yyoncho Is there any better way to do so? |
@EgorDuplensky you can build whatever flow you want creating a wrapper over dap-debug. Here is sample one:
(note how |
@EgorDuplensky in general what I do is to create the configurations I need and then I use dap-debug-recent/dap-debug-last to pick the right one. |
Thank you for the code example. This is actually almost exactly what I have in my emacs config (except your version is much cleaner than mine). |
I apologize if this has already been discussed somewhere, but I couldn't find any mention of it. I'm trying to debug a C++ application using lldb and need to pass command line options to the application for debugging. How do I do this?
My config is
(dap-mode 1)
(dap-ui-mode 1)
(require 'dap-gdb-lldb)
When I run dap-debug, it asks for the executable to debug and starts a session, but I'm not able to run it with options.
The text was updated successfully, but these errors were encountered: