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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,9de1846d24cd5fa4,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-27 05:29:38 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeed.gamma.ru!Gamma.RU!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!gate.dornier.dasa.DE!not-for-mail From: Joachim =?ISO-8859-1?Q?Schr=F6er?= Newsgroups: comp.lang.ada Subject: Bug in GNAT.Traceback.Symbolic? Date: Tue, 27 Aug 2002 14:29:42 +0200 Message-ID: <3D6B70B6.8040203@dornier.eads.net> NNTP-Posting-Host: gate.dornier.dasa.de (53.122.46.165) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: fu-berlin.de 1030451377 53181457 53.122.46.165 (16 [76083]) User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.6) Gecko/20011120 X-Accept-Language: en-us Xref: archiver1.google.com comp.lang.ada:28443 Date: 2002-08-27T14:29:42+02:00 List-Id: Hello all, I have a problem using Gnat.Traceback.Symbolic (Win2000). A stream based read procedure shall do a 2 step error handling. First when an error is encountered the reason is appended to an Exception_Occurrence by Ada.Exceptions.Raise_Exception. On a higher level were the file object is known a local handler shall append the filename and the file index to the message by first retrieving the information including the symbolic stack by Ada.Exceptions.Exception_Information(E) & Gnat.Traceback.Symbolic.Symbolic_Traceback(E) and then appending the file info and calling Raise_Exception again. The problem is: The first call to Symbolic_Traceback does not contain the symbolic information. Appended info: - Code excerpts - Stacktrace output using Symbolic_Traceback(E) in the main - gcc and gnatmake options (gnat.ago) Is there something else then "-bargs -E" necessary??? ---------------------------------------------------------------- exception when Error : others => Add_Info_Close_Reraise(Error, File); end Read; ---------------------------------------------------------------- procedure Add_Info_Close_Reraise (Error : in Ada.Exceptions.Exception_Occurrence; File : in out Ada.Streams.Stream_Io.File_Type) is begin if Ada.Streams.Stream_Io.Is_Open(File) then declare Name : constant String := Ada.Streams.Stream_Io.Name(File); Index : constant Natural := Natural(Ada.Streams.Stream_Io.Index(File)); Info : constant String := Portable.Utils.Exception_Information(Error); begin Ada.Streams.Stream_Io.Close(File); Ada.Exceptions.Raise_Exception (E => Ada.Exceptions.Exception_Identity(Error), Message => Info & Os.New_Line & "File: " & Name & ", Index: " & Natural'Image(Index)); end; else Ada.Exceptions.Reraise_Occurrence(Error); end if; end Add_Info_Close_Reraise; ---------------------------------------------------------------------------- with Gnat.Traceback.Symbolic; package body Portable.Utils is ---------------------------------------------------------------------------- function Exception_Information(E : in Ada.Exceptions.Exception_Occurrence) return String is begin return Ada.Exceptions.Exception_Information(E) & Gnat.Traceback.Symbolic.Symbolic_Traceback(E); end Exception_Information; ---------------------------------------------------------------------------- end Portable.Utils; ---------------------------------------------------------------------------- ******** First traceback without symbolic info!!! C:\Ada95\source\Projects\MST_SA\Geo>test_dted_io E:\dted\DTED\E000\N46.dt1 Exception name: GEO.DTED.IO.DTED_FILE_ERROR Message: Exception name: GEO.DTED.IO.DTED_FILE_ERROR Message: unexpected string, ' D' read, expected 'DSI' File: E:\dted\DTED\E000\N46.dt1, Index: 82 Call stack traceback locations: 0x4488c3 0x44e140 0x4 Call stack traceback locations: 0x449be6 0x450a21 0x410ae0 0x410bc6 0x401401 0x401103 0x77e8ca8e 00449BE6 in geo.dted.io.add_info_close_reraise at geo-dted-io.adb:570 00450A21 in geo.dted.io.read at geo-dted-io.adb:1088 00410AE0 in test_dted_io.test_dted at test_dted_io.adb:86 00410BC6 in test_dted_io at test_dted_io.adb:103 00401401 in ?? at crt1.c:0 00401103 in ?? at crt1.c:0 77E8CA8E in ?? at fake:0 ---------------------------------------------------------------------------- ******** Only one exception occurrence!!! C:\Ada95\source\Projects\MST_SA\Geo>test_dted_io E:\dted\DTED\E000\N46.dt1 Exception name: GEO.DTED.IO.DTED_FILE_ERROR Message: unexpected string, ' D' read, expected 'DSI' File: E:\dted\DTED\E000\N46.dt1, Index: 82 Call stack traceback locations: 0x4488c3 0x44e140 0x450a9e 0x410ae0 0x410bc6 0x401401 0x401103 0x77e8ca8e 004488C3 in geo.dted.io.check at geo-dted-io.adb:400 0044E140 in geo.dted.io.read.read at geo-dted-io.adb:937 00450A9E in geo.dted.io.read at geo-dted-io.adb:1082 00410AE0 in test_dted_io.test_dted at test_dted_io.adb:86 00410BC6 in test_dted_io at test_dted_io.adb:103 00401401 in ?? at crt1.c:0 00401103 in ?? at crt1.c:0 77E8CA8E in ?? at fake:0 ---------------------------------------------------------------------------- ***** gnat options -O3 -I\ada95\source\lib\math -I\ada95\source\lib\math\arrays -I\ada95\source\lib\utilities -I\ada95\source\lib\portable -I\ada95\source\lib\portable\posix-win\src -I\ada95\compiler\gnat\bindings\win32ada -I\ada95\compiler\gnat\asis -I\ada95\source\projects\asis -I\ada95\bin\gnat -I..\mst -cargs -O3 -bargs -f -E -largs \ada95\compiler\gnat\asis\libasis.a \ada95\compiler\gnat\lib\libopengl32.a \ada95\compiler\gnat\lib\libglu32.a \ada95\compiler\gnat\lib\libglut32.a \ada95\compiler\gnat\lib\libgdi32.a \ada95\compiler\gnat\lib\libwsock32.a -I\ada95\source\lib\math -I\ada95\source\lib\math\arrays -I\ada95\source\lib\utilities -I\ada95\source\lib\portable -I\ada95\source\lib\portable\posix-win\src -I\ada95\compiler\gnat\bindings\win32ada -I\ada95\compiler\gnat\asis -I\ada95\source\projects\asis -I\ada95\bin\gnat -I..\mst WINDOWS_TARGET ----------------------------------------------------------------------------- Thanks for any help J. Schr�er