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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ddc669e8cf09b24 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-14 21:22:42 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: How to debug an Ada program From: James Rogers References: <3F1356DB.D9032D0@adaworks.com> Message-ID: User-Agent: Xnews/5.04.25 Date: Tue, 15 Jul 2003 04:22:42 GMT NNTP-Posting-Host: 12.86.35.56 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1058242962 12.86.35.56 (Tue, 15 Jul 2003 04:22:42 GMT) NNTP-Posting-Date: Tue, 15 Jul 2003 04:22:42 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:40277 Date: 2003-07-15T04:22:42+00:00 List-Id: Richard Riehle wrote in news:3F1356DB.D9032D0@adaworks.com: > Preben Randhol wrote: > >> Yes I agree with this. I rarely use gdb or gvd myself with Ada. Best way >> to trace a program line by line is reading the source :-) Sometimes when >> trying to get an understanding somebody else's program it can go a bit >> faster if you use a debugger to clear up some things though. > > Debuggers are not always for finding bugs. Sometimes, especially > for embedded systems, a debugger is useful for discovering just that > little bit more about the program you plan to deploy. HP used to have > a great little tool for the 1750A called the HP 65000 that served well > in this role. > > The HP 64000 was an in-circuit emulator with a decent debugger. One of the nice features of this tool was its use of dual-ported memory so that program trace data could be collected while the program was running at full speed. This allowed very accurate determination of full speed timing issues. The HP 64000 was available for a wide range of processors, mostly from Intel and Motorola. I first learned Ada while supporting the HP 64000 debugger. The debugger was primarily targeted to C, but also provided some Ada support. My job was to test the debug information produced by compilers and determine if they were correct. If a problem was found with the debugger I had to determine if the problem was a fault in the debug information or a fault in the compiler logic. The debug formats such as IEEE 695, contained a lot of data modes needed by C which could not be created by an Ada compiler. One that comes to mind is an incomplete forward reference. The Ada equivalent, which would not compile might be: package example is type forward; type forward_Access is access forward; end example; Note that type forward is never completed. Ada compilers will not generate code containing such problems. They will instead provide error messages and no object file. C compilers may produce a warning, but they will also produce an object file. When using the Aonix compiler several years ago I encountered a programmer who was very familiar with the Microsoft Visual C++ environment. The Aonix compiler produces debug data compatible with the Microsoft Visual debugger. The programmer learned Ada in about a week. He then customized his Visual Development Studio to work with Ada. He insisted that the Microsoft debugger worked better with the Aonix product than it did with the Microsoft Visual C++. One example was that he could see the elements of an array in Ada, while he could only see the address of the array using C++. Jim Rogers