comp.lang.ada
 help / color / mirror / Atom feed
From: "REH" <spamjunk@stny.rr.com>
Subject: program_error
Date: 29 May 2006 09:12:38 -0700
Date: 2006-05-29T09:12:38-07:00	[thread overview]
Message-ID: <1148919158.370302.292760@38g2000cwa.googlegroups.com> (raw)

Can anyone see a problem with this code?  It works fine with GNAT, but
GreenHills raises a program_error exception on the 'write line.  I am
trying to write an exception occurrence to a simple memory stream.  It
doesn't seem to even make it into my streams write procedure.  I also
tried changing the code to use an exception ID instead, but fails in
the same way.

Thanks,

REH


with Text_IO; use Text_IO;
with Ada.Exceptions;
with Asp.Rpc.Memory_Stream;
procedure hello is
  package MS renames Asp.Rpc.Memory_Stream;

  S : aliased MS.Stream_Type(1000);
begin
  put_line("Main starting...");

  begin
    raise Constraint_Error;
  exception
    when O : others =>
      Put_Line("Exception caught in block: " &
        Ada.Exceptions.Exception_Name(O));

        Ada.Exceptions.Exception_Occurrence'Write(S'Access, O);
  end;

  put_line("Main done.");
exception
  when O : others =>
     Put_Line("Exception caught in Main: " &
       Ada.Exceptions.Exception_Name(O));
end;




             reply	other threads:[~2006-05-29 16:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-29 16:12 REH [this message]
2006-05-31 19:44 ` program_error REH
replies disabled

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