OK, for someone who's written a lot of C++ in Visual Studio but is now developing on Linux: is it worth learning GDB? It seems like it'll always have some mental overhead compared to a visual debugger, but on the other hand I was never crazy about using an IDE...
Yes! Assuming you run it with --tui, otherwise you'll hate yourself forever.
It may seem to have some mental overhead at first because you have to type commands, but it becomes second nature after a while. IMHO, it has far less overhead than debuggers where you have to click everywhere. There's a reason why people don't really bother writing pretty frontends for it.
If you use an IDE for Linux development, its debugger actually talks to GDB behind the scene. You can ditch the middle man without trouble.
The only thing that DDD really excels at (when it doesn't crash because, uh, long story short, Motif) and you can't get straight from GDB is visual representation of linked structures.
In my experience, the cgdb [1] wrapper makes gdb a viable option, by providing what I think is the sorely missing piece in vanilla gdb: a window continuously showing the code context.
It also uses vim-like bindings for going into "insert" mode ("i"), versus escaping out into code context navigation mode ("ESC").
I made a short 4 minute tutorial on how to use gdb/cgdb for debugging Golang, here:
God God, yes. Five minutes is enough to learn how to get it going, add breakpoints, see the stack and interrogate variables. On a good day, you can fix a segFault faster than it would actually take you to spin up a visual debugger in an IDE or whatever.
Sure, it's not the right tool for every job, but as a simple, easy to use, ubiquitous and quick debugger, you'd do yourself a favour spending the five minutes learning how to start using it.
As others mentions the tui mode is very nice. Important thing to learn about using gdb is to write your .gdbinit file before running gdb. Write the commands like 'file <your-exe>', 'break <your-src>:<line-number>', 'catch throw', etc. and then run gdb. What I usually do when I need to set a breakpoint in a new place is I quit gdb, edit .gdbinit and start again. This way all breakpoints are always saved. gdb is better then most people think.
somewhat offtopic, but has anyone used lldb lately, when I last used it I found it much worse than gdb but I expect it will at somepoint surpass gdb (like the rest of LLVM has done to GNU (if you're on x86_64))
I think most of us know who Terry is, but it's the first time I see him mentioning TicketMaster. That said, the website does mention 1990 for TM, so I got part of my question. Thanks.
Good point. GNU tar requires using the correct option, -J, when extracting an xz-compressed tarball.
But OS X tar is bsdtar, which ignores -z and -J when extracting because it automatically recognizes compression and does the right thing. So it turns out both our suggestions happen to work on OS X.
A related question is: does it make sense to use this on OS X? lldb is certainly better integrated with the system, does gdb really have benefits that make up for that?