Linked by Thom Holwerda on Tue 28th Aug 2012 19:20 UTC, submitted by MOS6510
Thread beginning with comment 532912
To read all comments associated with this story, please click here.
To read all comments associated with this story, please click here.
It may look like "pseudo-REPL" but it just isn't one. Not even "pseudo". The whole point of REPL is that you write your program in it, and you get an incremental feedback as you do it. Think of it as of an IDE on steroids (one that really understands and executes your code). You simply can't do that in Gdb at all. Yes, you can analyze the program, but if you want to make any changes you have to go back to your editor and build system.





Member since:
2009-06-30
Gdb is a good tool for learning low-level representations of programs (not just these written in C). Nothing beats exploring memory/stack/data structure with your own hands. It can also be useful in debugging but at large scale it is less efficient than tracing.
But REPL? No way. Yes, gdb can perform some primitive C operations (arithmetics, dereferencing pointers) but that's about it. What about calling user-defined functions and defining them? Or, mallocing memory, connecting to the net, opening and parsing files? Even if all this was possible, C is simply too low level to make it a convenient way of writing programs.