From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3467 invoked by alias); 16 Aug 2002 17:34:34 -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 3457 invoked from network); 16 Aug 2002 17:34:33 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 16 Aug 2002 17:34:33 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id CBF8E3C8D; Fri, 16 Aug 2002 13:34:31 -0400 (EDT) Message-ID: <3D5D37A7.2090003@ges.redhat.com> Date: Fri, 16 Aug 2002 10:34:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020810 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kevin Buettner Cc: gdb-patches@sources.redhat.com Subject: Re: [patch/ob] not_a_breakpoint -> not_a_sw_breakpoint References: <3D5D1C3E.8070203@ges.redhat.com> <1020816164312.ZM11179@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-08/txt/msg00428.txt.bz2 > On Aug 16, 11:37am, Andrew Cagney wrote: > > >> This patch renames the ``not_a_breakpoint'' parameter of >> bpstat_stop_status() to the more correct ``not_a_sw_breakpoint'' so that >> it is clear that it is indicating nothing about hardware breakpoints. > > > This may be a good change, but I don't think it's obvious. Could > you at least explain the reasoning that lead you to conclude that > the parameter in question indicates nothing about hardware breakpoints? The variable is used vis: bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint) { [...] /* Get the address where the breakpoint would have been. The "not_a_sw_breakpoint" argument is meant to distinguish between a breakpoint trap event and a trace/singlestep trap event. For a trace/singlestep trap event, we would not want to subtract DECR_PC_AFTER_BREAK from the PC. */ bp_addr = *pc - (not_a_sw_breakpoint && !SOFTWARE_SINGLE_STEP_P () ? 0 : DECR_PC_AFTER_BREAK); Later in the code appears: if (DECR_PC_AFTER_HW_BREAK != 0) { *pc = *pc - DECR_PC_AFTER_HW_BREAK; write_pc (*pc); } if not_a_sw_breakpoint applied to hardware breakpoints then the above decrement would be guarded by not_a_sw_breakpoint. BTW, an even more correct name is ``not_a_sw_breakpoint_trap''. However, Joel might end up adding something better than that. I guess nothing is obvious :-( enjoy, Andrew