Тёмный

How to debug c program in visual studio code 

Top Down Programming
Подписаться 486
Просмотров 43 тыс.
50% 1

hello friends,
In this video i tried to setup configuration for debugging c program in visual studio code editor.
this series contains
part 1: Installing MinGW compiler and visual studio code.
• Installing MinGW compi...
part 2: compile and run c program using visual studio code tasks.
• How to Compile and Run...
part 3: assign key board shortcut for compiling and running c program in visual studio code.
• Visual studio code key...
part 4: how to debug c program in visual studio code
• How to debug c program...

Опубликовано:

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 28   
@falaghsepehr5504
@falaghsepehr5504 Год назад
Thank you so much! You explained everything so clearly I have no questions left in mind :) except one thing... the external console closes immediately after I press the stop button. is there any way to fix that. Maybe it should wait for a key press before closing the console?
@mesrepas
@mesrepas 5 лет назад
Thank you very much for this excellent videos. I have a problem, when I launch the debug, it doen't stop at the break point, it rather terminates. The compilation and run are Ok, but VS code doesn't break at the break point?
@bersi3306
@bersi3306 3 года назад
(two years of delay) You have to check the tasks.json (which is responsible for debugging phase). Make sure that Launch.json is calling Tasks.json with "preLaunchTask"
@MrMrphilipp8338
@MrMrphilipp8338 5 лет назад
Thank you very much for your tutorial! I have one question though: Whenever trying to debug, it states that the "miDebuggerPath" is invalid. Yet I do have it pointing to an existing gdb.exe file as done in your video.
@MrMrphilipp8338
@MrMrphilipp8338 5 лет назад
there was an unshown character infront of the Path... github.com/Microsoft/vscode-cpptools/issues/2925
@YogeshPatil-nw6cn
@YogeshPatil-nw6cn 4 года назад
@@MrMrphilipp8338 thank you so much . It works same as you said 👍🏼👍🏼👍🏼👍🏼😀😀😀
@kafkimatematico1456
@kafkimatematico1456 5 лет назад
Thanks again. This goes of category!
@aftabhussain9948
@aftabhussain9948 4 года назад
I am facing an issue I am not able to see the content of vector in C++. Anyway. Great video.
@SpktrumSkills
@SpktrumSkills 4 года назад
I have problems with scanf () the debugger just breaks.
@chanchalsrajanagrawal7545
@chanchalsrajanagrawal7545 2 года назад
👏👏wow sir........ This is that kind of video which i was searching about .......thank you so much sir for this 👏👏👏👏
@omkarrajale4602
@omkarrajale4602 3 года назад
Thanks a lot
@bharathkumar849
@bharathkumar849 3 года назад
Kindly give us the launch.json and task.json files.
@lehanm6689
@lehanm6689 3 года назад
When I click on debug, it shows "the prelaunchtask terminated with exit code 1". Could anyone please help me out in this. I have been trying since 1 week😭😭
@catalins7576
@catalins7576 5 лет назад
What if that blurred green line does not appear?
@1...........123-t9b
@1...........123-t9b 4 года назад
Thanks a lot! You earnt a sub!
@YogeshPatil-nw6cn
@YogeshPatil-nw6cn 4 года назад
Thanks me later. Helping the needy people is my habbit😀😀😀😀😀
@bjeddaj2386
@bjeddaj2386 4 года назад
Thanks
@nishantbharwani852
@nishantbharwani852 3 года назад
From where you are?
@jaysolanki8366
@jaysolanki8366 4 года назад
Idk it does not work for me it says, Unable to start debugger. Launch option string provided by the project system is invalid
@jaysolanki8366
@jaysolanki8366 4 года назад
@@topdownprogramming I did but still doesn't work
@YogeshPatil-nw6cn
@YogeshPatil-nw6cn 4 года назад
Just copy paste my code in respective files.... Remove older code completely and then copy paste...
@molyoxide8358
@molyoxide8358 3 года назад
@@YogeshPatil-nw6cn where is your code?? pls reply to me
@YogeshPatil-nw6cn
@YogeshPatil-nw6cn 3 года назад
@@molyoxide8358 just copy and paste the following code in your respective file. Also, take care of file paths as your computer paths are not as similar to that of mine. Thanks, me later. 1. c_cpp_properties.json { "configurations": [ { "name": "Win32", "browse": { "path": [ "${workspaceFolder}", "C:\\MinGW\\lib\\gcc\\mingw32\\9.2.0\\include" ], "limitSymbolsToIncludedHeaders": true }, "includePath": [ "${workspaceFolder}", "C:/MinGW/lib/gcc/mingw32/9.2.0/include/c++/tr1", "C:/MinGW/lib/gcc/mingw32/9.2.0/include/c++" ], "defines": ["_DEBUG", "UNICODE", "_UNICODE"], "cStandard": "c11", "cppStandard": "c++17", "intelliSenseMode": "gcc-x64" } ], "version": 4 } ------------------------------------------------------------------------------------------------------------------------------------------------------------ 2. tasks.json { "tasks": [ { "type": "shell", "label": "Compile c program", "command": "gcc", "args": ["-g", "${file}", "-o", "${workspaceRoot}\\${fileBasename}.exe"], "group": { "kind": "build", "isDefault": true } }, { "type": "shell", "label": "Run c program", "command": ".\\${fileBasename}.exe", "group": { "kind": "test", "isDefault": true } } ], "version": "2.0.0" } ----------------------------------------------------------------------------------------------------------------------------------------------------------- 3. launch.json { // 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": "${workspaceRoot}\\${fileBasename}.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": true, "MIMode": "gdb", "miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ], "preLaunchTask": "Compile c program" } ] } ----------------------------------------------------------------------------------------------------------------------------------------------------- 4. settings.json { "C_Cpp.errorSquiggles": "Enabled" } --------------------------------------------------------------------------------------------------------------------------------------------------------
@ashay_g_jain
@ashay_g_jain 5 лет назад
hello sir can you make a same video in hindi language
@YogeshPatil-nw6cn
@YogeshPatil-nw6cn 3 года назад
Just copy and paste the following code into your respective file. Also, take care of file paths as your computer paths are not as similar to that of mine. Thanks, me later. 1. c_cpp_properties.json { "configurations": [ { "name": "Win32", "browse": { "path": [ "${workspaceFolder}", "C:\\MinGW\\lib\\gcc\\mingw32\\9.2.0\\include" ], "limitSymbolsToIncludedHeaders": true }, "includePath": [ "${workspaceFolder}", "C:/MinGW/lib/gcc/mingw32/9.2.0/include/c++/tr1", "C:/MinGW/lib/gcc/mingw32/9.2.0/include/c++" ], "defines": ["_DEBUG", "UNICODE", "_UNICODE"], "cStandard": "c11", "cppStandard": "c++17", "intelliSenseMode": "gcc-x64" } ], "version": 4 } ------------------------------------------------------------------------------------------------------------------------------------------------------------ 2. tasks.json { "tasks": [ { "type": "shell", "label": "Compile c program", "command": "gcc", "args": ["-g", "${file}", "-o", "${workspaceRoot}\\${fileBasename}.exe"], "group": { "kind": "build", "isDefault": true } }, { "type": "shell", "label": "Run c program", "command": ".\\${fileBasename}.exe", "group": { "kind": "test", "isDefault": true } } ], "version": "2.0.0" } ----------------------------------------------------------------------------------------------------------------------------------------------------------- 3. launch.json { // 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": "${workspaceRoot}\\${fileBasename}.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": true, "MIMode": "gdb", "miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ], "preLaunchTask": "Compile c program" } ] } ----------------------------------------------------------------------------------------------------------------------------------------------------- 4. settings.json { "C_Cpp.errorSquiggles": "Enabled" } --------------------------------------------------------------------------------------------------------------------------------------------------------
@СашаМаксимов-ц4е
Одни индусы кодят ёмана.
Далее
Ozoda & Dilime - Lada
00:36
Просмотров 1,4 млн
Beatrise (пародия) Stromae - Alors on danse
00:44
Ozoda & Dilime - Lada
00:36
Просмотров 1,4 млн