[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 10 Sep 2010 13:29:36 +0000 (15:29 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 10 Sep 2010 13:29:36 +0000 (15:29 +0200)
2010-09-10  Robert Dewar  <dewar@adacore.com>

* symbols-processing-vms-alpha.adb: Minor reformatting.

2010-09-10  Jerome Lambourg  <lambourg@adacore.com>

* bindgen.adb (Gen_Adainit_Ada): In .NET, don't call
__gnat_install_handler in case the binder is called with -n.

From-SVN: r164172

gcc/ada/ChangeLog
gcc/ada/bindgen.adb
gcc/ada/symbols-processing-vms-alpha.adb

index eb62a9c..057ddff 100644 (file)
@@ -1,3 +1,12 @@
+2010-09-10  Robert Dewar  <dewar@adacore.com>
+
+       * symbols-processing-vms-alpha.adb: Minor reformatting.
+
+2010-09-10  Jerome Lambourg  <lambourg@adacore.com>
+
+       * bindgen.adb (Gen_Adainit_Ada): In .NET, don't call
+       __gnat_install_handler in case the binder is called with -n.
+
 2010-09-10  Ed Schonberg  <schonberg@adacore.com>
 
        * exp_ch6.adb (Make_Build_In_Place_In_Object_Declaration): Use proper
index e87ff50..6d1642d 100644 (file)
@@ -792,11 +792,17 @@ package body Bindgen is
          Write_Statement_Buffer;
 
          --  Generate call to Install_Handler
+         --  In .NET, when binding with -z, we don't install the signal
+         --  handler to let the caller handle the last exception handler.
 
-         WBI ("");
-         WBI ("      if Handler_Installed = 0 then");
-         WBI ("         Install_Handler;");
-         WBI ("      end if;");
+         if VM_Target /= CLI_Target
+           or else Bind_Main_Program
+         then
+            WBI ("");
+            WBI ("      if Handler_Installed = 0 then");
+            WBI ("         Install_Handler;");
+            WBI ("      end if;");
+         end if;
 
          --  Generate call to Set_Features
 
index 668e473..c337394 100644 (file)
@@ -40,8 +40,9 @@ package body Processing is
    C_SYM : constant Number := 1;
    --  Code for a Symbol subsection
 
-   V_DEF_Mask  : constant Number := 2**1;
-   V_NORM_Mask : constant Number := 2**6;
+   V_DEF_Mask  : constant Number := 2 ** 1;
+   V_NORM_Mask : constant Number := 2 ** 6;
+   --  Comments ???
 
    B : Byte;
 
@@ -49,10 +50,10 @@ package body Processing is
    --  The number of characters of each section
 
    Native_Format : Boolean;
-   --  True if records are decoded by the system (like on VMS).
+   --  True if records are decoded by the system (like on VMS)
 
    Has_Pad : Boolean;
-   --  If true, a pad byte must be skipped before reading the next record.
+   --  If true, a pad byte must be skipped before reading the next record
 
    --  The following variables are used by procedure Process when reading an
    --  object file.
@@ -123,7 +124,7 @@ package body Processing is
 
       Success := True;
 
-      --  Check the file format in case of cross-tool.
+      --  Check the file format in case of cross-tool
 
       Get (Code);
       Get (Number_Of_Characters);
@@ -131,25 +132,22 @@ package body Processing is
 
       if Code = Dummy and then Number_Of_Characters = Natural (EMH) then
 
-         --  Looks like a cross tools.
+         --  Looks like a cross tool
 
          Native_Format := False;
          Number_Of_Characters := Natural (Dummy) - 4;
          Has_Pad := (Number_Of_Characters mod 2) = 1;
 
       elsif Code = EMH then
-
          Native_Format := True;
          Number_Of_Characters := Number_Of_Characters - 6;
          Has_Pad := False;
 
       else
-
          Put_Line ("file """ & Object_File & """ is not an object file");
          Close (File);
          Success := False;
          return;
-
       end if;
 
       --  Skip the EMH section
@@ -163,9 +161,10 @@ package body Processing is
       while not End_Of_File (File) loop
 
          if not Native_Format then
-            if Has_Pad then
-               --  Skip pad byte
 
+            --  Skip pad byte if present
+
+            if Has_Pad then
                Get (B);
             end if;
 
@@ -179,7 +178,8 @@ package body Processing is
 
          if not Native_Format then
             if Natural (Dummy) /= Number_Of_Characters then
-               --  Format error.
+
+               --  Format error
 
                raise Constraint_Error;
             end if;
@@ -195,13 +195,11 @@ package body Processing is
          --  next section.
 
          if Code /= GSD then
-
             for J in 1 .. Number_Of_Characters loop
                Read (File, B);
             end loop;
 
          else
-
             --  Skip over the next 4 bytes
 
             Get (Dummy);
@@ -218,10 +216,10 @@ package body Processing is
                Number_Of_Characters := Number_Of_Characters - 8;
                Nchars := Nchars - 8;
 
-               --  If this is a symbol and the V_DEF flag is set, get the
-               --  symbol.
+               --  If this is a symbol and the V_DEF flag is set, get symbol
 
                if Code = C_SYM and then ((Flags and V_DEF_Mask) /= 0) then
+
                   --  First, reach the symbol length
 
                   for J in 1 .. 25 loop
@@ -238,6 +236,7 @@ package body Processing is
                   for J in 1 .. Nchars loop
                      Read (File, B);
                      Number_Of_Characters := Number_Of_Characters - 1;
+
                      if Length > 0 then
                         LSymb := LSymb + 1;
                         Symbol (LSymb) := B;
@@ -273,7 +272,6 @@ package body Processing is
 
                         if (Flags and V_NORM_Mask) = 0 then
                            S_Data.Kind := Data;
-
                         else
                            S_Data.Kind := Proc;
                         end if;
@@ -294,7 +292,7 @@ package body Processing is
                   end loop;
                end if;
 
-               --  Exit the GSD section when number of characters reaches 0
+               --  Exit the GSD section when number of characters reaches zero
 
                exit when Number_Of_Characters = 0;
             end loop;