Debug a C++ project in VS Code

  Рет қаралды 310,202

Visual Studio Code

Visual Studio Code

Күн бұрын

Пікірлер: 82
@yudzu8820
@yudzu8820 9 ай бұрын
vs code with python: 1)click a button 2)enjoy. vs code with c++ 1) add configuration file 2) click on something that did not appear. 3) update something that did not even occur 4) frustration 5) sadness 6) there is no point in anything 7) become a farmer
@RIPNANI
@RIPNANI 8 ай бұрын
😂 bruh Im struggling with this mf for a while 😂
@Alterx758
@Alterx758 5 ай бұрын
lol 😂
@smorollcancel
@smorollcancel 5 ай бұрын
just wasted my whole day on this bs lmao
@vanity_stars1064
@vanity_stars1064 3 жыл бұрын
Even Official microsoft is using OSX
@michaeldick4900
@michaeldick4900 3 жыл бұрын
Love VS Code, but this freedom comes at a cost. Some of the things I take for granted in an IDE can be a little bit of a headache, but I love in VS Code you can customize everything! Thank you for this video!
@jakubkucera1973
@jakubkucera1973 Жыл бұрын
The next step is setting up neovim, makes you appreciate the user friendliness of vscode ;D
@andrewstone9931
@andrewstone9931 3 жыл бұрын
this is years overdue 😂 I remember in my first year of uni thinking it was ridiculously more complicated to set up a build env in vscode than VS2017
@Smurdy1
@Smurdy1 8 ай бұрын
Love this video, it did absolutely nothing and not a single thing in the video worked the same in vscode. Making that intellij subscription seem really promising...
@munteanionut3993
@munteanionut3993 2 жыл бұрын
I cannot see g++-7 at 0:37... how to solve that?
@PedroMesquitadaConceicao
@PedroMesquitadaConceicao Жыл бұрын
same happened to me.. did you discovered how to solve it?
@wetbadger2174
@wetbadger2174 3 жыл бұрын
It doesn't give me the option to choose a debugger environment. I can only choose between (gdb) Attach or (gdb) Launch configurations. Neither works.
@jigz3903
@jigz3903 3 жыл бұрын
choose gdb launch and do this .. worked for me ---- paste this whole in the launch.json file ========================================== { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "(gdb) Launch", "type": "cppdbg", "request": "launch", "program": "${fileDirname}/${fileBasenameNoExtension}", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": false, "MIMode": "gdb", // "miDebuggerPath": "C/C++ : g++", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ] } ] }
@kamalmohamed6611
@kamalmohamed6611 3 жыл бұрын
@@jigz3903 thanks dude how did you write this
@jigz3903
@jigz3903 3 жыл бұрын
@@kamalmohamed6611 😁 no problem
@nexolec109
@nexolec109 2 жыл бұрын
@@jigz3903 THANKS JIGZ i really appreciate it u just saved me an enormous headache
@Waffle4569
@Waffle4569 5 ай бұрын
​@@jigz3903 Your comment is hidden?!
@techdotsquirrel
@techdotsquirrel Жыл бұрын
Following the steps: I keep getting the following errors on Debug Console "Warning: Debuggee TargetArchitecture not detected, assuming x86_64. ERROR: Unable to start debugging. Unexpected LLDB output from command "-exec-run". Command 'exec-run'. Invalid process during debug session The program '/Users/maxwelljin/GitHub/practiceVSCode/CPP/Main' has exited with code 42 (0x0000002a)." what I am missing here?
@kuby6838
@kuby6838 Жыл бұрын
Hi is it normal if i don't get any configuration when i try to debug ? like i'm doing everyting from the video but my launch.json is empty Thanks in advance and have a good one
@mistahswick4065
@mistahswick4065 Жыл бұрын
did you ever find an answer to this? i have the same problem switching from vs to vs code
@omranshahrour7291
@omranshahrour7291 3 жыл бұрын
Doesn't match on windows
@shashankkr1008
@shashankkr1008 3 жыл бұрын
Thank you soo much! This tutorial was really helpful, now I love debugging and can understand how exactly the code is running.
@Waffle4569
@Waffle4569 5 ай бұрын
I love how this tutorial straight up doesn't work in 2024. They already broke half the stuff in here
@snehel1586
@snehel1586 2 жыл бұрын
there should be a way to debug while taking user inputs, while smaller inputs doesn't need a debugger tool bt it's impossible to hardcode huge inputs again and again.
@herohera3497
@herohera3497 Жыл бұрын
cant we give input while debugging??
@Brad-qw1te
@Brad-qw1te 6 ай бұрын
@@herohera3497 there is a way for sure. Just ask chat gpt
@aayushshrivastav7515
@aayushshrivastav7515 2 ай бұрын
use a file to provide stdin
@chak-pongchung8463
@chak-pongchung8463 3 жыл бұрын
how can I enable debugging when I am using miniconda for package dependencies? I find passing the following arguments in clion cmake argument works, but VSCode cannot allow me to do that: ``` -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS_DEBUG="-O0" -DCMAKE_CXX_FLAGS_DEBUG="-O0"```
@Paivren
@Paivren 2 жыл бұрын
"launch.json lives in your worspace directory's workspace folder" No, it does not. I only have settings.json and tasks.json. this is so frustrating
@na_co1165
@na_co1165 10 ай бұрын
Did u solve it
@kalelalves
@kalelalves 3 жыл бұрын
Sadly, auto-complete doesn't work on debug console. :/
@na_co1165
@na_co1165 10 ай бұрын
I keep getting : launch program does not exist debug, using linux redhat, and gcc as compiler
@brs2158
@brs2158 10 ай бұрын
in task.json, configure "args": [ "-g", "Program1.cpp", "main.cpp", "-o" "${fileDirName}\\${fileBasenameNoExtension}.exe"], since default is empty not eligible to link files and mostly end up with undefined reference error or cannot find .exe file. Hope this works
@NothingMan06
@NothingMan06 20 күн бұрын
ı am using macOS and ı clicked gdb/lldb but ı can't select anything . The launch.json file was created automatically.
@salman8562
@salman8562 3 жыл бұрын
What if I have a multiple-directory c++ program? I cannot compile it neither can debug it, but I have a makefile that works just fine. please help me anyone reading this comment, I am in immeasurable pain and my day is ruined.
@Sacknase381
@Sacknase381 2 жыл бұрын
those arent there for me anymore. After i installed the jdk i cant find any c++ debuggers
@galibmahim9544
@galibmahim9544 Жыл бұрын
There is a problem I faced, "externalConsole": false, then I can't give input to the program at runtime, the debugging session, gets stuck on scanf() or cin and says that, they are running but it the terminal it don't take any input. So, It is necessary to "externalConsole": true, to be in the launch.jason file. Then it will open a new terminal and wait for you to give your inputs to the programs when necessary. SUGGESSTION: It would be very nice, if this things can be automated by the VSCODE
@talentotech-p1e
@talentotech-p1e Жыл бұрын
did you find a way to use the internal console of vsc for inputs? I'm struggiling with that and I'm thinking it might be related to lldb debugger but might be wrong.
@deadeye8
@deadeye8 Жыл бұрын
​@@talentotech-p1edont know but this happens with me when i use Windows(launch) config, as soon as i move to gdb launch the input works fine, through internal console.
@tanmaykumar9277
@tanmaykumar9277 2 жыл бұрын
What if we want to input a value using cin? we can't write anything in debug console
@rjeejacobjacob
@rjeejacobjacob Жыл бұрын
Suppose I don't have the .cpp source file but only the binary "a.out", which is already running. Is there a way for me to monitor the variables and expressions after attaching the debugger to the a.out process?
@codecoderr7495
@codecoderr7495 Жыл бұрын
you'd need the debug symbols to exist in the executable (GCC debug symbols added to compiler), and a GDB stub (Server) running in that app. Then GDB Client (say for ARM GCC: arm-none-eabi-gdb). Then connect through IP address & port from GDB Client into GDB stub. And then in the GDB stub implementation, you'd need a debug stack of sorts to extract the registers and paste them there. So GDB client could watch immediate register as variables and expressions real time.
@zXjimmiXz1337
@zXjimmiXz1337 3 жыл бұрын
Is it possible to change the formatting of the printed messages? All my output starts with @" and shows the new-line characters ... How can I just show the plain output?
@Dinesh45444
@Dinesh45444 Жыл бұрын
change the line ending from LF to CRLF or plain text you can see in the video bottom right status bar the blue one it show line ending is set to LF change it.
@glaucoa.9214
@glaucoa.9214 2 жыл бұрын
I installed gdb and gcc on my MACOS, I do these steps and I can't debug. What do I do?
@benjaminbencik8498
@benjaminbencik8498 3 жыл бұрын
This was helpful, thanks:)
@prabhavagrawal1712
@prabhavagrawal1712 2 жыл бұрын
Loved how integratedconsole error is being hidden in this presentation 😂
@NilsKubler
@NilsKubler Жыл бұрын
is it possible to attach to running processes in vs code?
@zXjimmiXz1337
@zXjimmiXz1337 3 жыл бұрын
Didn't get a response previously - how can I remove the @ characters and the newline characters from every print statement? Makes the formatting of all our logging completely illegible making debugging 10X harder!
@Dinesh45444
@Dinesh45444 Жыл бұрын
change your line ending to CRLF
@ΓιάννηςΝάκας-ι4υ
@ΓιάννηςΝάκας-ι4υ 2 жыл бұрын
It says that it was built succesfully but then it says "Unable to start debbuging. The value of miDebuugerPath is valid. What should I do? I did exactly what you did on the video.
@Dinesh45444
@Dinesh45444 Жыл бұрын
set miDebuggerPath to exact path where your gdb.exe is present
@VanFS3K
@VanFS3K 2 жыл бұрын
There is no selection of debugger environment. These setup instructions are obsolete. Does anyone have an updated one?
@Manas-jj6xf
@Manas-jj6xf 5 ай бұрын
Did you find a workaround?
@icopypasta
@icopypasta 3 жыл бұрын
Very helpful, thank you much!
@avishcheetaram1807
@avishcheetaram1807 Жыл бұрын
How do I input variable values during debugging mode?
@mmkvhornet7522
@mmkvhornet7522 2 жыл бұрын
hi your steps work fine but i need to reconfigure each time !!! yes each time why please answer me 🙏🙏
@loraalaq
@loraalaq Ай бұрын
It's not working for me.
@ruscyber9765
@ruscyber9765 2 жыл бұрын
My debugger starts and turns off after on its own
@iamyouu
@iamyouu 2 жыл бұрын
How to do this on Linux
@r2com641
@r2com641 3 жыл бұрын
but this would be inferior to debugger offered by MSVC isnt it?
@FrankMadero
@FrankMadero 2 жыл бұрын
Where is the memory view and register view? Not a very good tool for serious debugging.
@codecoderr7495
@codecoderr7495 Жыл бұрын
if you're programming C++ games you don't need these at all. you'd only need them if you're coding emulators in baremetal hardware, which makes no sense at all since you should be using a debug unit on said units.
@MrTomro
@MrTomro 3 жыл бұрын
love it, super simple
@10bokaj
@10bokaj 5 ай бұрын
ok, so microsoft uses mac OS...
@SMGGamerzOfficial
@SMGGamerzOfficial 3 жыл бұрын
Will you make a video in which we could make a normal game in visual studio code c++
@callofgamingcog8992
@callofgamingcog8992 3 жыл бұрын
Not them using an Apple's OS. >_
@Weeeeeeeeeeeeeah
@Weeeeeeeeeeeeeah Жыл бұрын
Why to make a tutorial on a microsft software, microsoft uses a mac? 😕
@nancygaur6705
@nancygaur6705 3 жыл бұрын
Sir can you please solve this error in vs code "this language server has crashed 5 times in 3 minutes. It can be restarted." Fix it
@gauravrewaliya3269
@gauravrewaliya3269 3 жыл бұрын
there is no input console
@gauravrewaliya3269
@gauravrewaliya3269 3 жыл бұрын
just set externalconsole =true it works fine now
@charsetUTF-8
@charsetUTF-8 3 жыл бұрын
how to show string debugging, i use WinOS
@xth3x
@xth3x 5 ай бұрын
if you didnt install the debugger when installing the g++ compiler, then open the MSYS2 terminal and run the command pacman -S mingw-w64-x86_64-gdb to install gdb NOTE: path is not the same as compiler add "C:\msys64\mingw64\bin" to your local paths Follow the rest of the steps in the video and it should work
@themujahed
@themujahed 2 жыл бұрын
microsoft product using in a apple product
@l1nker_zyoutubetm611
@l1nker_zyoutubetm611 2 жыл бұрын
Нечем не помогла...
@Kifri_filosofia
@Kifri_filosofia Жыл бұрын
visual studio code is bullshit, It is literally impossible to nnot get an error
@gammyhorse
@gammyhorse 3 жыл бұрын
Visual Studio Code sucks big time.
Debugging C++ Program in Visual Studio Code (VSCode)
17:23
ProgrammingKnowledge
Рет қаралды 144 М.
9.2 - Debugging - GDB Tutorial
23:42
Chris Bourke
Рет қаралды 320 М.
요즘유행 찍는법
0:34
오마이비키 OMV
Рет қаралды 12 МЛН
🎈🎈🎈😲 #tiktok #shorts
0:28
Byungari 병아리언니
Рет қаралды 4,5 МЛН
ССЫЛКА НА ИГРУ В КОММЕНТАХ #shorts
0:36
Паша Осадчий
Рет қаралды 8 МЛН
Is C BETTER than C++ for beginners? // Code Review
31:16
The Cherno
Рет қаралды 88 М.
How to DEBUG C++ in VISUAL STUDIO
19:20
The Cherno
Рет қаралды 491 М.
C++ Setup in VS Code with g++ and gdb on Windows 10
9:40
Codeflash
Рет қаралды 103 М.
Debug Multi-File C++ Programs in VS Code and WSL (Windows)
7:23
Michael Hoefer
Рет қаралды 25 М.
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 313 М.
Debugging a C++ (CMake) Project in Vscode
10:15
D Bersan
Рет қаралды 37 М.
How to Use a Debugger - Debugger Tutorial
17:01
Tech With Tim
Рет қаралды 335 М.
C++ in VS Code: Building your Code with CMake
9:37
Visual Studio Code
Рет қаралды 51 М.
How Senior Programmers ACTUALLY Write Code
13:37
Thriving Technologist
Рет қаралды 1,6 МЛН
요즘유행 찍는법
0:34
오마이비키 OMV
Рет қаралды 12 МЛН