From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3671 invoked by alias); 10 May 2007 22:58:35 -0000 Received: (qmail 3562 invoked by uid 22791); 10 May 2007 22:58:34 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate7.de.ibm.com (HELO mtagate7.de.ibm.com) (195.212.29.156) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 10 May 2007 22:58:31 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate7.de.ibm.com (8.13.8/8.13.8) with ESMTP id l4AMwT7R315248 for ; Thu, 10 May 2007 22:58:29 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.3) with ESMTP id l4AMwTa93854462 for ; Fri, 11 May 2007 00:58:29 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l4AMwSYH026581 for ; Fri, 11 May 2007 00:58:28 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id l4AMwSF4026578; Fri, 11 May 2007 00:58:28 +0200 Message-Id: <200705102258.l4AMwSF4026578@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 11 May 2007 00:58:28 +0200 Subject: Re: [RFC] "single step" atomic instruction sequences as a whole on PPC To: drow@false.org (Daniel Jacobowitz) Date: Thu, 10 May 2007 22:58:00 -0000 From: "Ulrich Weigand" Cc: emi-suzuki@tjsys.co.jp (Emi SUZUKI), jan.kratochvil@redhat.com, luisgpm@linux.vnet.ibm.com, gdb-patches@sourceware.org In-Reply-To: <20070510213624.GA2822@caradoc.them.org> from "Daniel Jacobowitz" at May 10, 2007 05:36:24 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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-05/txt/msg00180.txt.bz2 Daniel Jacobowitz wrote: > On Thu, May 10, 2007 at 11:30:53PM +0200, Ulrich Weigand wrote: > > This looks just like a problem we fixed for the combined debugger; > > cancel_breakpoints_callback should cancel SIGTRAP events caused by > > software single-step breakpoints just the same as those caused by > > other breakpoints. > > Maybe it would be more elegant to anticipate the day that single step > breakpoints are completely normal: make breakpoint_inserted_here_p > check them? This is already the only caller. Good point. Something like the patch below? I've also added the check to software_breakpoint_inserted_here_p; that seemed to make more sense that not. (I'm suspicious about adjust_pc_after_break, the only caller of software_breakpoint_inserted_here_p anyway; I think this may no longer be correct after the software single-step changes ...) Bye, Ulrich ChangeLog: * breakpoint.c (single_step_breakpoint_inserted_here_p): New function. (breakpoint_inserted_here_p): Call it. (software_breakpoint_inserted_here_p): Likewise. diff -urNp gdb-orig/gdb/breakpoint.c gdb-head/gdb/breakpoint.c --- gdb-orig/gdb/breakpoint.c 2007-05-11 00:15:25.160082872 +0200 +++ gdb-head/gdb/breakpoint.c 2007-05-11 00:22:39.846579732 +0200 @@ -202,6 +202,8 @@ static void tcatch_command (char *arg, i static void ep_skip_leading_whitespace (char **s); +static int single_step_breakpoint_inserted_here_p (CORE_ADDR pc); + /* Prototypes for exported functions. */ /* If FALSE, gdb will not use hardware support for watchpoints, even @@ -1841,6 +1843,10 @@ breakpoint_inserted_here_p (CORE_ADDR pc } } + /* Also check for software single-step breakpoints. */ + if (single_step_breakpoint_inserted_here_p (pc)) + return 1; + return 0; } @@ -1872,6 +1878,10 @@ software_breakpoint_inserted_here_p (COR } } + /* Also check for software single-step breakpoints. */ + if (single_step_breakpoint_inserted_here_p (pc)) + return 1; + return 0; } @@ -7951,6 +7961,23 @@ remove_single_step_breakpoints (void) } } +/* Check whether a software single-step breakpoint is inserted at PC. */ + +static int +single_step_breakpoint_inserted_here_p (CORE_ADDR pc) +{ + int i; + + for (i = 0; i < 2; i++) + { + struct bp_target_info *bp_tgt = single_step_breakpoints[i]; + if (bp_tgt && bp_tgt->placed_address == pc) + return 1; + } + + return 0; +} + /* This help string is used for the break, hbreak, tbreak and thbreak commands. It is defined as a macro to prevent duplication. -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com