2009-01-30 Julian Brown <julian@codesourcery.com>
[deliverable/binutils-gdb.git] / gdb / reply_mig_hack.awk
index b41f50823f05b01461c98e3178259d0b74669368..a16ad23160ba5bc497a15333ce5ed808c67ebd37 100644 (file)
@@ -1,6 +1,7 @@
 # Reply server mig-output massager
 #
-#   Copyright (C) 1995 Free Software Foundation, Inc.
+#   Copyright (C) 1995, 1996, 1999, 2007, 2008, 2009
+#   Free Software Foundation, Inc.
 #
 #   Written by Miles Bader <miles@gnu.ai.mit.edu>
 #
@@ -16,7 +17,8 @@
 #
 #   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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+#   Boston, MA 02110-1301, USA.
 #
 # 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
@@ -79,7 +81,7 @@ parse_phase == 4 {
   print; next;
 }
 
-parse_phase == 5 && /^[ \t]*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;
   num_checks++;
@@ -100,7 +102,7 @@ parse_phase == 5 && /^#if[ \t]TypeCheck/ {
   # structure that we want to check for.
   print "\tif (In0P->Head.msgh_size == sizeof (Reply)";
   print "\t    && ! (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)";
-  print "\t    && *(int *)&In0P->" arg_type_code_name[0] " == *(int *)&" arg_check_name[0];
+  print "\t    && ! BAD_TYPECHECK(&In0P->" arg_type_code_name[0] ", &" arg_check_name[0] ")";
   print "\t    && In0P->" arg_name[0] " != 0)";
   print "\t  /* Error return, only the error code argument is passed.  */";
   print "\t  {";
This page took 0.031845 seconds and 4 git commands to generate.