From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73231 invoked by alias); 18 Feb 2017 22:49:21 -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 73221 invoked by uid 89); 18 Feb 2017 22:49:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*i:sk:wwokh93, H*f:sk:wwokh93 X-HELO: mail-qk0-f182.google.com Received: from mail-qk0-f182.google.com (HELO mail-qk0-f182.google.com) (209.85.220.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 18 Feb 2017 22:49:10 +0000 Received: by mail-qk0-f182.google.com with SMTP id x71so5069962qkb.3 for ; Sat, 18 Feb 2017 14:49:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=PGitqRpcnGANeNF0qIBbTm7XtyAeFDBbbpkjF9kGc1c=; b=mrTKSGAT8x5wpQgI144Bb7OmZV/R33XbWW/c8B2D2+CuXfxjfKvBiL1cVQJoEzHP8K fwF3GAnhYuk0R+aSEmkE/FR4e8kYXj5ukxSDUmC47luBtMvYypw8teXoE1VJ/corLxBD 9WqlDmF20FVZIJMSJuFGAVKCvck7I6wXPX2S+hwhVEdJ3W2OQbOgFqzu+m5fmt8Hw7L0 UryzXzNaExfZZdOF7V4X4fMDWxueKBstMPTJ+WFQK7FJdCCiguwf31f3IEe3l5DswjKz 57Lrgjn1Mev3GvnnCSuo+39TO6a9PxHyrS5JS569X6RODWwlMXdoiMk3NQ8pPxGwAxQD YF4g== X-Gm-Message-State: AMke39l3i0mGNn0IyjWp+i8O2urObC1EysjnYBIC9/TW7FjJnUpRvOvAI/ctbMYWJbxPOEGx5xq3FOA25xFMSQ== X-Received: by 10.55.181.1 with SMTP id e1mr15424737qkf.122.1487458149112; Sat, 18 Feb 2017 14:49:09 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.140.194 with HTTP; Sat, 18 Feb 2017 14:49:08 -0800 (PST) In-Reply-To: References: <20161129120702.9490-1-antoine.tremblay@ericsson.com> <20170127150139.GB24676@E107787-LIN> <2255ed6f-a146-026c-f871-00e9a33dfcf0@redhat.com> From: Yao Qi Date: Sat, 18 Feb 2017 22:49:00 -0000 Message-ID: Subject: Re: [PATCH 1/2] This patch fixes GDBServer's run control for single stepping To: Antoine Tremblay Cc: Pedro Alves , "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00508.txt.bz2 On 17-02-17 19:17:56, Antoine Tremblay wrote: > > In ARM ARM, we have the pseudo code, > > > > boolean InITBlock() > > return (ITSTATE.IT<3:0> !=3D =E2=80=980000=E2=80=99); > > > > ITSTATE can be got from CPSR. > > Yes that's good if you're inserting a breakpoint at current PC but > otherwise you will need something else... In software single step, we calculate the next pcs, and select breakpoint kinds of them, according to current pc. If current pc is not within IT block (!InITBlock ()) or the last instruction in IT block (LastInITBlock ()), we can safely use 16-bit thumb breakpoint for any thumb instruction. That is, in gdbserver/linux-aarch32-low.c:arm_breakpoint_kind_from_current_state, we can return ARM_BP_KIND_THUMB if (!InITBlock () || LastInITBlock ()). Then, in some level, when installing software single step breakpoints, if one breakpoint type is ARM_BP_KIND_THUMB2 and installed address is 2-byte aligned, stop all threads. --=20 Yao (=E9=BD=90=E5=B0=A7)