comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: I've not seen this error before
Date: Wed, 01 Apr 2015 14:08:33 +0100
Date: 2015-04-01T14:08:33+01:00	[thread overview]
Message-ID: <lyk2xw0ze6.fsf@pushface.org> (raw)
In-Reply-To: cc93eff7-3f97-49f9-a117-0908223e3a79@googlegroups.com

tonyg <tonythegair@gmail.com> writes:

> 2015-04-01 09:19:32.10 : Exception name: PROGRAM_ERROR
> Message: adjust/finalize raised PROGRAM_ERROR: device_type_pkg.ads:115 finalize/adjust raised exception
>
> the code is an ada specification
>
>  type Device_Details_Type is record
>       Device_Id : Device_Index_Type;
>       The_Device : Device_Class_Type;
>       Room_Id : Room_Id_Type;
>       The_Id : Domoticz_ID_Type;
>       Battery_Level : Battery_Level_Type;
>       Signal_Level : Signal_Level_Type;
>       Name : SU.Unbounded_String;
>       Last_Update : AC.Time;
>       Used : boolean ;
>       Successful_Initialisation : boolean := false;
>       Temperature : Temp_Xten_Type;
>       Protected_Device : boolean; 
>    end record;

>    procedure Set_Device (Device : in Device_Details_Type) is
>         
>       begin

>             Device_Array(Device.Device_Id) :=Device;   -- LINE 694 where the error is reported

> The array that is being written to is a fixed array. There is a value
> of Ada.Calendar.Time in the record but I cannot see why this would
> cause the problem

To get that exception you're going to have a controlled type somewhere,
very likely one of yours, and very likely to be found at
device_type_pkg.ads:115 (I'm guessing, some ancestor in the
Device_Class_Type tree? do you have some reason for naming this type
instead of just using Device'Class or (ugh) Device_Type'Class?).

At line 694 you are overwriting whatever was at
Device_Array(Device.Device_Id); full explanation of what this involves
starting at ARM 7.6(17).

Any unhandled exception raised in Initialize (?), Adjust (?) or Finalize
is going to be converted to PE. See ARM 7.6.1(14) ff.

You could always use the debugger and break on exceptions (e.g "catch
exception program_error").

  reply	other threads:[~2015-04-01 13:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-01  8:42 I've not seen this error before tonyg
2015-04-01 13:08 ` Simon Wright [this message]
2015-04-01 13:18   ` tonyg
2015-04-01 13:58     ` Niklas Holsti
2015-04-01 14:32       ` tonyg
2015-04-02  5:33   ` Randy Brukardt
replies disabled

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