CppCon 2016: Greg Law “GDB - A Lot More Than You Knew'

preview_player
Показать описание


If you’re writing C++ for anything other than Windows, chances are that you occasionally break out GDB. This session presents some of the lesser known features of GDB that can change the way you debug. GDB has come a long way in the last few years and now does so much more than break, print, step and continue. Reversible debugging; Non-Stop Mode; Multi-process Debugging; and Dynamic Printf are but some of its best features, and its built-in Python scripting is particularly powerful. Join Undo co-founder and CEO, Greg Law, as he takes you through a series of demos to show some amazing tricks with GDB and some of its powerful new (and not-so-new) features that you may not have heard of.

Greg Law
CEO, Undo Ltd
Greg is a software geek at heart, but likes to keep one foot in the software world and one foot in the business world. He finds it particularly rewarding to turn innovative software technology into “real” business development. Greg has over 20 years of experience in both academia and innovative start-up software companies. In 2005 he co-founded Undo Software, which he now runs.

*-----*
Рекомендации по теме
Комментарии
Автор

You can switch between the TUI windows using C-x o, i.e. Ctrl+X, then hit the O key. If you think GDB is hard to use, try the DDD graphical frontend. DDD can also display data structures with arrows pointing to where the pointers are pointing.

ximalas
Автор

For programmers nowadays though, you face the reality that a good proportion of the rest of your life will be spent finding and fixing bugs in other peoples code.

johangamb
Автор

I find that when I want to use the up and down arrows to go to previous commands in the TUI, it works best to first type `focus cmd`. Switching back is `focus src`. For instance, this makes exploring the structure of some struct easier.

justinbassett
Автор

Some of the gdb version do not support reverse-step debugging. In that case you could add a signal handler for SEGV and set a brake point over there. Once SEGV function hanlder is hit, just type "bt" then it will provide nice information.

gowrishankars
Автор

This video has made me understand why people dislike gdb. Thanks.

AGBuzz
Автор

cgdb is the tool for me. It is very like gdb tui mode but it has syntax highlighting. It also has vim-like keybindings, you can scroll through the whole file you are on, set breakpoints on any line using space. And of course use the plain old gdb commands.

It's also been less buggy for me than gdb tui mode.

Then again I rarely use a debugger, but when I do cgdb is the one for me!

ericcurtin
Автор

Super usefull after 40 min mark!! On finding occasionsl bugs

kippie
Автор

Interesting video, but I have to report that around 30:20 your asctime function in dump_student is producing a wrong output. It says "Sun Oct 2 09:30:00 2000" (which is the birthday of my daughter, so i remember it very well) and October 2, 2000 was a Monday. I guess asctime is wrong in decoding if 2000 was a leap year or not and obviously estimates that 2000 wasn't a leap year, because it can be divded by 100. But it missed the exception that its a leap year because it also can be divided by 400. ;-)

koenighaunstetten
Автор

Most of the keystrokes are emacs navigation and window organisation keystrokes.

lrochfort
Автор

Who woulda known i could just hit Ctrl X A

mrlithium
Автор

Thank you, Greg, for the nice presentation! I have learned a lot from it. I wish you have commented on the error message appearing at 52:04: "Process does not support instruction 0xc5". This is a show-stopper for me, preventing me from using reverse debugging with GDB of virtually any code. But apparently, you managed to use the recording somehow in a batch mode. I cannot explain how it is possible if your GDB is susceptible to same problems as mine.

ViatcheslavBugayov
Автор

Should be called: "Making GDB suck less with Python"

mrlithium
Автор

A vim guy trying to use a program with Emacs bindings. Funny!!!

michaelkohlhaas
Автор

I came here to find out how to have GDB help med develop something on linux. You know what.. it's actually faster developing the entire thing on windows, cross platform, and then deploying after you've tested all your logic in a proper tool. This is .. fucking ... horrible. People _use_ this?!

origamibulldoser
Автор

I don't see the value of using python. BTW: Can't stand Python! It is FORTRAN to me.

kippie
Автор

This would have been impressive in 1987, but today... Greg should sneak a peek to Visual Studio.

mothafucka