From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13418 invoked by alias); 1 Jan 2007 03:52:13 -0000 Received: (qmail 13410 invoked by uid 22791); 1 Jan 2007 03:52:13 -0000 X-Spam-Check-By: sourceware.org Received: from nile.gnat.com (HELO nile.gnat.com) (205.232.38.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 01 Jan 2007 03:52:07 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-nile.gnat.com (Postfix) with ESMTP id B697C48CE4B for ; Sun, 31 Dec 2006 22:52:05 -0500 (EST) Received: from nile.gnat.com ([127.0.0.1]) by localhost (nile.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 15613-01-4 for ; Sun, 31 Dec 2006 22:52:05 -0500 (EST) Received: from takamaka.act-europe.fr (AStDenis-105-1-75-95.w80-8.abo.wanadoo.fr [80.8.212.95]) by nile.gnat.com (Postfix) with ESMTP id 030E448CE01 for ; Sun, 31 Dec 2006 22:52:01 -0500 (EST) Received: by takamaka.act-europe.fr (Postfix, from userid 1000) id 1583834C099; Mon, 1 Jan 2007 07:52:49 +0400 (RET) Date: Mon, 01 Jan 2007 03:52:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: Two identical "else if" blocks ? Message-ID: <20070101035248.GE3428@adacore.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i 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: 2007-01/txt/msg00003.txt.bz2 Hello, While reviewing everyone comments regarding the patch for catching Ada exceptions, I noticed the following code in remove_breakpoint: else if ((b->owner->type == bp_catch_catch || b->owner->type == bp_catch_throw) && breakpoint_enabled (b->owner) && !b->duplicate) { val = target_remove_breakpoint (&b->target_info); if (val) return val; b->inserted = (is == mark_inserted); } else if (ep_is_exception_catchpoint (b->owner) && b->inserted /* sometimes previous insert doesn't happen */ && breakpoint_enabled (b->owner) && !b->duplicate) { val = target_remove_breakpoint (&b->target_info); if (val) return val; b->inserted = (is == mark_inserted); } Since ep_is_exception_catchpoint is: return (ep->type == bp_catch_catch) || (ep->type == bp_catch_throw); It looks like the two blocks are completely identical, and we should be able to remove one of them. Should I perhaps test what happens when I delete, say, the first one? -- Joel