From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30825 invoked by alias); 4 Dec 2003 22:27:09 -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 30818 invoked from network); 4 Dec 2003 22:27:09 -0000 Received: from unknown (HELO zenia.home) (12.223.225.216) by sources.redhat.com with SMTP; 4 Dec 2003 22:27:09 -0000 Received: by zenia.home (Postfix, from userid 5433) id DA62820766; Thu, 4 Dec 2003 17:25:33 -0500 (EST) To: Ulrich Weigand Cc: gdb-patches@sources.redhat.com, uweigand@de.ibm.com Subject: Re: [PATCH] S/390 port modernization 2/4 References: <200312042006.VAA07709@faui1d.informatik.uni-erlangen.de> From: Jim Blandy Date: Thu, 04 Dec 2003 22:27:00 -0000 In-Reply-To: <200312042006.VAA07709@faui1d.informatik.uni-erlangen.de> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-12/txt/msg00150.txt.bz2 > ! static void > ! s390_fix_watch_points (void) > { > + int tid = s390_inferior_tid (); > + > per_struct per_info; > ptrace_area parea; > > + CORE_ADDR watch_lo_addr = 0, watch_hi_addr = (CORE_ADDR)-1; > + struct watch_area *area; > + > + for (area = watch_base; area; area = area->next) > + { > + watch_lo_addr = min (watch_lo_addr, area->lo_addr); > + watch_hi_addr = max (watch_hi_addr, area->hi_addr); > + } > + Is this correct? Since CORE_ADDR is unsigned, the initial value of watch_hi_addr will compare greater than any watch area's hi_addr, so the 'max' will never change its value. Same for watch_lo_addr. Don't you want to set watch_lo_addr to (CORE_ADDR) -1, and watch_hi_addr to 0?