comp.lang.ada
 help / color / mirror / Atom feed
From: franck <franckbehaghel@gmail.com>
Subject: Re: Addr2Line2Locations for GPS
Date: Tue, 19 Jan 2010 02:23:34 -0800 (PST)
Date: 2010-01-19T02:23:34-08:00	[thread overview]
Message-ID: <ccad3ad4-f9d4-4481-877f-23e4fb346f76@k17g2000yqh.googlegroups.com> (raw)
In-Reply-To: d5929bed-04b7-4a5e-95d4-3c12ab539dbc@q4g2000yqm.googlegroups.com

This may solve your problem :

use gnatmake -g  start -bargs -E to generate exe,
you will get :
--> start

Exception raised
Exception name: CONSTRAINT_ERROR
Message: start.adb:16 range check failed
0x804acdd in start.procedure_b at start.adb:16
0x804acbd in start.procedure_a at start.adb:21
0x804ab03 in start at start.adb:41
0x804a4d6 in main at b~start.adb:179
0xca1dea in ?? at ??:0
start :exception raised Exception name: CONSTRAINT_ERROR
Message: start.adb:16 range check failed
Call stack traceback locations:
0x804acdd 0x804acbd 0x804ab03 0x804a4d6 0xca1de

start.adb:
------


with Ada.Text_IO;
with Ada.Exceptions;
with GNAT.Exception_Traces; use GNAT.Exception_Traces;
with GNAT.Traceback.Symbolic;
procedure start is



procedure Procedure_B is
type Very_Small_Integer is range 0 .. 2;
My_Very_Small_Integer : Very_Small_Integer :=0;
begin

--warning: value not in range of type "Very_Small_Integer"
--warning: "Constraint_Error" will be raised at run time
My_Very_Small_Integer := 3;
end Procedure_B;

procedure Procedure_A is
begin
Procedure_B;
end Procedure_A;



begin
 -- reminder
 -- to compile this unit, use command :
 -- gnatmake -g  start -bargs -E

 -- -g => for gnatgcc debug information
 -- -E => for gnatbind Store tracebacks in exception occurrences when
the target supports it.
 -- This is the default with the zero cost exception mechanism. See
also the packages GNAT.Traceback and GNAT.Traceback.Symbolic

 -- GNAT init
 GNAT.Exception_Traces.Trace_On(GNAT.Exception_Traces.Every_Raise);
 GNAT.Exception_Traces.Set_Trace_Decorator
(GNAT.Traceback.Symbolic.Symbolic_Traceback'access);


Ada.Text_IO.Put_Line("--> start");
Procedure_A;
Ada.Text_IO.Put_Line("<-- start");

exception
when Error: others =>
   Ada.Text_IO.Put_Line ("start :exception raised " &
Ada.Exceptions.Exception_Information (Error));
end start;



  reply	other threads:[~2010-01-19 10:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-16  0:04 Addr2Line2Locations for GPS Hibou57 (Yannick Duchêne)
2010-01-16  2:25 ` Randy Brukardt
2010-01-16  4:40   ` Hibou57 (Yannick Duchêne)
2010-01-18  1:38   ` Hibou57 (Yannick Duchêne)
2010-01-16  8:45 ` Dmitry A. Kazakov
2010-01-18 10:59 ` Emmanuel Briot
2010-01-18 13:38   ` Hibou57 (Yannick Duchêne)
2010-01-19 10:23     ` franck [this message]
2010-01-19 13:49       ` Gautier write-only
2010-01-19 15:37         ` Ludovic Brenta
2010-01-19 15:49           ` Ludovic Brenta
2011-01-29 13:23 ` leandrohbatista
2011-02-02 16:46   ` Yannick Duchêne (Hibou57)
2011-02-03  9:19     ` leandrohbatista
2011-02-03 13:40       ` Yannick Duchêne (Hibou57)
2011-02-03 14:00         ` Yannick Duchêne (Hibou57)
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox