4 ms·
It has little to do with IDEs and everything to do with debuggers. When writing code in emacs or vim, as long as you compile with -g and run the binary with gen
by mort96 8y ago
It has little to do with IDEs and everything to do with debuggers. When writing code in emacs or vim, as long as you compile with -g and run the binary with gen, you get the features you're talking about.
- pjmlp 8y agoUnless you are speaking about something like DDD, not really. Also it has to do with IDE, because in an IDE there is two way communication between both tools, like the ability to do edit-and-continue.
- mort96 8y agoLook at this: https://news.ycombinator.com/item?id=17310418 https://news.ycombinator.com/item?id=17310418 It's not quite as fancy as an IDE, but it's a lot more than printf.
- deleted 8y ago[deleted]
- oblio 8y agoCould you show a screenshot?
- mort96 8y agoHere's a recording of using GDB: https://s.mort.coffee/d/vid/gdb-demo.mp4 https://s.mort.coffee/d/vid/gdb-demo.mp4 Here's a recording of using GDB's TUI mode: https://s.mort.coffee/d/vid/gdb-tui-demo.mp4 https://s.mort.coffee/d/vid/gdb-tui-demo.mp4 Note that I'm not a GDB pro, I just recently started trying to use it more instead of printf, so there are probably lots of stuff I didn't show off. (For example, I wish I'd shown the `bt` command to print stack traces). Another thing that's worth noting is that with GDB, if your program crashed and generated a coredump, you can use GDB to look at how everything was when it crashed, just like if you were debugging a running program. This is extremely useful on for example embedded systems where you don't have GDB installed, or when the crash is hard to reproduce.
- oblio 8y agoI know that GDB is powerful and scriptable and very useful in environment where you don't have anything else. But I'm sorry to say, what you showed wasn't very discoverable and the UI was faaar from amazing. I don't know if you've tried it, but whenever you have a bit of time try Visual Studio's (or even Visual Studio Code's) debugger. They're among the best visual debuggers out there. Or IntelliJ's. You see directly all the variables as you step through code, you can see array contents directly, they're super discoverable, etc. It's such a shame that there's no glory (or money) to be had in designing CLI/TUIs. I also get the impression that it would be really hard to change things, OSS maintainers have a reputation for being very stubborn about workflow changes (sometimes for good reasons, sometimes not) :(
- camgunz 8y agoGDB's main power is that it's scriptable. You can track down some pretty gnarly bugs with that. You don't necessarily need that capability for languages like JS, because there's far less danger of getting into serious trouble (stack corruption, etc.), so it's hard to appreciate. But yeah, discoverable it is not haha.
- pjmlp 8y agoAll major Java and .NET IDEs have debugging APIs as well. As for the data visualizers, as mentioned, with Java and .NET I can do it with a bit of annotations and the debugger takes it from there. Or in C++'s case when using Visual Studio, a bit of XML describing the metadata.
- camgunz 8y agoOh yeah, totally true. All I meant was GDB's power interface is scripting. I definitely think IDE debuggers are better.
- TickleSteve 8y agoThats just a textual display of the structures, not a different presentation (i.e. a graphical tree or table, allbeit in text mode). BTW: In GDB, all commands have shortcuts i.e. 'b'=='break'. (Saves a lot of time).
- earenndil 8y agoWhat's gen? It's not very googlable ('gen debugger' gives nothing relevant), and asking my package manager for a package providing 'gen' just gives some game.
- mort96 8y agoOh wow, I didn't notice that. I wrote gdb, but my phone autoincorrected it to gen.