"catch throw" doesn't work for me:

$gdb
Current directory is /home/Projects/biblio/build/linux_debug/
GNU gdb (GDB) 7.0.1-debian

(gdb) catch throw
Function "__cxa_throw" not defined.
Catchpoint 1 (throw)
(gdb) run
Starting program: /home/Projects/biblio/build/linux_debug/test_one_harness.exe 
[Thread debugging using libthread_db enabled]
[New Thread 0xb5c8cb90 (LWP 6072)]
[Thread 0xb5c8cb90 (LWP 6072) exited]
   Total Tests Run:  1

   Successful Tests: 0

   Failed Tests: 0

   Unexpected Errors: 1
      Test_Import_Format_1: 
      Nominal: 
      **CONSTRAINT_ERROR** : 
               Index is out of range


Program exited normally.

------

It should have stopped at the point where CONSTRAINT_ERROR was raised.

This code is compiled with gnat 4.4.3-1.

Using gdb from the GNAT GPL 2009 distribution does not fix the problem.

Compiling with gnat from GNAT GPL 2009 does fix the problem:

with Ada.Text_IO; use Ada.Text_IO;
procedure Test_Exception
is begin
   Put_Line ("hi");
   raise Constraint_Error with "bye";
end Test_Exception;

$ /opt/gnat/2009/bin/gnatmake test_exception
gcc -c test_exception.adb
gnatbind -x test_exception.ali
gnatlink test_exception.ali
ste...@shevek$ ./test_exception
hi

raised CONSTRAINT_ERROR : bye

ste...@shevek$ /usr/bin/gdb test_exception
GNU gdb (GDB) 7.0.1-debian
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/stephe/Ada_Work/test_exception...done.
(gdb) break exception
"exception" is not a function
(gdb) catch exception
Catchpoint 1: all Ada exceptions
(gdb) catch exception constraint_error
Note: breakpoint 1 also set at pc 0x8054dff.
Catchpoint 2: `constraint_error' Ada exception
(gdb) run
Starting program: /home/stephe/Ada_Work/test_exception 
hi

Catchpoint 1, CONSTRAINT_ERROR at <__gnat_debug_raise_exception> (e=0x80745b4) 
at s-except.adb:47
47      s-except.adb: No such file or directory.
        in s-except.adb
Current language:  auto
The current source language is "auto; currently ada".

------

So the problem appears to be in gnat, not in gdb.

-- 
-- Stephe



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to