Automatic date update in version.in
[platform/upstream/binutils.git] / gdb / reply_mig_hack.awk
index 97e080f..15bfdfb 100644 (file)
@@ -1,6 +1,6 @@
 # Reply server mig-output massager
 #
-#   Copyright (C) 1995-2013 Free Software Foundation, Inc.
+#   Copyright (C) 1995-2014 Free Software Foundation, Inc.
 #
 #   Written by Miles Bader <miles@gnu.ai.mit.edu>
 #
@@ -78,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;
 }
@@ -92,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