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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Gnat 2013 is out! Date: Tue, 27 Aug 2013 16:08:34 +0200 Organization: Ada @ Home Message-ID: References: NNTP-Posting-Host: Z+UZnJO9e89q1cqW+CZH4Q.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:16978 Date: 2013-08-27T16:08:34+02:00 List-Id: Le Fri, 31 May 2013 18:12:29 +0200, a =C3=A9crit: > May I ask, how you debug Ada programs? Do you use GNATbench 2.7 for = > that? I need a good debugging tool :-) I personally did not used a debugger since Borland Turbo Pascal. I first= = missed it (at that time GDB for C programs had issues on Windows 3.1), b= ut = quickly figured a debugger only show you one particular path in your = logic, and above all, consume a lot of your time to just follow this pat= h, = a lot of time which is not used to understand the properties of the whol= e. So instead of trying to fix something in a particular path =E2=80=94 ign= oring the = whole and so probably introducing a new bug elsewhere in the while =E2=80= =94 I = would say it's surely better to understand the whole and so not rely on = a = debugger. A debugger never gives you such a picture, only analysis and = understand gives this to you. When something really drives me crazy, I just add a =E2=80=9Csentinel=E2= =80=9D which = prints out some information (just requires an =E2=80=9Cwith Ada.Text_IO=E2= =80=9D and a = line added somewhere to print an =E2=80=9CElement'Image=E2=80=9D) I fill= to not track = correctly, to help me a bit. Then, back to global understanding as soon = as = possible. A program is not a single path and a particular property of a particular= = state as exposed by a debugger, it's multitude of possible paths and = general properties common to a multitude of possible states (that's what= = you have to track, not a single path). In short, a debugger gives you a = = wrong picture, except if you are at the very beginning and try to figure= = out what's a programming language and how a state machine (like a comput= er = is) works. Another issue, is that a program is not always running in a debugger, an= d = so what when something went wrong while it was not running in a debugger= = and you don't have a complete and exact snapshot of the program's state = = when it get wrong? Here, a logger surely help more than a debugger, as i= t = may be active all the time (most platform provides an API to help = automatically manage logs and avoid these logs to fill all of your stora= ge = space). -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity