GDB Debugging: How to Debug a C/C++ program

  Рет қаралды 38,722

pikuma

pikuma

Күн бұрын

Пікірлер: 54
@kenwallace6493
@kenwallace6493 3 жыл бұрын
Still best GBD tutorial to date. 10/21
@littlecurrybread
@littlecurrybread Жыл бұрын
true
@abhis-world
@abhis-world 4 жыл бұрын
You are indeed a great tutor! Thanks for coming up with this in the most precise way possible
@niazahsan1337
@niazahsan1337 3 жыл бұрын
Wonderful! Loved the simplicity
@AshishKumar-tg6zh
@AshishKumar-tg6zh 4 жыл бұрын
I want more free videos on Linux and Game development. I watched all your KZbin videos. And I also enrolled for your Fundamentals of game development. And I am learning and enjoying it. Thanks for all of your great tutorials. And I want a SDL c++ course that teaches in-depth knowledge of game development like memory management, handling pointers, physics engine, optimization and many more cool stuff that the c++ made for. Again thank you very much 😊
@pikuma
@pikuma 4 жыл бұрын
Thank you so much. I'm recordng new videos and courses as we speak. OpenGL and Game physics are the next ones. :)
@AshishKumar-tg6zh
@AshishKumar-tg6zh 4 жыл бұрын
@@pikuma You are my greatest teacher. That is what i wanted. I am rely excited for the new course. If I make any game I will definitely going to add your name. And If I will make some money I am going to support you. Thanks you very much. I will waiting for your next course on Game Development.
@AshishKumar-tg6zh
@AshishKumar-tg6zh 4 жыл бұрын
I finished your Fundamental of 2D game engine. Wow! That is my best course in my life. I learned a lot that I can't learn from KZbin videos. You shown me the power of Linux, C++ from terminal, vim the best code editor which taught me how to write code without mouse and most important fundamentals of 2D game Engine. Now I am going to make a level editor from C++ SDL. And I am also going to take Raycasting but I don't want to learn other languages like JavaScript. Why don't you use c++ and lua. Sorry for bad English.
@pikuma
@pikuma 4 жыл бұрын
@@AshishKumar-tg6zh This is incredibly inspiring. Thank you so much for the support. :)
@samdavepollard
@samdavepollard Жыл бұрын
never used gdb but would like to get into it this was a perfect introduction many thanks for sharing your knowledge
@ajobe15
@ajobe15 4 жыл бұрын
Great tutorial! I would love to see a more in-depth debugging tutorial, though. For example, what would you do if there was a segmentation fault? Learning to debug C++ on Linux is frustrating when you are so used to Visual Studio.
@pikuma
@pikuma 3 жыл бұрын
True. I do believe Visual Studio is the best C++ IDE out there. Such a great piece of software...
@AnnatarTheMaia
@AnnatarTheMaia Жыл бұрын
Show them core file debugging and conditional watches. Also, executables should always be compiled with -g -gcc-record-switches -g3, which will make the executable significantly larger but doesn't impact execution speed since the runtime linker knows to ignore the debugging slots of the ELF file. For 0.2 ms longer that it takes to start, it's worth having the source code and the symbols embedded in the executable in case a core dump happens and debugging is required, but the source code and symbol information isn't available separately. And yes there is a practice on GNU/Linux to separate the debugging information out of such generated executable, but it relies on GNU objdump utility which isn't guaranteed to be present on other UNIX operating systems, and usually requires figuring out which additional package contains the said debugging information, so it is by no means a good practice. Therefore it is better to have the source code and the debugging information embedded in the executable. Always.
@upthinker2336
@upthinker2336 3 жыл бұрын
Great tutorial, thank you for this!
@starc0w
@starc0w 2 жыл бұрын
Thank you so much Gustavo!
@awesomeicemanpheasan
@awesomeicemanpheasan 3 жыл бұрын
Great help. Thanks!
@muudus_tv
@muudus_tv 4 жыл бұрын
Wow this is the best video i got, i always love the classic retro way of doing stuffs. Where can i find all the debugging keyboard cmd for GDB along with good explanation of same.
@universocpp
@universocpp 3 жыл бұрын
Valeu, Gustavo!!
@pikuma
@pikuma 3 жыл бұрын
Grande! 😉
@TL-fe9si
@TL-fe9si 2 жыл бұрын
Thank you very much! This is really helpful!!
@dillingerlee2536
@dillingerlee2536 3 ай бұрын
Trying to learn to debug 16 bit Assembly programs. The very few GDB tutorials assume you are working in C or C++. Would appreciate any info on how to debug an Assembly program. Got GDB working but can't figure out how to display the program code if it's not an .exe
@SlideRSB
@SlideRSB 2 жыл бұрын
While I do appreciate the lesson on debugging with GDB, I saw the flaw in logic immediately without the need to use a debugger in this case.
@pikuma
@pikuma 2 жыл бұрын
Ha! True. But one day you'll have a SegFault and then it will all make sense. 🙂 Or you can just use a proper IDE as well, even better.
@SlideRSB
@SlideRSB 2 жыл бұрын
@@pikuma It already makes sense as I currently do have code that SegFaults. Now to apply the methods you've demonstrated...
@futuza
@futuza 2 жыл бұрын
Anyway you could cover gdb for large projects? Eg: How would you go about using it with something like a game with hundreds or thousands of source files. How to easily set a break point somewhere in middle of all that to find the part of the program you need to actually step through without having to go through thousands of lines first?
@mrbbayat
@mrbbayat 4 жыл бұрын
Fantastic.
@myelinsheathxd
@myelinsheathxd 2 жыл бұрын
How I can catch an errors inside a code by third party software? My main idea is to create game engine and catch errors of the editor and runtime code errors using GDB..
@welawela105
@welawela105 2 жыл бұрын
hello good presentation of gdb but from my side "layout next" is not recognized as a command... I'm on windows system and using native "gdb.exe" program provided with my MinGW/bin repertory.
@matsmcmats
@matsmcmats Жыл бұрын
maybe you can use it from within mingw instead?
@article3enthusiast
@article3enthusiast 4 ай бұрын
I need to type "list" to show the source code, otherwise it shows the asm
@juliocgfreitas
@juliocgfreitas 3 жыл бұрын
Ótima explicação. Vi que é brasileiro. Massa. Vou adquirir o curso de LUA em breve e ver se melhoro meus códigos em C. Tem previsão de migrar seus outros cursos pra Udemy? Grande abraço.
@pikuma
@pikuma 3 жыл бұрын
Grande Julio. Os cursos novos vão ser publicados no meu site pikuma.com. Na Udemy só vou manter os que já fpram publicados lá. Abração!
@kpritam4529
@kpritam4529 4 жыл бұрын
How you make the vim editor so colourful 😅😅
@pikuma
@pikuma 4 жыл бұрын
Hi Pritam. It's a simple theme called Monokai. :)
@muudus_tv
@muudus_tv 4 жыл бұрын
Do you prefer to debug large code the same way ?
@albertnormandy5753
@albertnormandy5753 3 жыл бұрын
When I use "layout next" I get my code but in assembly language. I not sure why this is.
@pikuma
@pikuma 3 жыл бұрын
Did you use -g to compile and keep the symbols? I think I mentioned that in the video.
@albertnormandy5753
@albertnormandy5753 3 жыл бұрын
@@pikuma I was indeed using the g flag but it still gave me asm. I found out that I had to type "layout src" to have my c code appear
@akshaykuralkar8848
@akshaykuralkar8848 4 жыл бұрын
Thank you its very help me
@danyalkucuktas9763
@danyalkucuktas9763 Жыл бұрын
How you install gdb on the Mac with the M1 chip
@pikuma
@pikuma Жыл бұрын
Apple uses lldb instead of gdb. They are very similar.
@torto20
@torto20 4 жыл бұрын
Estou fazendo o curso de raycasting javascript. Muito bom depois quero fazer os demais. Voce e brasileiro?
@pikuma
@pikuma 4 жыл бұрын
Opa Heitor, sim! Sou do RS mas moro em Londres há uns bons anos. De onde tu é?
@torto20
@torto20 4 жыл бұрын
@@pikuma legal! Sou de são paulo. Nao tenho um ingles muito bom mas estou conseguindo entender as aulas. Voce tem cursos em portugues relacionado a programacao de jogos?
@pikuma
@pikuma 4 жыл бұрын
@@torto20 O pessoal me diz que as legendas automáticas mais atrapalham do que ajudam. Eu vou gerar legendas manualmente em Pt-BR em todos os cursos em alguns meses.
@torto20
@torto20 4 жыл бұрын
@@pikuma legal!!
@niranjanamurthy4168
@niranjanamurthy4168 4 жыл бұрын
good
@mohamadfawaz4146
@mohamadfawaz4146 2 жыл бұрын
Big Man !
@malickdiop28
@malickdiop28 2 жыл бұрын
👍🏾👍🏾👍🏾
@Vnifit
@Vnifit 4 жыл бұрын
1:03 you have a variable C E L E R Y
@pikuma
@pikuma 4 жыл бұрын
😅
@subbirrahman1289
@subbirrahman1289 5 ай бұрын
great tutorial. Thank you so much man
9.2 - Debugging - GDB Tutorial
23:42
Chris Bourke
Рет қаралды 318 М.
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 168 МЛН
За кого болели?😂
00:18
МЯТНАЯ ФАНТА
Рет қаралды 3,5 МЛН
Do you love Blackpink?🖤🩷
00:23
Karina
Рет қаралды 23 МЛН
Deadpool family by Tsuriki Show
00:12
Tsuriki Show
Рет қаралды 4,2 МЛН
GDB Tutorial
55:12
CS 246
Рет қаралды 72 М.
Debugging with Core Dumps
9:16
Jacob Sorber
Рет қаралды 66 М.
Why do we use SDL with C & C++?
16:26
pikuma
Рет қаралды 46 М.
Why Didn't He Get the Job? Let's Find Out! // Code Review
27:25
The Cherno
Рет қаралды 152 М.
GDB Beginner Masterclass
23:31
Mike Shah
Рет қаралды 12 М.
BEST WAY to read and understand code
17:24
The Cherno
Рет қаралды 165 М.
you need to stop using print debugging (do THIS instead)
7:07
Low Level
Рет қаралды 456 М.
How C++ took a turn for the worse
5:03
Code Persist
Рет қаралды 326 М.
Emulating a CPU in C++ (6502)
52:28
Dave Poo
Рет қаралды 1 МЛН
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 168 МЛН