Hey coders! In this video, I'm diving into CGDB, a powerful curses layer on top of GDB that makes terminal debugging a breeze. See your source code and breakpoints side-by-side in one clean interface. I'll walk you through setup, breakpoints, and why CGDB rocks for C++, C, and assembly projects. Watch my GDB video first for the basics (link in comments)! If you dig this, subscribe and drop a comment for more coding tips. Let's debug smarter! #CGDB #GDB #Debugging #Coding
Introduction to CGDB 00:00:00
Recommendation to Watch GDB Video 00:00:05
Explanation of CGDB and Curses 00:00:23
Building and Running CGDB 00:01:03
CGDB Interface Overview 00:01:56
Setting Breakpoints in CGDB 00:02:18
Managing Breakpoints 00:02:53
Benefits of CGDB 00:03:47
Closing Remarks and Subscription Request 00:04:00
Call for Comments and Suggestions 00:05:30
Thanks for watching!
Find us on other social media here:
- https://www.NeuralLantern.com/social
Please help support us!
- Subscribing + Sharing on Social Media
- Leaving a comment or suggestion
- Subscribing to our Blog
- Watching the main "pinned" video of this channel for offers and extras
Introduction to CGDB 00:00:00
Recommendation to Watch GDB Video 00:00:05
Explanation of CGDB and Curses 00:00:23
Building and Running CGDB 00:01:03
CGDB Interface Overview 00:01:56
Setting Breakpoints in CGDB 00:02:18
Managing Breakpoints 00:02:53
Benefits of CGDB 00:03:47
Closing Remarks and Subscription Request 00:04:00
Call for Comments and Suggestions 00:05:30
Thanks for watching!
Find us on other social media here:
- https://www.NeuralLantern.com/social
Please help support us!
- Subscribing + Sharing on Social Media
- Leaving a comment or suggestion
- Subscribing to our Blog
- Watching the main "pinned" video of this channel for offers and extras
Category
🤖
TechTranscript
00:00hey everybody in this video i'm going to talk about c gdb which is just a debugging program
00:05if you haven't seen my other video on gdb please watch that first because
00:09i go over all the concepts of debugging an assembly program a c plus plus program a c program
00:15and it'll be much more useful than this video
00:17this video is just about c gdb which is really a curses layer on top of gdb curses is a library
00:30that allows programmers to kind of make graphical interfaces in the terminal so
00:34the point of this video is just to show you a slightly different way to use gdb that's why i'm
00:39saying go check out the previous gdb video first um but you know i think you know sometimes people
00:45like c gdb so what am i talking about for starters pretend that i have a program i've got an assembly
00:51module a c plus plus module and a make file you don't know assembly or make file or c plus plus
00:57see my other videos this video is only about c gdb but i can do you know make build just to build
01:05my uh my objects in my executable and then normally if you know see if you know gdb you can go gdb main
01:13and just enter the gdb terminal right this is great you can do a lot of commands from here
01:17but it's not very graphical it does have a graphical mode to be honest but it seems to be kind of
01:23glitchy so i'm not really going to talk about it anyway so instead of launching your program inside of
01:28gdb you can launch your program with c gdb c standing for curses i don't think this is installed on
01:36the current system so i'll probably have to install it right okay so you can go pseudo apt install c gdb
01:41and then just enter your password
01:47la la la okay okay now let's try again let me do clear and then we'll do c gdb main and i just want
01:56you to see that um it's got two windows this is the whole point for me anyway the bottom window is
02:03actually gdb so anything you've learned there is going to apply here but the difference is that
02:08there's a top panel that shows your source code so i don't know let's uh suppose for the sake of
02:13argument i'm going to hit escape so i can go up to the top panel and kind of scroll my source code
02:17let's suppose for the sake of argument i want to break every time i hit line 36
02:22okay i'm kind of scrolling i just hit escape to get into the top panel i'm going to hit i for
02:26interactive mode which lets me go back down to the bottom panel and then i'll just say b for break
02:31points uh main dot cpp line 36 and then just double check that i entered my break points correctly and
02:38then i'll run the program again if you don't know gdb see my other video but notice how i started to run
02:43the program and then uh it immediately hit a break point and then the window at the top pointed to that
02:50line where it broke if you don't believe me i'll do another break point at line let's see main dot cpp line
02:55maybe uh 32 and then another one at uh 39 well maybe i should have done 40 yeah i should have done
03:0540 and then 33 so that means i probably want to uh delete that one at 32 so i'm gonna delete whichever
03:14one shows up at 32 that's number two and then info break points again okay so now if i continue the
03:20program also by the way notice how the top panel is showing red line numbers for my break points
03:26if i hit c for continue and it hits the same break point again if i hit enter to continue one more
03:31time it'll do that eventually it hits a different break point and notice how the source code
03:37moves down to the appropriate break point so for me personally i kind of like to just regularly you
03:42know use the regular gdb and then go back and forth between that and my code window but some people
03:47really love having both their code and gdb in the same terminal so they don't have to go back and
03:53forth between windows so if that's you then uh maybe cgdb is for you my little dog he wants to go pee
04:00okay uh that's all i have for this video thank you so much for watching and uh i hope you learned a
04:05little bit of stuff and had a little bit of fun i'll see you in the next video
04:12hey everybody thanks for watching this video again from the bottom of my heart i really appreciate it i do
04:17hope you did learn something and have some fun uh if you could do me a please a small little favor
04:23could you please subscribe and follow this channel or these videos or whatever it is you do on the
04:29current social media website that you're looking at right now um it would really mean the world to me
04:33and it'll help make more videos and grow this community so we'll be able to do more videos
04:38longer videos better videos or just i'll be able to keep making videos in general so please do do me
04:44a kindness and uh and subscribe you know sometimes i'm sleeping in the middle of the night and i just
04:49wake up because i know somebody subscribed or followed it just wakes me up and i get filled with
04:53joy that's exactly what happens every single time so you could do it as a nice favor to me or you could
04:59you could troll me if you want to just wake me up in the middle of the night just subscribe
05:02and then i'll i'll just wake up i promise that's what will happen also uh if you look at the middle
05:08of the screen right now you should see a qr code which you can scan in order to go to the website which
05:12i think is also named somewhere at the bottom of this video and it'll take you to my main website where
05:17you can just kind of like see all the videos i published and the services and tutorials and things
05:22that i offer and all that good stuff and uh if you have a suggestion for uh uh clarifications or errata
05:31or just future videos that you want to see please leave a comment or if you just want to say hey
05:35what's up what's going on you know just send me a comment whatever i also wake up for those in the
05:40middle of the night i get i wake up in a cold sweat and i'm like it would really it really mean the world
05:46to me i would really appreciate it so again thank you so much for watching this video and um enjoy the
05:53cool music as as i fade into the darkness which is coming for us all
06:08so
06:14so
06:16so
06:20so