From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123834 invoked by alias); 13 Apr 2016 16:21:57 -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 123819 invoked by uid 89); 13 Apr 2016 16:21:56 -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:2073, HX-Received:10.66.65.169 X-HELO: mail-pa0-f48.google.com Received: from mail-pa0-f48.google.com (HELO mail-pa0-f48.google.com) (209.85.220.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 13 Apr 2016 16:21:51 +0000 Received: by mail-pa0-f48.google.com with SMTP id zm5so35870214pac.0 for ; Wed, 13 Apr 2016 09:21:50 -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:message-id :user-agent:mime-version:content-transfer-encoding; bh=qoJFh+U9kq75uq5ZXLKFfkZXbPV7EDRujUpvly0YAew=; b=NSDvi6sxOLR05bpn4fhFCsVvQ+PKJMyejyJGiGHQii6ecN/UHBVuaudKaoq8SadxGK Dm+sxvusTzJ3Pt0JcLDqOQ0Rz/rPomo2PYi3+fMXSexrcA/rQcs7/UbcMp1OkKVPL0Vx 0Yykr3kW92II1UFZ+h7COW5nyiSPDu92/Tp+rAscZZlJxD1oRTX6HL6oSHFKPRrQ9JsC d9JZ6qq2DYxnkHfrTiCVxPwj+TzDJDs0RmQcUueLwES6KMq9WEW/LhxTxtmsHLt/Wa4d pQP3w6ihZT/VqmJpbtHYwhl2PMPqoCS+DJeMnC5muoGdFoY3ee6KYwt5G2ddAT7ICWpj i+5w== X-Gm-Message-State: AOPr4FVJbAPzwGcKk5s+oDL1Q0JS321/qM1BSVyejDLBhZxWBs4W96cYt5LgNk1mg0+BMg== X-Received: by 10.66.65.169 with SMTP id y9mr14186799pas.102.1460564509314; Wed, 13 Apr 2016 09:21:49 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id ey7sm52248620pab.47.2016.04.13.09.21.46 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 13 Apr 2016 09:21:48 -0700 (PDT) From: Yao Qi To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 3/7] Force to insert software single step breakpoint References: <1458749384-19793-1-git-send-email-yao.qi@linaro.org> <1458749384-19793-4-git-send-email-yao.qi@linaro.org> <570BB52F.7@redhat.com> Date: Wed, 13 Apr 2016 16:21:00 -0000 Message-ID: <86d1pto4xe.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-04/txt/msg00292.txt.bz2 Pedro Alves writes: > Another scenario occurred to me: > > - Thread A is software single-stepping. > - Thread B hits single-step breakpoint of thread A. > - We pause all threads and set thread B stepping past the > single-step breakpoint of thread A. > > But if the single-step breakpoint is for another thread, then > we won't actually manage to have thread B step past it, resulting > in spurious re-hits and no-guaranteed forward progress. See > e.g., non-stop-fair-events.exp: > > # On software single-step targets that don't support displaced > # stepping, threads keep hitting each others' single-step > # breakpoints, and then GDB needs to pause all threads to step > # past those. The end result is that progress in the main > # thread will be slower and it may take a bit longer for the > # signal to be queued; bump the timeout. I finally managed to reproduce that thread id in step_over_info is different from the thread id of the single-step breakpoint. GDB now gives the high priority to finishing step over, to avoid "threads keep hitting each others' single-step breakpoint". With my patch applied, single-step breakpoint (of threads other than we are stepping over) is still inserted even we try to step past the location, so the step-over can't be finished. > > Sounds like we may need to look at the single-step breakpoint's thread=20 > id, and only insert it if it is for the thread that is going to be=20 > doing the step-over? We may need to record that in step_over_info and=20 > pass more info to stepping_past_instruction_at. Yes, after I added a new field 'struct thread_info *thread' in 'struct step_over_info', I realize that IWBN to convert 'step_over_info' to 'the thread we are stepping over', so the fields 'aspace' and 'address' can be replaced by 'thread', like this, struct step_over_info { struct thread_info *thread; int nonsteppable_watchpoint_p; }; Is it a good idea? If there is nothing obviously wrong, I'll post patches to do this. --=20 Yao (=E9=BD=90=E5=B0=A7)