From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 759 invoked by alias); 19 Aug 2010 08:49:26 -0000 Received: (qmail 745 invoked by uid 22791); 19 Aug 2010 08:49:25 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,TW_GJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.17.161) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 Aug 2010 08:49:19 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.1/8.13.1) with ESMTP id o7J8nGrD015986 for ; Thu, 19 Aug 2010 08:49:16 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 o7J8nFm13838014 for ; Thu, 19 Aug 2010 10:49:15 +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 o7J8nFBD025161 for ; Thu, 19 Aug 2010 10:49:15 +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 o7J8nEkP025126; Thu, 19 Aug 2010 10:49:14 +0200 Message-Id: <201008190849.o7J8nEkP025126@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Thu, 19 Aug 2010 10:49:14 +0200 Subject: Re: [rfc] Strip Thumb bit from PC returned by arm_get_longjmp_target To: matthew.gretton-dann@arm.com Date: Thu, 19 Aug 2010 08:49:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <201008181828.o7IISkgd004584@d12av02.megacenter.de.ibm.com> from "Ulrich Weigand" at Aug 18, 2010 08:28:46 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-08/txt/msg00332.txt.bz2 > Matthew Gretton-Dann wrote: > > > The problem with the patch is it removes what may be the only way we > > have of telling the instruction state of the longjmp target. If you > > have debugging information (mapping symbols at the very least) > > everything is fine, but if you don't then how do you tell what the state > > is? arm_pc_is_thumb does use this bit to detect the instruction state > > (and arm_breakpoint_from_pc then uses this result to determine the > > breakpoint type). > > Ah, I see. I was confused about just where the Thumb bit was supposed > to be present and where not, sorry ... > > > In the case above I think the correct fix is to make > > arm_adjust_breakpoint_address not strip out the address bits (which it > > does when trying to work out whether we are single stepping through an > > IT block). > > Does the patch below seem reasonable to you? Actually, it turns out this new patch doesn't work. It leads to: Breakpoint 4 at 0x84ec: file ../../../gdb-head/gdb/testsuite/gdb.threads/threxit-hop-specific.c, line 47.^M (gdb) next^M ^M Program received signal SIGTRAP, Trace/breakpoint trap.^M This happens because GDB now no longer recognizes the PC address when the breakpoint trap arrives. The PC is compared against the breakpoint location's loc->address value -- which now has the Thumb bit set, but the PC doesn't. Note that while the Thumb bit gets removes in arm_breakpoint_from_pc, this affects only loc->placed_address, not loc->address. This seems to indicate that in fact, breakpoint addresses must *not* have the Thumb bit set ... Do you have a case where this works for you? Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com