4 ms·
“The most effective debugging tool is still careful thought, coupled with judiciously placed print statements.” — Brian Kernighan, “Unix for Beginners” (1979)
by bitlax 4y ago
“The most effective debugging tool is still careful thought, coupled with judiciously placed print statements.” — Brian Kernighan, “Unix for Beginners” (1979)
- MonkeyClub 4y agoThe evolution of a word while it remains still is interesting here: Brian's 1979 "still" is a whole world away from Paul's founder's. Still, it remains easier to print a value than to reach for gdb. But once you have gdb going, it is easier to do in depth fine surgery with gdb than littering your code with printfs. Now it seems the two worlds are entangled and I'm confused. C-x #n
- greenyoda 4y ago> Brian's 1979 "still" is a whole world away... Indeed. In 1979, the debugger in Version 7 Unix, called "adb", was quite primitive by today's standards. For example, you couldn't even set a breakpoint at a specific line of a C function, only at the function's entry point. For the "adb" documentation, see Volume 2A of the Unix Version 7 doc: https://plan9.io/7thEdMan/v7vol2a.pdf https://plan9.io/7thEdMan/v7vol2a.pdf On page 314 it says: "C does not generate statement labels. Therefore it is currently not possible to plant breakpoints at locations other than function entry points without a knowledge of the code generated by the C compiler." I.e., you'd have to delve into the machine code to find the address of the first machine instruction of your C statement if you wanted to put a breakpoint there. Debuggers have come a long way since then.