From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33147 invoked by alias); 1 Apr 2015 20:35:23 -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 32908 invoked by uid 89); 1 Apr 2015 20:35:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mout.gmx.net Received: from mout.gmx.net (HELO mout.gmx.net) (212.227.17.22) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 01 Apr 2015 20:35:20 +0000 Received: from licht.localdomain ([62.158.20.14]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0Lat5o-1ZJNzy2jrk-00kLpX; Wed, 01 Apr 2015 22:35:10 +0200 Received: from licht.localdomain (localhost.localdomain [127.0.0.1]) by licht.localdomain (8.12.8/8.12.8) with ESMTP id t31KZ7ah004945; Wed, 1 Apr 2015 22:35:08 +0200 Received: (from pes@localhost) by licht.localdomain (8.12.8/8.12.8/Submit) id t31KZ6xi004942; Wed, 1 Apr 2015 22:35:06 +0200 From: Peter Schauer Message-Id: <201504012035.t31KZ6xi004942@licht.localdomain> Subject: Re: [rfc, spu] Don't call set_gdbarch_cannot_step_breakpoint in spu_gdbarch_init To: palves@redhat.com (Pedro Alves) Date: Wed, 01 Apr 2015 20:35:00 -0000 Cc: qiyaoltc@gmail.com (Yao Qi), gdb-patches@sourceware.org, uweigand@de.ibm.com (Ulrich Weigand) In-Reply-To: <550C5D4B.9010808@redhat.com> from "Pedro Alves" at Mar 20, 2015 05:47:55 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-UI-Out-Filterresults: notjunk:1; X-SW-Source: 2015-04/txt/msg00072.txt.bz2 > +Ulrich > > Ulrich, any idea why cannot_step_breakpoint was ever needed? This was needed for alpha OSF/1. Back then it was the only architecture which would not ptrace step over an inserted breakpoint, causing an infinite loop while trying to single step over an inserted breakpoint. The diff back then was + #ifdef CANNOT_STEP_BREAKPOINT + /* If the target doesn't support stepping over a breakpoint, simply + continue, we will then hit the breakpoint anyway. */ + if (step && breakpoints_inserted && breakpoint_here_p (read_pc ())) + step = 0; + #endif I do not know if GDB ever tries to ptrace step over an inserted breakpoint nowadays, sorry. Meanwhile the alpha OSF/1 port is dead anyways... > 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); > > -- Peter Schauer Peter.Schauer@mytum.de