5 ms·
What makes it even worse is the lack of a REPL means that between each change you need to recompile. In any large program this is going to take minutes and they
by dkhenry 14y ago
What makes it even worse is the lack of a REPL means that between each change you need to recompile. In any large program this is going to take minutes and they add up. A simple GDB invocation is not only a better way of tracking it down, but can potently save hours.
- vlisivka 14y agoWhen QA will found bug in your program in testing or staging environment, they will send you your logs, which will be empty. They will not allow you to use testing or staging (or production :-) ) for development.
- tmurray 14y agoquick changes that don't require a full recompilation generally mean intermediate files are lying around, which means you only need to recompile changed files and relink. this is usually pretty fast until you start changing headers or something like that. (I'm very used to projects with 30 minute plus full compile times taking less than 10 seconds to recompile and relink single-file changes.) this is not to say that gdb won't save hilarious amounts of time or that you can be a good C coder without understanding a debugger (I don't think you can), just that the huge compile time thing isn't true most of the time.
- rll 14y agoWell, ccache helps a lot with that. And sometimes it becomes easier to throw an __asm__("int3"); into your code than try to massage gdb into breaking at the exact right spot in your code and only under certain conditions.
- apaprocki 14y agoUse of __builtin_trap() (GCC) or raise(SIGTRAP) would be a lot more portable.