I am interested in devoting a good amount of time to improving my debugging ability and am looking for a list of core topics that I need to cover in order to be versed in the principles of commonly used and advanced debugging/testing techniques.
Initially, I figured I would just read through the gdb documentation and glean debugging techniques from its functionality; however, other than jumping into it to get the line number of a segfault and maybe running bt
, months later I am still resorting to mass printf
's as my default strategy. I feel this is because I don't have any well defined strategies that I could effect through more sophisticated means.
Although my question is in relation to C/C++, and although I operate within a UNIX environment, I would be willing to look at generalized material, or even topics covered in other languages if they will improve my understanding of key concepts.
Isolate the source of the bug. Identify the cause of the bug. Determine a fix for the bug. Apply the fix and test it.
Debugging is a methodical process of finding and reducing the number of bugs (or defects) in a computer program, thus making it behave as originally expected.
Debugging, in computer programming and engineering, is a multistep process that involves identifying a problem, isolating the source of the problem, and then either correcting the problem or determining a way to work around it. The final step of debugging is to test the correction or workaround and make sure it works.
You have multiple direct strategies which you should consider:
More generally, the following points, although not directly related to debugging, will benefit you:
git bisect
available to you).If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With