From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32972 invoked by alias); 20 Mar 2015 17:48:06 -0000 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 Received: (qmail 32952 invoked by uid 89); 20 Mar 2015 17:48:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 20 Mar 2015 17:48:04 +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 t2KHlv7x018383 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 20 Mar 2015 13:47:58 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2KHltl4020996; Fri, 20 Mar 2015 13:47:56 -0400 Message-ID: <550C5D4B.9010808@redhat.com> Date: Fri, 20 Mar 2015 17:48:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Yao Qi , gdb-patches@sourceware.org, Ulrich Weigand Subject: Re: [rfc, spu] Don't call set_gdbarch_cannot_step_breakpoint in spu_gdbarch_init References: <1426603922-24107-1-git-send-email-qiyaoltc@gmail.com> In-Reply-To: <1426603922-24107-1-git-send-email-qiyaoltc@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-03/txt/msg00662.txt.bz2 +Ulrich Ulrich, any idea why cannot_step_breakpoint was ever needed? Yao's change makes sense to me. Thanks, Pedro Alves On 03/17/2015 02:52 PM, Yao Qi wrote: > From: Yao Qi > > Nowadays, in infrun.c:resume, the setting to 'step' variable is like: > > if (use_displaced_stepping (gdbarch) > && tp->control.trap_expected > && sig == GDB_SIGNAL_0 > && !current_inferior ()->waiting_for_vfork_done) > { > } > /* Do we need to do it the hard way, w/temp breakpoints? */ > else if (step) > step = maybe_software_singlestep (gdbarch, pc); <-- [1] > > ... > > if (execution_direction != EXEC_REVERSE > && step && breakpoint_inserted_here_p (aspace, pc)) > { > ... > if (gdbarch_cannot_step_breakpoint (gdbarch)) <-- [2] > step = 0; > } > > spu doesn't have displaced stepping and uses software single step, > so 'step' is set to zero in [1], and [2] becomes unreachable as a > result. So don't have to call set_gdbarch_cannot_step_breakpoint > in spu_gdbarch_init. > > On the other hand, we either have hardware single step or software > single step, do we still need gdbarch method cannot_step_breakpoint? > CANNOT_STEP_BREAKPOINT was introduced in 1993 by commit > cef4c2e7a5f2d3426a8255f74b6c7f4e795fd9a4 for alpha OSF/1 native > support. > > I don't have spu machine to test this patch. > > gdb: > > 2015-03-17 Yao Qi > > * spu-tdep.c (spu_gdbarch_init): Don't call > set_gdbarch_cannot_step_breakpoint. > --- > gdb/spu-tdep.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c > index 36ad312..870cf32 100644 > --- a/gdb/spu-tdep.c > +++ b/gdb/spu-tdep.c > @@ -2794,7 +2794,6 @@ spu_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) > set_gdbarch_decr_pc_after_break (gdbarch, 4); > set_gdbarch_breakpoint_from_pc (gdbarch, spu_breakpoint_from_pc); > set_gdbarch_memory_remove_breakpoint (gdbarch, spu_memory_remove_breakpoint); > - set_gdbarch_cannot_step_breakpoint (gdbarch, 1); > set_gdbarch_software_single_step (gdbarch, spu_software_single_step); > set_gdbarch_get_longjmp_target (gdbarch, spu_get_longjmp_target); > >