4 ms·
> Watches printf > breakpoints if (condition) assert(0); then I use the debugger to tell me how it got there. > performance/profiling I use a sepa
by WalterBright 8y ago
> Watches
printf
> breakpoints
if (condition) assert(0);
then I use the debugger to tell me how it got there.
> performance/profiling
I use a separate tool for profiling:
https://dlang.org/dmd-windows.html#switch-profile https://dlang.org/dmd-windows.html#switch-profile
It's built in to the DMC++ and DMD compilers.
Sometimes I mess up the code a bit filling it up with debug code, but when I finally fix it it's git to the rescue.
I can be old fashioned when it comes to IDEs, but git really is a marvelous, paradigm-changing advance.
- barrkel 8y agoI like debuggers for things like examining variables from higher stack frames after a highly conditional break (where printf from every higher stack frame would be lost in noise), for stepping through abstractions (especially in C++, where there may be surprisingly amounts of hidden code executed in overloaded bits and pieces), and for hardware breakpoints (an approach for solving reproducible memory corruption: combine a deterministic memory allocator with memory breakpoints + counters).
- SeanBoocock 8y agoThis is a great comment. Most of the value I get out of using a debugger - I work in game dev - is from these, often in concert. Even before I start setting data breakpoints, though, I often find myself examining heap memory with the process paused to give myself sufficient context to do more informed exploration later. In the last year or so I've also started using Visual Studio's "action" breakpoints, a sort of runtime configurable printf, once I've identified areas of interest.