problems with debugging in .vscode - c++

I'm trying to debug c++ code in vs-code and needs to pass argument to start debugging. to run the program in command line its just like that:
[user#localhost ~]$ ./hello-world 10
how to configure input parameter when debugging?
thanks for help in advance.

You can run it like that :
devenv /debugexe 'program name' 'program arguments'
Or use your IDE and define your arguments , all what you need is here =>
Debugging with command-line parameters in Visual Studio

Related

What is the `console` tab evaluation environment

Suppose I a script in a debugging mode and console tab is open and the following is output:
"C:\Program Files (x86)\JetBrains\WebStorm 2016.2\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" --debug-brk=50811 --expose_debug_as=v8debug C:\Users\maksym.koretskyi\Desktop\nodejs\http.js bo----3
Debugger listening on [::]:50811
Then I start typing in expressions, like console.log(3), but nothing is outputted:
Why?
Works for me:
i'd suggest creating support ticket

Codelite issue--No executable specified,use 'target exec

I have just installed codelite in my windows 8.1.It shows error
Debugger exited with the following error string:
"No executable
specified,use 'target exec'"
I searched and found this (another stackoverflow question) I did the same as mentioned there but nothing really worked for me.I made a new project and selected Simple executable (g++) and GNU debugger as default debugger.Can anybody help me with this.Also it shows "Program exited with return code: 4199040".
It seems that you don't provide executable to run/debug:
Go to
Project settings... -> Common settings -> General
and fill correct information for
Executable to Run / Debug
Jarod42 provided a 'close enough' answer. On Linux the steps seem to be:
Workspace -> Open Active Project Settings... -> General
and fill correct information for
Executable to Run / Debug
In the command prompt:
gdb (program type: example python or c or c++ etc)
If am running python program then the command will be gdb python
then (gdb) run program_name.py

How to run a linux script before launching gdb debugging in Eclipse

How do I give commands to run before starting gdb debugging in Eclipse ?
Actually I want to execute few scripts that set environment variables (export vars) and execute a bunch of other programs before gdb process is launched from eclipse to debug my program.
I tried doing the following in debugger tab option:
<command> && <path-to-gdb-executable>
But I got the error that eclipse cannot execute gdb as given in above statement.
Please help - I actually want to execute a script called "before-launch-commands.sh" before debugging is started by gdb. I am trying to execute a cpp program under eclipse kepler.
Thanks.
The Eclipse Debug Configurations can already setup environment variables for you. I'm going to assume that that isn't sufficient, or you'd have already done it.
The first thing to do is create a new script, wrapped-gdb.sh:
#!/bin/sh
# Export any variables we need.
# Note that '.' (dot) is like an "include" statement.
. /path/to/before-launch-commands.sh
# Run GDB using the parameters passed in
exec /path/to/gdb "$#"
Next, set that script executable:
chmod +x /path/to/wrapped-gdb.sh
Finally, go to the Debugger tab in the debug configuration dialog, and in the box marked "GDB Debugger" enter /path/to/wrapped-gdb.sh.
When you launch your debug session it should now Do The Right Thing.

Additional Command Line Arguments for Running Program in Code::Blocks?

Many IDEs allow you to add some custom command line arguments which are used when the IDE runs your program after compilation. E.g my program is pro_ext_changer.exe, I'd like to add a --backup option when running it:
pro_ext_changer.exe --backup
I haven't found a way to do this in Code::Blocks. How do you do it?
[Project] → [Set program's arguments…]
I didn't know that but I just fired up Code::Blocks, which I've only toyed with, and I looked around.

How to run a console application with command line parameters in Visual C++ 6.0?

I've got a console application that compiles and executes fine with Visual C++ 6.0, except that it will then only get as far as telling me about missing command line parameters. There doesn't seem to be anywhere obvious to enter these. How do I run or debug it with command line parameters?
I assume you're talking about setting the command line parameters for running in the IDE.
Open the Project/Settings property page and go to the Debug tab.
There's a "Program arguments" field you can put them into.
If I remember correctly, under Project/Settings/Debug tab there is a place to enter the command line parameters. It's the "Program arguments" field.
In VS2010:
Right click the project.
Select Properties.
Select Debug tab.
Start Options -> Command line arguments: Enter the arguments here.