comp.lang.ada
 help / color / mirror / Atom feed
* program_error
@ 2006-05-29 16:12 REH
  2006-05-31 19:44 ` program_error REH
  0 siblings, 1 reply; 2+ messages in thread
From: REH @ 2006-05-29 16:12 UTC (permalink / 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;




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: program_error
  2006-05-29 16:12 program_error REH
@ 2006-05-31 19:44 ` REH
  0 siblings, 0 replies; 2+ messages in thread
From: REH @ 2006-05-31 19:44 UTC (permalink / raw)


Thanks anyways.  It turns out they had a bug in there compiler.

REH




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-05-31 19:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-29 16:12 program_error REH
2006-05-31 19:44 ` program_error REH

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