From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29423 invoked by alias); 8 Feb 2010 19:35:29 -0000 Received: (qmail 29403 invoked by uid 22791); 8 Feb 2010 19:35:29 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtagate7.de.ibm.com (HELO mtagate7.de.ibm.com) (195.212.17.167) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Feb 2010 19:35:22 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate7.de.ibm.com (8.13.1/8.13.1) with ESMTP id o18JZJUw008165 for ; Mon, 8 Feb 2010 19:35:19 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 v10.0) with ESMTP id o18JZJWQ1433690 for ; Mon, 8 Feb 2010 20:35:19 +0100 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 o18JZJ8O023842 for ; Mon, 8 Feb 2010 20:35:19 +0100 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 o18JZIMA023833; Mon, 8 Feb 2010 20:35:18 +0100 Message-Id: <201002081935.o18JZIMA023833@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 08 Feb 2010 20:35:17 +0100 Subject: Re: RFC: Updates support for breakpoints that generate SIGILL To: dan@codesourcery.com (Daniel Jacobowitz) Date: Mon, 08 Feb 2010 19:35:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <20100128215914.GB2813@caradoc.them.org> from "Daniel Jacobowitz" at Jan 28, 2010 04:59:14 PM 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: 2010-02/txt/msg00223.txt.bz2 Daniel Jacobowitz wrote: > 2010-01-28 Daniel Jacobowitz > > * infrun.c (prepare_to_proceed): Handle other signals which might > match a breakpoint. > (handle_inferior_event): Move the check for unusual breakpoint > signals earlier. Unfortunately this change broke Cell/B.E. debugging. The problem is that with the change, handle_inferior_event will now *always* look up a regcache, even when the process has exited. Before the patch, the code has always taken care to avoid that; while some targets don't mind, others will break (in particular, the Cell/B.E. multi-arch target does). The patch below changes this to only look up the regcache when needed (in particular, this implies the process is still there). Tested on Cell/B.E. (ppc32 and ppc64) with no regressions. Does this look OK to you? Bye, Ulricu ChangeLog: * infrun.c (handle_inferior_event): Do not look up regcache for exited processes. Index: gdb/infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.428 diff -u -p -r1.428 infrun.c --- gdb/infrun.c 29 Jan 2010 15:40:21 -0000 1.428 +++ gdb/infrun.c 8 Feb 2010 18:03:29 -0000 @@ -2664,7 +2664,6 @@ handle_inferior_event (struct execution_ { struct frame_info *frame; struct gdbarch *gdbarch; - struct regcache *regcache; int sw_single_step_trap_p = 0; int stopped_by_watchpoint; int stepped_after_stopped_by_watchpoint = 0; @@ -2735,18 +2734,21 @@ handle_inferior_event (struct execution_ non-executable stack. This happens for call dummy breakpoints for architectures like SPARC that place call dummies on the stack. */ - regcache = get_thread_regcache (ecs->ptid); if (ecs->ws.kind == TARGET_WAITKIND_STOPPED && (ecs->ws.value.sig == TARGET_SIGNAL_ILL || ecs->ws.value.sig == TARGET_SIGNAL_SEGV - || ecs->ws.value.sig == TARGET_SIGNAL_EMT) - && breakpoint_inserted_here_p (get_regcache_aspace (regcache), - regcache_read_pc (regcache))) + || ecs->ws.value.sig == TARGET_SIGNAL_EMT)) { - if (debug_infrun) - fprintf_unfiltered (gdb_stdlog, - "infrun: Treating signal as SIGTRAP\n"); - ecs->ws.value.sig = TARGET_SIGNAL_TRAP; + struct regcache *regcache = get_thread_regcache (ecs->ptid); + + if (breakpoint_inserted_here_p (get_regcache_aspace (regcache), + regcache_read_pc (regcache))) + { + if (debug_infrun) + fprintf_unfiltered (gdb_stdlog, + "infrun: Treating signal as SIGTRAP\n"); + ecs->ws.value.sig = TARGET_SIGNAL_TRAP; + } } /* Mark the non-executing threads accordingly. In all-stop, all -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com