Master CGDB: Boost Your Debugging with GDB’s Curses Interface in Terminal

Master CGDB: Boost Your Debugging with GDB’s Curses Interface in Terminal

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

Hey everybody! In this video I’m going to talk about CGDB which is just a debugging program.

If you haven’t seen my other video on GDB please watch that first because

I go over all the concepts of debugging an assembly program, a C++ program, a C program

and it’ll be much more useful than this video.

This video is just about CGDB which is really a curses layer on top of GDB.

on top of GDB. Curses is a library that allows programmers to kind of make

graphical interfaces in the terminal so the point of this video is just to show

you a slightly different way to use GDB that’s why I’m saying go check out the

previous GDB video first but you know I think you know sometimes people like CG

to be so what am I talking about for starters pretend that I have a program

I’ve got an assembly module a C++ module and a make file you don’t know

or C++, see my other videos.

This video is only about CGDB.

But I can do, you know, make build,

just to build my objects and my executable.

And then normally, if you know GDB,

you can go GDB main and just enter the GDB terminal, right?

This is great, you can do a lot of commands from here,

but it’s not very graphical.

It does have a graphical mode, to be honest,

but it seems to be kind of glitchy,

so I’m not really gonna talk about it.

going to talk about it anyway so instead of launching your program inside of gdb you can

launch your program with c gdb c standing for curses i don’t think this is installed on the

current system so i’ll probably have to install it right okay so you can go sudo apt install c gdb

and then just enter your password

Let me do clear and then we’ll do CGDB main.

And I just want you to see that it’s got two windows.

This is the whole point for me anyway.

The bottom window is actually GDB.

So anything you’ve learned there is going to apply here.

But the difference is that there’s a top panel that shows your source code.

So I don’t know.

Let’s suppose for the sake of argument, I’m going to hit escape so I can go up to the top panel and kind of scroll my source code.

Let’s suppose for the sake of argument, I want to break every time I hit line 36.

time I hit line 36 okay I’m kind of scrolling I just hit escape to get into the top panel

I’m gonna hit I for interactive mode which lets me go back down to the bottom panel

and then I’ll just say B for breakpoints main.cpp line 36 and then just double check that I entered

my breakpoints correctly and then I’ll run the program again if you don’t know GDB see my other

video but notice how I started to run the program and then it immediately hit a breakpoint and then

the top pointed to that line where it broke if you don’t believe me i’ll do another breakpoint

at line let’s see main.cpp line maybe uh 32 and then another one at uh 39 well maybe i should

have done 40. yeah i should have done 40 and then 33 so that means i probably want to uh

delete that one at 32 so i’m gonna delete whichever one shows up at 32 that’s number two

and then info breakpoints again okay so now if i continue the program also by the way notice how

the top panel is showing red line numbers for my breakpoints if i hit c for continue

and it hits the same breakpoint again if i hit enter to continue one more time it’ll do that

eventually it hits a different breakpoint and notice how the source code

moves down to the appropriate breakpoint so for me personally i kind of like to just regularly you

and then go back and forth between that and my code window.

But some people really love having both their code and GDB in the same terminal

so they don’t have to go back and forth between windows.

So if that’s you, then maybe CGDB is for you.

My little doggy wants to go pee.

Okay, that’s all I have for this video.

Thank you so much for watching,

and I hope you learned a little bit of stuff and had a little bit of fun.

I’ll see you in the next video.

Hey, everybody.

Hey everybody!

Thanks for watching this video again from the bottom of my heart.

I really appreciate it.

I do hope you did learn something and have some fun.

If you could do me a please, a small little favor,

could you please subscribe and follow this channel or these videos

or whatever it is you do on the current social media website

that you’re looking at right now.

It would really mean the world to me and it’ll help make more videos

and grow this community.

So we’ll be able to do more videos, longer videos, better videos,

or just i’ll be able to keep making videos in general so please do do me a kindness and uh and

subscribe you know sometimes i’m sleeping in the middle of the night and i just wake up because i

know somebody subscribed or followed it just wakes me up and i get filled with joy that’s exactly what

happens every single time so you could do it as a nice favor to me or you could you control me if

you want to just wake me up in the middle of the night just subscribe and then i’ll i’ll just wake

up i promise that’s what will happen also uh if you look at the middle of the screen right now you

of the screen right now you should see a qr code which you can scan in order to go to the website

which i think is also named somewhere at the bottom of this video and it’ll take you to my

main website where you can just kind of like see all the videos i published and the services and

tutorials and things that i offer and all that good stuff and uh if you have a suggestion for uh

clarifications or errata or just future videos that you want to see please leave a comment or

up what’s going on you know just send me a comment whatever i also wake up for those in the middle of

the night i get i wake up in a cold sweat and i’m like it would really it really mean the world to

me i would really appreciate it so again thank you so much for watching this video and um enjoy the

cool music as as i fade into the darkness which is coming for us all

Thank you.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply