From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.ada Subject: Re: Intervention needed? Date: Thu, 04 Apr 2019 00:22:13 -0700 Organization: A noiseless patient Spider Message-ID: <878swq2q1m.fsf@nightsong.com> References: <1e27ce78-217d-4adc-8380-30f6d4fc5fdc@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="cff84c890bb279f8787c0045c2641cc9"; logging-data="23107"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/qq92i59RQgyJfh4SRhT/0" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cancel-Lock: sha1:C0fF4UYrINHHyu3JhAQJIA7qZCc= sha1:oEMF9YAMj7NVzKRZEho4CAM6hLs= Xref: reader01.eternal-september.org comp.lang.ada:56072 Date: 2019-04-04T00:22:13-07:00 List-Id: Maciej Sobczak writes: > The major use for debuggers that I see is in integration testing, > where test procedures expect particular values in particular variables > (or even exact memory locations) in particular circumstances. You should really automate tests like that. I find debuggers very useful for understanding how an unfamiliar piece of poorly documented code works. What are the conditions when this function XYZ is called, and how does the program get there? Load the program into debugger, set breakpoint at XYZ, and run. What happens in case of this other input? Set breakpoint earlier, run with other input and single step to understand flow of the program, etc. There will always be logic errors in programs too. Sure you can debug them with print statements and recompiles, but debuggers and breakpoints basically give you a way to insert the print statements interactively and dynamically while the program is running. I managed to use gdb with Ada but I only tried it with a few simple and small programs. If there's trouble using it with bigger programs that's not good and I'd hope Adacore would address it.