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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a5202a01c1c35a2b,start X-Google-Attributes: gid103376,public From: durif_philippe Subject: Problem with gnatgdb and "break exception" Date: 1999/09/22 Message-ID: #1/1 X-Deja-AN: 528160344 Organization: Universite des Sciences et Technologies de LILLE, France Newsgroups: comp.lang.ada Date: 1999-09-22T00:00:00+00:00 List-Id: Hello, Using Gnat, I'd like to be able to see the content of the stack (subprogram called, line number, ...) when an unhandled exception occurs and stop my program (with Alsys/Aonix Ada this is a "standard" and extremely usefull feature). It seems that gnatgdb could do that (with "break exception unhandled") and I tried it but did'nt get any good information. Precisely : uname -a Linux saison.lifl.fr 2.2.5-15 #1 Mon Apr 19 23:00:46 EDT 1999 i686 unknown rpm -q -a |grep -i gnat gnat-3.11p-1-14 gnat-3.11p-devel-1-14 Here is my test program : cat essai.adb procedure essai is procedure q (S : STRING ; I : INTEGER) is begin raise Constraint_Error ; end q ; procedure p (S : STRING ; I : INTEGER) is begin q (S & '*', 2*I) ; end p ; begin p ("chaine", 12) ; end essai ; Here is how I compiled it : gnatmake -v -g essai GNATMAKE 3.11p (981118) Copyright 1995-1998 Free Software Foundation, Inc. "essai.ali" being checked ... -> "essai.adb" time stamp mismatch gnatgcc -c -g essai.adb gnatbind -x essai.ali gnatlink -g essai.ali ls -l essai -rwxr-xr-x 1 durif rd2p 24845 Sep 22 10:35 essai* The execution : essai raised CONSTRAINT_ERROR The debugging : [saison-/home/rd2p/durif/cl/tp/linux] gnatgdb essai GNU gdb 4.17.0.11 with Linux and GNAT 3.11p support Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-Ada-linux"... (gdb) show language The current source language is "auto; currently ada". -- ok (gdb) (gdb) begin Function "__gnat_break_start" not defined. -- strange, try something else (gdb) break essai Breakpoint 1 at 0x80490cb: file essai.adb, line 11. -- ok (gdb) (gdb) directory /usr/lib/gcc-lib/i386-Ada-linux/2.8.1/adainclude/ Source directories searched: /usr/lib/gcc-lib/i386-Ada-linux/2.8.1/adainclude:$cdir:$cwd -- ok (gdb) (gdb) run Starting program: /.automount/home/rd2p/durif/cl/tp/linux/essai Breakpoint 1, essai () at essai.adb:11 11 p ("chaine", 12) ; -- ok (gdb) (gdb) break exception Breakpoint 2 at 0x40081850: file a-except.adb, line 868. -- ok (gdb) (gdb) continue Continuing. Breakpoint 2, <__gnat_raise_nodefer_with_msg> (e=Cannot access memory at address 0x21.) at a-except.adb:868 868 procedure Raise_Current_Excep (E : Exception_Id) is -- ok (gdb) (gdb) backtrace #0 <__gnat_raise_nodefer_with_msg> (e=Cannot access memory at address 0x21. ) at a-except.adb:868 #1 0x40081aef in <__gnat_raise_with_msg> (e=Cannot access memory at address 0x11.) at a-except.adb:1031 -- nothing very helpfull (gdb) cont Continuing. Breakpoint 2, 0x80490e0 in essai () at essai.adb:11 11 p ("chaine", 12) ; -- I did'nt expect that ! (gdb) backtrace #0 <__gnat_raise_nodefer_with_msg> (e=0x401fbcb3) at a-except.adb:868 #1 0x40081b9b in ada.exceptions.reraise_occurrence_no_defer (x=@0x8048e4f) at a-except.adb:1066 #2 0x80490e0 in essai () at essai.adb:11 #3 0x8048e4f in main (argc=1, argv=0xbffff1a4, envp=0xbffff1ac) at b_essai.c:61 #4 0x401fbcb3 in __libc_start_main (main=0x8048e20
, argc=1, argv=0xbffff1a4, init=0x8048b5c <_init>, fini=0x8049128 <_fini>, rtld_fini=0x4000a350 <_dl_fini>, stack_end=0xbffff19c) at ../sysdeps/generic/libc-start.c:78 (gdb) cont Continuing. raised CONSTRAINT_ERROR Program exited with code 01. -- ok (gdb) I certainly missed something, but what ? Any help will be very appreciated ! Philippe Durif -- Philippe Durif, Directeur de l'IUP GMI de Lille | email: durif@lifl.fr bureau 330 bis, LIFL bat. M3 USTL | tel: 33 (0)3 20 43 42 66 59655 Villeneuve d'Ascq Cedex | fax: 33 (0)3 20 33 63 21 http://www.fil.univ-lille1.fr