From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14732 invoked by alias); 10 Jul 2003 22:00:21 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 14686 invoked from network); 10 Jul 2003 22:00:19 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 10 Jul 2003 22:00:19 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 11E922B6E for ; Thu, 10 Jul 2003 18:00:19 -0400 (EDT) Message-ID: <3F0DE1F3.2010401@redhat.com> Date: Thu, 10 Jul 2003 22:00:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [commit] Simplify gdbarch.sh a tiny bit Content-Type: multipart/mixed; boundary="------------060700030801000108050005" X-SW-Source: 2003-07/txt/msg00220.txt.bz2 This is a multi-part message in MIME format. --------------060700030801000108050005 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 203 Hello, The attached simplfies gdbarch.sh a tiny bit - it uses gdb_assert instead of internal_error in a few places (from memory gdbarch.sh was written before gdb_assert was added). committed, Andrew --------------060700030801000108050005 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 2272 2003-07-10 Andrew Cagney * gdbarch.sh: Use gdb_assert instead of internal_error. Compare functions against NULL, not 0. * gdbarch.c: Re-generate. Index: gdbarch.sh =================================================================== RCS file: /cvs/src/src/gdb/gdbarch.sh,v retrieving revision 1.255 diff -u -r1.255 gdbarch.sh --- gdbarch.sh 3 Jul 2003 22:14:42 -0000 1.255 +++ gdbarch.sh 10 Jul 2003 21:57:50 -0000 @@ -1733,7 +1733,7 @@ then printf " return ${predicate};\n" else - printf " return gdbarch->${function} != 0;\n" + printf " return gdbarch->${function} != NULL;\n" fi printf "}\n" fi @@ -1749,13 +1749,11 @@ fi printf "{\n" printf " gdb_assert (gdbarch != NULL);\n" - printf " if (gdbarch->${function} == 0)\n" - printf " internal_error (__FILE__, __LINE__,\n" - printf " \"gdbarch: gdbarch_${function} invalid\");\n" + printf " gdb_assert (gdbarch->${function} != NULL);\n" if class_is_predicate_p && test -n "${predicate}" then # Allow a call to a function with a predicate. - printf " /* Ignore predicate (${predicate}). */\n" + printf " /* Do not check predicate: ${predicate}, allow call. */\n" fi printf " if (gdbarch_debug >= 2)\n" printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n" @@ -1801,14 +1799,12 @@ printf " /* Skip verify of ${function}, invalid_p == 0 */\n" elif [ -n "${invalid_p}" ] then - printf " if (${invalid_p})\n" - printf " internal_error (__FILE__, __LINE__,\n" - printf " \"gdbarch: gdbarch_${function} invalid\");\n" + printf " /* Check variable is valid. */\n" + printf " gdb_assert (!(${invalid_p}));\n" elif [ -n "${predefault}" ] then - printf " if (gdbarch->${function} == ${predefault})\n" - printf " internal_error (__FILE__, __LINE__,\n" - printf " \"gdbarch: gdbarch_${function} invalid\");\n" + printf " /* Check variable changed from pre-default. */\n" + printf " gdb_assert (gdbarch->${function} != ${predefault});\n" fi printf " if (gdbarch_debug >= 2)\n" printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n" --------------060700030801000108050005--