21

I am trying to issue some gdb commands in vscode's Debug Console, but fail

enter image description here

why and how to fix?

1 Answer 1

21

From the Visual Studio Code official page:

For the C++ (GDB/LLDB) debugging environment, you can execute GDB, LLDB and LLDB-MI commands directly through the debug console with the -exec command, but be careful, executing commands directly in the debug console is untested and might crash VS Code in some cases.

E.g. for debugging child process after fork:

-exec set follow-fork-mode child
Sign up to request clarification or add additional context in comments.

2 Comments

How can I execute multiple line gdb command by -exec? For example: ``` break 403 commands silent set x = y + 4 cont end ```
Is there a way to make "-exec" as default for the debug console? Every command I type there is a gdb command and having to type -exec is annoying.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.