configury changes to make ld plugin support controlled by --enable-plugins
[deliverable/binutils-gdb.git] / gdb / reply_mig_hack.awk
index a16ad23160ba5bc497a15333ce5ed808c67ebd37..15bfdfb09089688f8a1f7869cb699ff9cbf6fbb0 100644 (file)
@@ -1,13 +1,12 @@
 # Reply server mig-output massager
 #
-#   Copyright (C) 1995, 1996, 1999, 2007, 2008, 2009
-#   Free Software Foundation, Inc.
+#   Copyright (C) 1995-2014 Free Software Foundation, Inc.
 #
 #   Written by Miles Bader <miles@gnu.ai.mit.edu>
 #
 #   This program is free software; you can redistribute it and/or
 #   modify it under the terms of the GNU General Public License as
-#   published by the Free Software Foundation; either version 2, or (at
+#   published by the Free Software Foundation; either version 3, or (at
 #   your option) any later version.
 #
 #   This program is distributed in the hope that it will be useful, but
@@ -16,9 +15,7 @@
 #   General Public License for more details.
 #
 #   You should have received a copy of the GNU General Public License
-#   along with this program; if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-#   Boston, MA 02110-1301, USA.
+#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 # This awk script hacks the output of mig-generated reply server code
 # so that it allows replies with just the error-code in them (as this is
@@ -81,9 +78,9 @@ parse_phase == 4 {
   print; next;
 }
 
-parse_phase == 5 && /^[ \t]*(auto|static) const mach_msg_type_t/ {
+parse_phase == 5 && /^[ \t]*(auto |static |)const mach_msg_type_t/ {
   # The type check structure for an argument.
-  arg_check_name[num_checks] = $4;
+  arg_check_name[num_checks] = $(NF - 2);
   num_checks++;
   print; next;
 }
@@ -95,6 +92,12 @@ parse_phase == 5 && /^[ \t]*mig_external kern_return_t/ {
 }
 
 parse_phase == 5 && /^#if[ \t]TypeCheck/ {
+  # Keep going if we have not yet collected the type check structures.
+  if (num_checks == 0)
+    {
+      print; next;
+    }
+
   # The first args type checking statement; we need to insert our chunk of
   # code that bypasses all the type checks if this is an error return, after
   # which we're done until we get to the next function.  Handily, the size
This page took 0.038376 seconds and 4 git commands to generate.