Live data from Hacker News

GDB 7.11 released

lists.gnu.org

21–30 of 39 posts

Re: GDB 7.11 released

#21
post #11
post #9

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...

Use DDD instead. https://www.gnu.org/software/ddd/

Or Nemiver:

https://en.wikipedia.org/wiki/Nemiver

Re: GDB 7.11 released

#22
post #9

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...

I launch gdb in "batch mode" from a shell file with "gdb --batch -x command.txt" to get the callstack under exception.

https://github.com/vmorgulys/sandbox/blob/master/stackcity/t...

    set pagination off
    catch throw
    run
    bt 50
    quit

Re: GDB 7.11 released

#23
post #9

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...

Have you tried to use GDB from emacs? It's like Visual Studio

Re: GDB 7.11 released

#24
post #16
post #9

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...

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: https://www.youtube.co…

There is also gdb's built in tui mode. You can activate it with gdb -tui or keyboard shortcut C-x C-a.

Re: GDB 7.11 released

#25
post #9

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...

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.

Re: GDB 7.11 released

#26

Earlier quoted context omitted.

You still work for TicketMaster or was it long ago ?

Take a look at Terry's project if you don't know it yet: http://www.templeos.org/

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.

Re: GDB 7.11 released

#27
post #16
post #9

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...

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: https://www.youtube.co…

Thank you! Thus is exactly what I've been looking for.

Re: GDB 7.11 released

#28
post #9

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...

Have you tried to use GDB from emacs? It's like Visual Studio

Ha! It's nothing like Visual Studio. GIMP is closer to Photoshop than Emacs + GUD/GDB is to Visual Studio.

However, I do use Emacs with GUD and it works okay. If you are addicted to VI-style editing (like myself), you can use viper.

You'll want to add some keybinding to your .emacs. The following are the VS6 bindings I use:

;; Add VisualStudio-style debugging keys

;; Add convenient "until" command to gdb mode (swiped off the web)

(add-hook `gdb-mode-hook

        (lambda ()

         (gud-def gud-until "until %f:%l" "C-u" "Execute until current line.")))

;; Add a "jump" command (supposed to have been included in gud.el)

(add-hook `gdb-mode-hook

        (lambda ()

         (gud-def gud-jump "tbreak %f:%l\njump %f:%l" "\C-j" "Relocate next instruction to line at point in source buffer.")))

(global-set-key [f9] 'gud-break)

(global-set-key [f11] 'gud-step)

(global-set-key [f10] 'gud-next)

(global-set-key [f5] 'gud-cont)

(global-set-key [\S-f11] 'gud-finish)

(global-set-key [\C-f10] 'gud-until)

(global-set-key [\C-\S-f10] 'gud-jump) ; Equivalent to VC's Set Next Statement

Re: GDB 7.11 released

#30
post #9

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...

I think the best debugging option on the market is the Emacs gdb integration. It truly is quite remarkable.
Post reply on HN