Debug faster with gdb layouts (TUI)

  Рет қаралды 26,854

Jacob Sorber

Jacob Sorber

3 жыл бұрын

Patreon ➤ / jacobsorber
Courses ➤ jacobsorber.thinkific.com
Website ➤ www.jacobsorber.com
---
Debug faster with gdb layouts (TUI) // If you ever get tired of typing list after every command in gdb, this is the video for you. Here, I describe the GDB Terminal User Interface (or TUI) which, many students don't realize is there. It allows you to see the C-source and assembly source while you step through your code, and the views are configurable through the layout command.
Related Videos:
GDB: • Learn GDB in 60 seconds
More GDB: • Automate repetitive de...
Even More GDB: • Debug Faster With Cond...
Curses: • ASCII Art, Curses, and...
***
Welcome! I post videos that help you learn to program and become a more confident software developer. I cover beginner-to-advanced systems topics ranging from network programming, threads, processes, operating systems, embedded systems and others. My goal is to help you get under-the-hood and better understand how computers work and how you can use them to become stronger students and more capable professional developers.
About me: I'm a computer scientist, electrical engineer, researcher, and teacher. I specialize in embedded systems, mobile computing, sensor networks, and the Internet of Things. I teach systems and networking courses at Clemson University, where I also lead the PERSIST research lab.
More about me and what I do:
www.jacobsorber.com
people.cs.clemson.edu/~jsorber/
persist.cs.clemson.edu/
To Support the Channel:
+ like, subscribe, spread the word
+ contribute via Patreon --- [ / jacobsorber ]
Source code is also available to Patreon supporters. --- [jsorber-youtube-source.heroku...]

