From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21323 invoked by alias); 16 Mar 2016 11:47:49 -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 21276 invoked by uid 89); 16 Mar 2016 11:47:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:947 X-HELO: mail-pf0-f174.google.com Received: from mail-pf0-f174.google.com (HELO mail-pf0-f174.google.com) (209.85.192.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 16 Mar 2016 11:47:45 +0000 Received: by mail-pf0-f174.google.com with SMTP id u190so72384386pfb.3 for ; Wed, 16 Mar 2016 04:47:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=CbWkgJ+1I3MKyOj5SUA8XhBR1+UoZvJK6V2NHfsRx8g=; b=FM/1+ojzhbmG3fDnw3cPqzuAU8qpLDnkVjY3YLLtX43FFTzAI+B1ChA2scN5PnYDqI uEqiHEA7h4BV0aaeLZUESSrlVUSowRJFGdorO/0XdNQT3N9r6G6wt4XE+gDGXQeZf+L4 O03NU9kbVsksmBV8xYHvi3SqySiuuaTkdryNXcrI9/aukxO0TEgS6JiD4+qkKRXrJssq lHGBDu9S5/XNNqAdwbUKYKuVvb6mxn20u1n8wyuhWmGoGQ0tXUZ0mG4MEl2w40RNctNN BilCDU30P9BVZncMHPsSS95TuSjn5OEejuggsB7MfuSuJ4FT3eWUzRBEdfaH8TGCKfY+ 96Gg== X-Gm-Message-State: AD7BkJIqzlfes2BPv90MHSfuP+MxAIuOZ8pCsCWr2oUlPx3W4ScP7een3KJmFc1a1ff9sQ== X-Received: by 10.66.235.129 with SMTP id um1mr5113479pac.17.1458128863404; Wed, 16 Mar 2016 04:47:43 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id y27sm5088125pfi.82.2016.03.16.04.47.41 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 16 Mar 2016 04:47:42 -0700 (PDT) From: Yao Qi To: Pedro Alves Cc: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH 4/8] Force to insert software single step breakpoint References: <1457088276-1170-1-git-send-email-yao.qi@linaro.org> <1457088276-1170-5-git-send-email-yao.qi@linaro.org> <56E2B0C2.705@redhat.com> Date: Wed, 16 Mar 2016 11:47:00 -0000 In-Reply-To: <56E2B0C2.705@redhat.com> (Pedro Alves's message of "Fri, 11 Mar 2016 11:49:22 +0000") Message-ID: <86egbay78l.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00253.txt.bz2 Pedro Alves writes: > Hmm, I think we might need to do something else. > > If you put a breakpoint there, then the instruction under > the breakpoint won't execute at all. That is intended, because if the instruction is executed, it can't be stopped. > > If it's a conditional branch, and the condition is false, > we will fail to ever advance past the instruction. > > Similarly if the branch instruction happens to have important > side effects (flags? counters?). We can switch to displaced stepping if we find the instruction may branch to itself. Say, we can change gdbarch software_single_step to return a vector of dest addresses of current pc and caller inserts software single step breakpoints to these dest addresses. If any element of vector equals to the current pc, switch to displaced stepping if supported. What do you think? --=20 Yao (=E9=BD=90=E5=B0=A7)