From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25508 invoked by alias); 9 Feb 2012 08:23:04 -0000 Received: (qmail 25499 invoked by uid 22791); 9 Feb 2012 08:23:03 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 09 Feb 2012 08:22:51 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q198MZ3q020347 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 9 Feb 2012 03:22:35 -0500 Received: from host2.jankratochvil.net (ovpn-116-26.ams2.redhat.com [10.36.116.26]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q198MUqj026189 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 9 Feb 2012 03:22:33 -0500 Date: Thu, 09 Feb 2012 08:23:00 -0000 From: Jan Kratochvil To: Luis Gustavo Cc: Joel Brobecker , Pedro Alves , gdb-patches@sourceware.org Subject: Re: [patch] update_global_location_list my comment fix [Re: [PATCH] Fix breakpoint updates for multi-inferior] Message-ID: <20120209082230.GB10358@host2.jankratochvil.net> References: <4F20610B.5010403@mentor.com> <4F3291D9.80705@redhat.com> <4F329468.3020307@mentor.com> <4F32990B.7060203@redhat.com> <20120208172728.GA6951@host2.jankratochvil.net> <4F3302F5.1030809@mentor.com> <20120208233211.GC19247@adacore.com> <4F3307BE.2050909@mentor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F3307BE.2050909@mentor.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-02/txt/msg00133.txt.bz2 On Thu, 09 Feb 2012 00:39:42 +0100, Luis Gustavo wrote: > + /* Sort by pspace. This effectively sorts locations by inferior in > + a multi-inferior environment. */ > + > + if (a->pspace != b->pspace) > + return (a->pspace > b->pspace) - (a->pspace < b->pspace); This does not follow the comment I made: /* Make the internal GDB representation stable across GDB runs where A and B memory inside GDB can differ. I would prefer there (and it will not fit on a single line :-) ): return (a->pspace->num > b->pspace->num) - (a->pspace->num < b->pspace->num); NUM should be the same on each GDB run for the same inferior / command file. Thanks, Jan