From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28343 invoked by alias); 11 Jul 2003 01:36:51 -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 28336 invoked from network); 11 Jul 2003 01:36:50 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 11 Jul 2003 01:36:50 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 7F0472B6E; Thu, 10 Jul 2003 21:36:50 -0400 (EDT) Message-ID: <3F0E14B2.4030807@redhat.com> Date: Fri, 11 Jul 2003 01:36: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: "Theodore A. Roth" Cc: gdb-patches@sources.redhat.com Subject: Re: [commit] Simplify gdbarch.sh a tiny bit References: <3F0DE1F3.2010401@redhat.com> <3F0DF532.90801@redhat.com> Content-Type: multipart/mixed; boundary="------------020108090805060102050807" X-SW-Source: 2003-07/txt/msg00230.txt.bz2 This is a multi-part message in MIME format. --------------020108090805060102050807 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1501 > On Thu, 10 Jul 2003, Andrew Cagney wrote: > > > 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). > > > I'm getting a build failure now: > > Oh, flip. The bit to revert should be obvious. I'm off line for a few hours. I've checked in the attached. I'm guessing its correct, my default compiler doesn't get these warnings. Andrew > gcc -c -g -O2 -I. -I../../gdb -I../../gdb/config > -DLOCALEDIR="\"/home/roth/local/avr/share/locale\"" -DHAVE_CONFIG_H > -I../../gdb/../include/opcode -I../../gdb/../readline/.. -I../bfd > -I../../gdb/../bfd -I../../gdb/../include -I../intl > -I../../gdb/../intl -DMI_OUT=1 -Wimplicit -Wreturn-type -Wcomment > -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized > -Werror ../../gdb/gdbarch.c > cc1: warnings being treated as errors > ../../gdb/gdbarch.c: In function > `gdbarch_deprecated_max_register_raw_size_p': > ../../gdb/gdbarch.c:3425: warning: comparison between pointer and integer > ../../gdb/gdbarch.c: In function > `gdbarch_deprecated_max_register_virtual_size_p': > ../../gdb/gdbarch.c:3448: warning: comparison between pointer and integer > ../../gdb/gdbarch.c: In function > `gdbarch_deprecated_call_dummy_stack_adjust_p': > ../../gdb/gdbarch.c:3805: warning: comparison between pointer and integer > make: *** [gdbarch.o] Error 1 > > Is this related to your change? > > > --------------020108090805060102050807 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 1804 2003-07-10 Andrew Cagney * gdbarch.sh: When a variable, but not a function, compare against 0. Fix problem in previous patch. * gdbarch.c: Re-generate. Index: gdbarch.c =================================================================== RCS file: /cvs/src/src/gdb/gdbarch.c,v retrieving revision 1.234 diff -u -r1.234 gdbarch.c --- gdbarch.c 10 Jul 2003 22:01:14 -0000 1.234 +++ gdbarch.c 11 Jul 2003 01:33:58 -0000 @@ -3422,7 +3422,7 @@ gdbarch_deprecated_max_register_raw_size_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_max_register_raw_size != NULL; + return gdbarch->deprecated_max_register_raw_size != 0; } int @@ -3445,7 +3445,7 @@ gdbarch_deprecated_max_register_virtual_size_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_max_register_virtual_size != NULL; + return gdbarch->deprecated_max_register_virtual_size != 0; } int @@ -3802,7 +3802,7 @@ gdbarch_deprecated_call_dummy_stack_adjust_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_call_dummy_stack_adjust != NULL; + return gdbarch->deprecated_call_dummy_stack_adjust != 0; } int Index: gdbarch.sh =================================================================== RCS file: /cvs/src/src/gdb/gdbarch.sh,v retrieving revision 1.256 diff -u -r1.256 gdbarch.sh --- gdbarch.sh 10 Jul 2003 22:01:14 -0000 1.256 +++ gdbarch.sh 11 Jul 2003 01:33:58 -0000 @@ -1732,7 +1732,11 @@ if [ -n "${predicate}" ] then printf " return ${predicate};\n" - else + elif class_is_variable_p + then + printf " return gdbarch->${function} != 0;\n" + elif class_is_function_p + then printf " return gdbarch->${function} != NULL;\n" fi printf "}\n" --------------020108090805060102050807--