From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28570 invoked by alias); 27 Jun 2004 22:35:00 -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 28563 invoked from network); 27 Jun 2004 22:34:59 -0000 Received: from unknown (HELO faui10.informatik.uni-erlangen.de) (131.188.31.10) by sourceware.org with SMTP; 27 Jun 2004 22:34:59 -0000 Received: from faui1m.informatik.uni-erlangen.de (faui1m [131.188.31.43]) by faui10.informatik.uni-erlangen.de (8.9.3p3/8.1.9-FAU) with ESMTP id AAA16150; Mon, 28 Jun 2004 00:34:59 +0200 (CEST) From: Ulrich Weigand Received: (from weigand@localhost) by faui1m.informatik.uni-erlangen.de (8.9.3p3/8.1.6-FAU) id AAA10516; Mon, 28 Jun 2004 00:34:58 +0200 (CEST) Message-Id: <200406272234.AAA10516@faui1m.informatik.uni-erlangen.de> Subject: Re: [PATCH] Fix frame ID comparison problem on s390 To: drow@false.org (Daniel Jacobowitz) Date: Sun, 27 Jun 2004 22:35:00 -0000 Cc: weigand@i1.informatik.uni-erlangen.de (Ulrich Weigand), cagney@gnu.org (Andrew Cagney), gdb-patches@sources.redhat.com In-Reply-To: <20040627214831.GA30684@nevyn.them.org> from "Daniel Jacobowitz" at Jun 27, 2004 05:48:31 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-06/txt/msg00619.txt.bz2 Daniel Jacobowitz wrote: > Some future version of GCC will warn about this mistake. The only > valid values for "int : 1" are 0 and -1. Good point, I had forgotten about this. B.t.w. according to C99, it is actually implementation-defined whether a bit field type 'int' is signed or unsigned. (Which still means it is a good idea to explicitly use 'unsigned int', of course.) Fixed by the following patch. Tested on s390-ibm-linux and s390x-ibm-linux, committed to mainline as obvious. Bye, Ulrich ChangeLog: * frame.h (struct frame_id): Change bit field type of stack_addr_p, code_addr_p and special_addr_p to 'unsigned int'. Index: gdb/frame.h =================================================================== RCS file: /cvs/src/src/gdb/frame.h,v retrieving revision 1.135 diff -c -p -r1.135 frame.h *** gdb/frame.h 27 Jun 2004 20:45:05 -0000 1.135 --- gdb/frame.h 27 Jun 2004 22:12:00 -0000 *************** struct frame_id *** 124,132 **** CORE_ADDR special_addr; /* Flags to indicate the above fields have valid contents. */ ! int stack_addr_p : 1; ! int code_addr_p : 1; ! int special_addr_p : 1; }; /* Methods for constructing and comparing Frame IDs. --- 124,132 ---- CORE_ADDR special_addr; /* Flags to indicate the above fields have valid contents. */ ! unsigned int stack_addr_p : 1; ! unsigned int code_addr_p : 1; ! unsigned int special_addr_p : 1; }; /* Methods for constructing and comparing Frame IDs. -- Dr. Ulrich Weigand weigand@informatik.uni-erlangen.de