From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29480 invoked by alias); 10 Oct 2011 14:40:26 -0000 Received: (qmail 29464 invoked by uid 22791); 10 Oct 2011 14:40:24 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate2.uk.ibm.com (HELO mtagate2.uk.ibm.com) (194.196.100.162) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 10 Oct 2011 14:40:07 +0000 Received: from d06nrmr1307.portsmouth.uk.ibm.com (d06nrmr1307.portsmouth.uk.ibm.com [9.149.38.129]) by mtagate2.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p9AEe5Qt026536 for ; Mon, 10 Oct 2011 14:40:05 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p9AEe4iQ2121738 for ; Mon, 10 Oct 2011 15:40:05 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p9AEe4sg001882 for ; Mon, 10 Oct 2011 08:40:04 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p9AEe3qO001824; Mon, 10 Oct 2011 08:40:03 -0600 Message-Id: <201110101440.p9AEe3qO001824@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 10 Oct 2011 16:40:03 +0200 Subject: Re: [try 2nd 5/8] Displaced stepping for Thumb 32-bit insns To: yao@codesourcery.com (Yao Qi) Date: Mon, 10 Oct 2011 14:40:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org (gdb-patches@sourceware.org) In-Reply-To: <4E91A158.5000306@codesourcery.com> from "Yao Qi" at Oct 09, 2011 09:27:52 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: 2011-10/txt/msg00267.txt.bz2 Yao Qi wrote: > On 09/14/2011 09:39 PM, Ulrich Weigand wrote: > >> > 1. Failures in gdb.arch/thumb2-it.exp and gdb.base/gdb1555.exp. > >> > These failures are caused by missing IT support in thumb displaced stepping. > > Ah, right. Fortunately, I think IT support should be relatively easy to > > add, in fact we should be able to just completely emulate it: > > > > - The first thing we do when we're about to displaced-step a Thumb insn > > is to check the itstate and see whether we're in an IT block. > > > > - If so, we check whether the condition is true, given the current state > > of the flags. > > > > - If the condition is false, we always use a NOP as the displaced > > instruction; otherwise, compute the displaced instruction as usual. > > > > - In either case, set the CSPR register as if we're outside of any > > IT block while actually executing the displaced instruction. (This > > also makes sure that the breakpoint at the end will always be > > executed.) > > > > - During fixup after execution is done, re-set IT state in the CSPR > > to the proper value (advanced by one instruction). > > > > See also thumb_get_next_pc_raw for how to manipulate IT state ... > > > > Does this look good to you? > > > > Yes, it looks right to me in general. However, it doesn't handle the > case of `stepi' in condition blocks when displaced stepping is enabled, > as gdb.arch/thumb2-it.exp tested. We expect inferior stops at the next > true-condition instruction instead of next instruction after typing > `stepi'. In this design, inferior will stop at the next instruction > regardless of condition. We may adjust PC value in fixup to skip these > false-condition instructions. OK, good point. I agree. Thanks, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com