This repository was archived by the owner on May 22, 2023. It is now read-only.
File tree 3 files changed +17
-4
lines changed
3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 18
18
Rom_Name : constant Musinfo.Name_Type :=
19
19
(if Name = " " then CIM.String_To_Name (" config" ) else CIM.String_To_Name (Name));
20
20
begin
21
- C.Mem := Musinfo.Instance.Memory_By_Name (Rom_Name);
21
+ if Musinfo.Instance.Is_Valid then
22
+ C.Mem := Musinfo.Instance.Memory_By_Name (Rom_Name);
23
+ end if ;
22
24
end Initialize ;
23
25
24
26
procedure Load (C : in out Client_Session)
25
27
is
26
28
use type Standard.Interfaces.Unsigned_64;
27
29
function Max_Index (Size : Standard.Interfaces.Unsigned_64) return Index is
28
- (if Standard.Interfaces.Unsigned_64 (Index'Last) > Size then Index (Size) else Index'Last);
30
+ (if Standard.Interfaces.Unsigned_64 (Index'Last - Index'First) > Size
31
+ and then Standard.Interfaces.Unsigned_64 (Index'Last) <= Size then Index (Size) else Index'Last);
29
32
I : constant Index := Max_Index (C.Mem.Size / (Element'Size / 8 ));
30
33
B : Buffer (Index'First .. Index'First + I - 1 ) with
34
+ Import,
31
35
Address => System'To_Address (C.Mem.Address);
32
36
begin
33
37
Parse (B);
Original file line number Diff line number Diff line change 1
1
2
2
with Musinfo ;
3
+ with Musinfo.Instance ;
3
4
4
5
package body Componolit.Gneiss.Rom with
5
6
SPARK_Mode
8
9
use type Musinfo.Memregion_Type;
9
10
10
11
function Initialized (C : Client_Session) return Boolean is
11
- (C.Mem /= Musinfo.Null_Memregion);
12
+ (Musinfo.Instance.Is_Valid
13
+ and then C.Mem /= Musinfo.Null_Memregion);
12
14
13
15
end Componolit.Gneiss.Rom ;
Original file line number Diff line number Diff line change 37
37
if not Componolit.Gneiss.Log.Initialized (Log) and then Data'Length > 1 then
38
38
for I in Data'Range loop
39
39
if Data (I) = ASCII.LF then
40
- Last := I - 1 ;
40
+ if I > Data'First then
41
+ Last := I - 1 ;
42
+ else
43
+ Last := Data'First;
44
+ end if ;
41
45
exit ;
42
46
end if ;
43
47
end loop ;
44
48
Componolit.Gneiss.Log.Client.Initialize (Log, C, Data (Data'First .. Last));
45
49
if Componolit.Gneiss.Log.Initialized (Log) then
50
+ if Data (Data'First .. Last)'Length > Componolit.Gneiss.Log.Maximum_Message_Length (Log) - 35 then
51
+ Last := Data'First + (Componolit.Gneiss.Log.Maximum_Message_Length (Log) - 36 );
52
+ end if ;
46
53
Componolit.Gneiss.Log.Client.Info (Log, " Log session configured with label: "
47
54
& Data (Data'First .. Last));
48
55
else
You can’t perform that action at this time.
0 commit comments