Commit 7440d86c by Vincent Celier Committed by Arnaud Charlet

symbols-processing-vms-ia64.adb, [...] (Process): Do not include symbols that…

symbols-processing-vms-ia64.adb, [...] (Process): Do not include symbols that come from generic instantiations in bodies.

2006-10-31  Vincent Celier  <celier@adacore.com>

	* symbols-processing-vms-ia64.adb,
	symbols-processing-vms-alpha.adb (Process): Do not include symbols
	that come from generic instantiations in bodies.

From-SVN: r118326
parent c5e2b716
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2003-2005 Free Software Foundation, Inc. -- -- Copyright (C) 2003-2006, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -95,6 +95,8 @@ package body Processing is ...@@ -95,6 +95,8 @@ package body Processing is
(Object_File : String; (Object_File : String;
Success : out Boolean) Success : out Boolean)
is is
OK : Boolean := True;
begin begin
-- Open the object file with Byte_IO. Return with Success = False if -- Open the object file with Byte_IO. Return with Success = False if
-- this fails. -- this fails.
...@@ -175,10 +177,26 @@ package body Processing is ...@@ -175,10 +177,26 @@ package body Processing is
end if; end if;
end loop; end loop;
-- Check if it is a symbol from a generic body
OK := True;
for J in 1 .. LSymb - 2 loop
if Symbol (J) = 'G' and then Symbol (J + 1) = 'P'
and then Symbol (J + 2) in '0' .. '9'
then
OK := False;
exit;
end if;
end loop;
if OK then
-- Create the new Symbol -- Create the new Symbol
declare declare
S_Data : Symbol_Data; S_Data : Symbol_Data;
begin begin
S_Data.Name := new String'(Symbol (1 .. LSymb)); S_Data.Name := new String'(Symbol (1 .. LSymb));
...@@ -198,6 +216,7 @@ package body Processing is ...@@ -198,6 +216,7 @@ package body Processing is
Complete_Symbols.Table Complete_Symbols.Table
(Symbol_Table.Last (Complete_Symbols)) := S_Data; (Symbol_Table.Last (Complete_Symbols)) := S_Data;
end; end;
end if;
else else
-- As it is not a symbol subsection, skip to the next -- As it is not a symbol subsection, skip to the next
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2004-2005 Free Software Foundation, Inc. -- -- Copyright (C) 2004-2006, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -94,11 +94,17 @@ package body Processing is ...@@ -94,11 +94,17 @@ package body Processing is
Section_Headers : Section_Header_Ptr; Section_Headers : Section_Header_Ptr;
Offset : Natural := 0; Offset : Natural := 0;
OK : Boolean := True;
procedure Get_Byte (B : out Byte); procedure Get_Byte (B : out Byte);
procedure Get_Half (H : out Integer); procedure Get_Half (H : out Integer);
procedure Get_Word (W : out Integer); procedure Get_Word (W : out Integer);
procedure Reset; procedure Reset;
-- All the above require comments ???
--------------
-- Get_Byte --
--------------
procedure Get_Byte (B : out Byte) is procedure Get_Byte (B : out Byte) is
begin begin
...@@ -106,6 +112,10 @@ package body Processing is ...@@ -106,6 +112,10 @@ package body Processing is
Offset := Offset + 1; Offset := Offset + 1;
end Get_Byte; end Get_Byte;
--------------
-- Get_Half --
--------------
procedure Get_Half (H : out Integer) is procedure Get_Half (H : out Integer) is
C1, C2 : Character; C1, C2 : Character;
begin begin
...@@ -114,6 +124,10 @@ package body Processing is ...@@ -114,6 +124,10 @@ package body Processing is
Integer'(Character'Pos (C2)) * 256 + Integer'(Character'Pos (C1)); Integer'(Character'Pos (C2)) * 256 + Integer'(Character'Pos (C1));
end Get_Half; end Get_Half;
--------------
-- Get_Word --
--------------
procedure Get_Word (W : out Integer) is procedure Get_Word (W : out Integer) is
H1, H2 : Integer; H1, H2 : Integer;
begin begin
...@@ -121,12 +135,18 @@ package body Processing is ...@@ -121,12 +135,18 @@ package body Processing is
W := H2 * 256 * 256 + H1; W := H2 * 256 * 256 + H1;
end Get_Word; end Get_Word;
-----------
-- Reset --
-----------
procedure Reset is procedure Reset is
begin begin
Offset := 0; Offset := 0;
Byte_IO.Reset (File); Byte_IO.Reset (File);
end Reset; end Reset;
-- Start of processing for Process
begin begin
-- Open the object file with Byte_IO. Return with Success = False if -- Open the object file with Byte_IO. Return with Success = False if
-- this fails. -- this fails.
...@@ -216,6 +236,7 @@ package body Processing is ...@@ -216,6 +236,7 @@ package body Processing is
Symtab_Index := 0; Symtab_Index := 0;
for J in Section_Headers'Range loop for J in Section_Headers'Range loop
-- Get the data for each Section Header -- Get the data for each Section Header
Get_Word (Shname); Get_Word (Shname);
...@@ -312,6 +333,21 @@ package body Processing is ...@@ -312,6 +333,21 @@ package body Processing is
and then Stbind /= 0 and then Stbind /= 0
and then Stshndx /= 0 and then Stshndx /= 0
then then
-- Check if this is a symbol from a generic body
OK := True;
for J in Strings (Stname)'First .. Strings (Stname)'Last - 2 loop
if Strings (Stname) (J) = 'G'
and then Strings (Stname) (J + 1) = 'P'
and then Strings (Stname) (J + 2) in '0' .. '9'
then
OK := False;
exit;
end if;
end loop;
if OK then
declare declare
S_Data : Symbol_Data; S_Data : Symbol_Data;
begin begin
...@@ -331,6 +367,7 @@ package body Processing is ...@@ -331,6 +367,7 @@ package body Processing is
(Symbol_Table.Last (Complete_Symbols)) := S_Data; (Symbol_Table.Last (Complete_Symbols)) := S_Data;
end; end;
end if; end if;
end if;
end loop; end loop;
-- The object file has been processed, close it -- The object file has been processed, close it
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment