From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30087 invoked by alias); 24 Jun 2010 14:48:43 -0000 Received: (qmail 30073 invoked by uid 22791); 24 Jun 2010 14:48:41 -0000 X-SWARE-Spam-Status: No, hits=-5.8 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, 24 Jun 2010 14:48:35 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5OEmTLZ019966 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 24 Jun 2010 10:48:29 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5OEmQUN023482 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Jun 2010 10:48:28 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o5OEmQVT001279; Thu, 24 Jun 2010 16:48:26 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o5OEmQwt001278; Thu, 24 Jun 2010 16:48:26 +0200 Date: Thu, 24 Jun 2010 14:48:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org, Stan Shebs Subject: [patch 3.1/3] bpstat_what removal - addon gdb_assert Message-ID: <20100624144826.GB29245@host0.dyn.jankratochvil.net> References: <20100503200217.GD30386@host0.dyn.jankratochvil.net> <201006151608.20224.pedro@codesourcery.com> <20100615215402.GA29723@host0.dyn.jankratochvil.net> <201006162013.31064.pedro@codesourcery.com> <20100624144423.GA29245@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100624144423.GA29245@host0.dyn.jankratochvil.net> User-Agent: Mutt/1.5.20 (2009-12-10) 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: 2010-06/txt/msg00524.txt.bz2 Hi Pedro, On Thu, 24 Jun 2010 16:44:23 +0200, Jan Kratochvil wrote: > attaching follow-up on your patch still using BPSTAT_WHAT_* symbols. this is a gdb_assert followup with the goal of making the code both more clear and more safe against future changes. I do not mind much about this patch. No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu. Thanks, Jan 2010-06-24 Jan Kratochvil * breakpoint.c (bpstat_what): Pre-set this_action to -1. Set this_action to BPSTAT_WHAT_KEEP_CHECKING in cases it has been left unchanged. New gdb_assert. --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -4234,7 +4234,7 @@ bpstat_what (bpstat bs) { /* Extract this BS's action. After processing each BS, we check if its action overrides all we've seem so far. */ - enum bpstat_what_main_action this_action = BPSTAT_WHAT_KEEP_CHECKING; + enum bpstat_what_main_action this_action = -1; enum bptype bptype; if (bs->breakpoint_at == NULL) @@ -4251,6 +4251,7 @@ bpstat_what (bpstat bs) switch (bptype) { case bp_none: + this_action = BPSTAT_WHAT_KEEP_CHECKING; break; case bp_breakpoint: case bp_hardware_breakpoint: @@ -4281,6 +4282,7 @@ bpstat_what (bpstat bs) { /* There was a watchpoint, but we're not stopping. This requires no further action. */ + this_action = BPSTAT_WHAT_KEEP_CHECKING; } break; case bp_longjmp: @@ -4317,6 +4319,7 @@ bpstat_what (bpstat bs) { /* There was a catchpoint, but we're not stopping. This requires no further action. */ + this_action = BPSTAT_WHAT_KEEP_CHECKING; } break; case bp_shlib_event: @@ -4359,6 +4362,7 @@ bpstat_what (bpstat bs) _("bpstat_what: unhandled bptype %d"), (int) bptype); } + gdb_assert (this_action != -1); retval.main_action = max (retval.main_action, this_action); }