From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15516 invoked by alias); 17 Oct 2012 19:36:18 -0000 Received: (qmail 15486 invoked by uid 22791); 17 Oct 2012 19:36:17 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS 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; Wed, 17 Oct 2012 19:36:00 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9HJZxkL021881 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 17 Oct 2012 15:36:00 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9HJZwl0032288 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 17 Oct 2012 15:35:59 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Subject: RFC: fix bug in compare_breakpoints Date: Wed, 17 Oct 2012 19:36:00 -0000 Message-ID: <87sj9c28o1.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain 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-10/txt/msg00302.txt.bz2 I built gdb with clang today. This found a bunch of nits (I'll send a nit-cleanup patch later) but also a couple real bugs. Here's the first one. compare_breakpoints has an invalid comparison. Built (with clang and gcc) and regtested (gcc only) on x86-64 F16. Tom 2012-10-17 Tom Tromey * breakpoint.c (compare_breakpoints): Fix comparison. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index bebad75..76e3e89 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -11766,7 +11766,7 @@ compare_breakpoints (const void *a, const void *b) the number 0. */ if (ua < ub) return -1; - return ub > ub ? 1 : 0; + return ua > ub ? 1 : 0; } /* Delete breakpoints by address or line. */