symbols-processing-vms-ia64.adb, [...] (Process): Do not include symbols that come...
authorVincent Celier <celier@adacore.com>
Tue, 31 Oct 2006 18:13:55 +0000 (19:13 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 31 Oct 2006 18:13:55 +0000 (19:13 +0100)
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

gcc/ada/symbols-processing-vms-alpha.adb
gcc/ada/symbols-processing-vms-ia64.adb

index adab774e2bce41f7a2564d2aab09041666ba3f73..da1bf5d0110cc72edac1de5d70f2508f60e62b7c 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 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 --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -95,6 +95,8 @@ package body Processing is
      (Object_File : String;
       Success     : out Boolean)
    is
+      OK : Boolean := True;
+
    begin
       --  Open the object file with Byte_IO. Return with Success = False if
       --  this fails.
@@ -175,29 +177,46 @@ package body Processing is
                      end if;
                   end loop;
 
-                  --  Create the new Symbol
+                  --  Check if it is a symbol from a generic body
 
-                  declare
-                     S_Data : Symbol_Data;
-                  begin
-                     S_Data.Name := new String'(Symbol (1 .. LSymb));
+                  OK := True;
 
-                     --  The symbol kind (Data or Procedure) depends on the
-                     --  V_NORM flag.
+                  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 (Flags and V_NORM_Mask) = 0 then
-                        S_Data.Kind := Data;
+                  if OK then
 
-                     else
-                        S_Data.Kind := Proc;
-                     end if;
+                     --  Create the new Symbol
+
+                     declare
+                        S_Data : Symbol_Data;
+
+                     begin
+                        S_Data.Name := new String'(Symbol (1 .. LSymb));
+
+                        --  The symbol kind (Data or Procedure) depends on the
+                        --  V_NORM flag.
+
+                        if (Flags and V_NORM_Mask) = 0 then
+                           S_Data.Kind := Data;
+
+                        else
+                           S_Data.Kind := Proc;
+                        end if;
 
-                     --  Put the new symbol in the table
+                        --  Put the new symbol in the table
 
-                     Symbol_Table.Increment_Last (Complete_Symbols);
-                     Complete_Symbols.Table
-                       (Symbol_Table.Last (Complete_Symbols)) := S_Data;
-                  end;
+                        Symbol_Table.Increment_Last (Complete_Symbols);
+                        Complete_Symbols.Table
+                          (Symbol_Table.Last (Complete_Symbols)) := S_Data;
+                     end;
+                  end if;
 
                else
                   --  As it is not a symbol subsection, skip to the next
index 4c732783718f3ec69389531612fc9a6e800183af..5d62c3ce790c1d0035f5f95a7dd515a8b70c4bab 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 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 --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -85,20 +85,26 @@ package body Processing is
 
       End_Symtab : Integer;
 
-      Stname : Integer;
-      Stinfo : Character;
-      Sttype : Integer;
-      Stbind : Integer;
+      Stname  : Integer;
+      Stinfo  : Character;
+      Sttype  : Integer;
+      Stbind  : Integer;
       Stshndx : Integer;
 
       Section_Headers : Section_Header_Ptr;
 
-      Offset   : Natural := 0;
+      Offset : Natural := 0;
+      OK     : Boolean := True;
 
       procedure Get_Byte (B : out Byte);
       procedure Get_Half (H : out Integer);
       procedure Get_Word (W : out Integer);
       procedure Reset;
+      --  All the above require comments ???
+
+      --------------
+      -- Get_Byte --
+      --------------
 
       procedure Get_Byte (B : out Byte) is
       begin
@@ -106,6 +112,10 @@ package body Processing is
          Offset := Offset + 1;
       end Get_Byte;
 
+      --------------
+      -- Get_Half --
+      --------------
+
       procedure Get_Half (H : out Integer) is
          C1, C2 : Character;
       begin
@@ -114,6 +124,10 @@ package body Processing is
            Integer'(Character'Pos (C2)) * 256 + Integer'(Character'Pos (C1));
       end Get_Half;
 
+      --------------
+      -- Get_Word --
+      --------------
+
       procedure Get_Word (W : out Integer) is
          H1, H2 : Integer;
       begin
@@ -121,12 +135,18 @@ package body Processing is
          W := H2 * 256 * 256 + H1;
       end Get_Word;
 
+      -----------
+      -- Reset --
+      -----------
+
       procedure Reset is
       begin
          Offset := 0;
          Byte_IO.Reset (File);
       end Reset;
 
+   --  Start of processing for Process
+
    begin
       --  Open the object file with Byte_IO. Return with Success = False if
       --  this fails.
@@ -216,6 +236,7 @@ package body Processing is
       Symtab_Index := 0;
 
       for J in Section_Headers'Range loop
+
          --  Get the data for each Section Header
 
          Get_Word (Shname);
@@ -312,24 +333,40 @@ package body Processing is
               and then Stbind /= 0
               and then Stshndx /= 0
          then
-            declare
-               S_Data : Symbol_Data;
-            begin
-               S_Data.Name := new String'(Strings (Stname).all);
+            --  Check if this is a symbol from a generic body
 
-               if Sttype = 1 then
-                  S_Data.Kind := Data;
+            OK := True;
 
-               else
-                  S_Data.Kind := Proc;
+            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
+                  S_Data : Symbol_Data;
+               begin
+                  S_Data.Name := new String'(Strings (Stname).all);
+
+                  if Sttype = 1 then
+                     S_Data.Kind := Data;
 
-               --  Put the new symbol in the table
+                  else
+                     S_Data.Kind := Proc;
+                  end if;
 
-               Symbol_Table.Increment_Last (Complete_Symbols);
-               Complete_Symbols.Table
-                 (Symbol_Table.Last (Complete_Symbols)) := S_Data;
-            end;
+                  --  Put the new symbol in the table
+
+                  Symbol_Table.Increment_Last (Complete_Symbols);
+                  Complete_Symbols.Table
+                    (Symbol_Table.Last (Complete_Symbols)) := S_Data;
+               end;
+            end if;
          end if;
       end loop;