Пікірлер: 57
@subhashisghose
@subhashisghose 3 жыл бұрын
Thank You for demonstrating the TUI in GDB. This is going to be Helpful.
@JacobSorber
@JacobSorber 3 жыл бұрын
You're welcome. Glad I could help.
@drvanon
@drvanon 3 жыл бұрын
Not having known about this before, you have just revolutionized my debugging experience!
@diceandbricks
@diceandbricks 3 жыл бұрын
Cool. I didn't know about that. Been coding for 30 years and still learning. That's why I like your channel.
@JacobSorber
@JacobSorber 3 жыл бұрын
Me too. Glad I could help.
@bzboii
@bzboii 3 жыл бұрын
I used this trick when doing my bomblab assignment. Helps so freaking much. A big tip here is also that control+L refreshes the TUI, as it often gets weirdly "corrupted" and needs often refreshing.
@sayori3939
@sayori3939 3 ай бұрын
The command "ref" does the same
@smartkorean1
@smartkorean1 Жыл бұрын
This is amazing! Had no idea this was a feature and I've been painfully using GDB this entire semester....
@JannisAdmek
@JannisAdmek 3 жыл бұрын
Nice video and happy new year to all fellow C programmers!
@JacobSorber
@JacobSorber 3 жыл бұрын
Happy new year!
@virajcz7143
@virajcz7143 Жыл бұрын
This is so good! Thank you so much!
@sakuyarules
@sakuyarules 11 ай бұрын
This is a godsend, thank you!
@zirkoni42
@zirkoni42 Жыл бұрын
Instead of "b main" & "r" you could just do "start". Also, instead of "layout next" use "layout src" (or whatever layout name you want).
@cernejr
@cernejr 3 жыл бұрын
Short AND helpful. :)
@anonymousvevo8697
@anonymousvevo8697 3 жыл бұрын
You are a hero !
@asadkhasanov1056
@asadkhasanov1056 3 жыл бұрын
Fantastic!
@huyibao
@huyibao Жыл бұрын
thank you for gdb demo.
@mohammadhosseinzolfagharna8106
@mohammadhosseinzolfagharna8106 Жыл бұрын
I always respected my professors at university and learned many things from them, but I think I have learned even more from you. Thank you professor and please keep on your valuable online courses.
@arsrivaszaredan8217
@arsrivaszaredan8217 3 жыл бұрын
thanks a lot!!!!
@grahamjoss4643
@grahamjoss4643 3 жыл бұрын
wow. where have you been all my life ...
@johnybaker9878
@johnybaker9878 3 жыл бұрын
Hi Jacob, can you do tutorial, maybe share some tweaks on how to better understand other people's code, especially when it's a big project with a lot of .c and .h files? Thanks.
@rodolfodirack1246
@rodolfodirack1246 3 жыл бұрын
I would like that to!
@ladyViviaen
@ladyViviaen 3 жыл бұрын
its gdb time
@chrisfahed8361
@chrisfahed8361 3 жыл бұрын
Would you please make a video about Math in embedded systems and btw very helpful videos keep going
@benjaminshinar9509
@benjaminshinar9509 3 жыл бұрын
i was aware of tui, but not of changing layouts. and the nexti,stepi could be huge!
@JacobSorber
@JacobSorber 3 жыл бұрын
Yeah, I don't use them ever day, but when they're useful...they're REALLY useful.
@vanowik7518
@vanowik7518 3 жыл бұрын
There are extensions to gdb like pwndbg or peda that make it much more friendly.
@synfuel
@synfuel 3 жыл бұрын
I think it would be great if you made a discord server. Just for people to share and learn from others and it would be easier to help people.
@halavich9672
@halavich9672 3 жыл бұрын
Seems to be awesome
@maiconfaria
@maiconfaria 3 жыл бұрын
Would be nice to have some tool to visualize and compare big arrays on GDB
@vladimir_k_bestplayerna1217
@vladimir_k_bestplayerna1217 Жыл бұрын
I see that you can also see the values stored in the registers live. Is it possible to have all 3 shown at once? C code, Assembly, and register values?
@marusdod3685
@marusdod3685 3 жыл бұрын
I usually just press ctrl-x-a
@NxNx-gb3hp
@NxNx-gb3hp 3 жыл бұрын
Hi, tnx 4 ur awesome tutorials. Can u make a tutorial on how to build an ISO imagine of a Linux kernel from Linux source code that can actually be used in virtualbox
@giacomog1128
@giacomog1128 2 жыл бұрын
do you know if there's a layout gdb for java programs?
@testshar2117
@testshar2117 2 жыл бұрын
Does this command works in putty session? What to do if it doesn't?
@rafalmichalski4893
@rafalmichalski4893 3 жыл бұрын
Hi Jacob. How did you split these two views: C and Assembler ?
@pumpkin3586
@pumpkin3586 3 жыл бұрын
At 2:19 you see that with "layout next" you can find the layout you are looking for.
@JannisAdmek
@JannisAdmek 3 жыл бұрын
depending on the terminal, you might not have curses support, specially Windows Comand line doesn't have curses support as far as I know.
@JacobSorber
@JacobSorber 3 жыл бұрын
Thanks, Jannis. Yes, you need curses support for this to work. Also, if you don't want to cycle through the layouts, and you know which one you want, just type "layout split" to get the split layout, or "layout src" for just the source and command views.
@fmontserrattube
@fmontserrattube 2 жыл бұрын
I have this "m68k-elf-gdb.exe" gdb client wich i use to debug 68k assembly, but it does not support tui....i've been trying to recompile it whit added support with no luck, any idea on how to enable tui in this version???
@stelluspereira
@stelluspereira 6 ай бұрын
BTW, GDB in MacOS Venura Gives error , some odd libraries permissions error for setting break points
@dusankolak4359
@dusankolak4359 3 жыл бұрын
is there a way for me to display stack at every step? or have a window dedicated to stack? instead of typing bt full every step. thanks for the video!
@JacobSorber
@JacobSorber 3 жыл бұрын
Of course. 😀type "define hook-stop". Then type in "bt", then "end". Now, every time your program stops, gdb will run "bt" for you.
@dusankolak4359
@dusankolak4359 3 жыл бұрын
@@JacobSorber thank you very much!!!
@dusankolak4359
@dusankolak4359 3 жыл бұрын
@@JacobSorber thanks for this again. just passed my exam with highest marks and i used gdb to debug. define hook-stop helped me speed things up so much!
@realdragon
@realdragon 5 ай бұрын
Cannot enable the TUI: error opening terminal [TERM=xterm-256color]
@paullemmermann5993
@paullemmermann5993 3 жыл бұрын
Can you do a tutorial about Radare2?
@JacobSorber
@JacobSorber 3 жыл бұрын
Yeah, probably. I'll add it to my topic list and see what I can do down the road. Thanks.
@MarquisDeSang
@MarquisDeSang Жыл бұрын
It is better to use GDB inside EMACS with the full 6 viewports.
@dontaskme1625
@dontaskme1625 3 жыл бұрын
don't apologize that it was a short video, everyone who clicks on the video sees it before they click ;)
@yash1152
@yash1152 2 жыл бұрын
1:36 TUI
@freddieventura4382
@freddieventura4382 Жыл бұрын
Really not much information in this video but just introducing a bit the feature
@mikeyamaro9035
@mikeyamaro9035 3 жыл бұрын
bruuhh arm-aebi-none-gdb 2020 doesnt support tui.
@AJ-fo3hp
@AJ-fo3hp 3 жыл бұрын
Linux has still in olden days debugging techniques, this is seem to be tedious debugging as well less devolper friendly
@JacobSorber
@JacobSorber 3 жыл бұрын
Today's terminal debuggers (gdb, lldb) definitely aren't perfect, but after using dozens of different debugging tools, it's amazing how a quick gdb session (with a reasonably good .gdbinit file) is still often the fastest option for me. There's definitely a learning curve.
@Maranello988
@Maranello988 3 жыл бұрын
VIM, GCC, GDB The rest is unnecessary :)
@angelcaru
@angelcaru 15 күн бұрын
You forgot MAN
Debugging Embedded Systems With GDB?
13:51
Jacob Sorber
Рет қаралды 42 М.
How does fork work with open files?
13:12
Jacob Sorber
Рет қаралды 9 М.
3 wheeler new bike fitting
00:19
Ruhul Shorts
Рет қаралды 35 МЛН
La revancha 😱
00:55
Juan De Dios Pantoja 2
Рет қаралды 57 МЛН
PINK STEERING STEERING CAR
00:31
Levsob
Рет қаралды 20 МЛН
Would you like a delicious big mooncake? #shorts#Mooncake #China #Chinesefood
00:30
C++ vs Rust: which is faster?
21:15
fasterthanlime
Рет қаралды 376 М.
Running a Buffer Overflow Attack - Computerphile
17:30
Computerphile
Рет қаралды 2 МЛН
GDB Debugging: How to Debug a C/C++ program
18:07
pikuma
Рет қаралды 35 М.
GDB Tutorial
55:12
CS 246
Рет қаралды 62 М.
Defining Constants. Should I use CONST or #DEFINE?
7:59
Jacob Sorber
Рет қаралды 55 М.
Debugging with Core Dumps
9:16
Jacob Sorber
Рет қаралды 62 М.
Reverse Engineering w/GDB and Ghidra! | picoCTF 2022 #08 "Keygenme"
22:37
3 wheeler new bike fitting
00:19
Ruhul Shorts
Рет қаралды 35 МЛН