From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4487 invoked by alias); 18 Sep 2014 01:49:42 -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 1882 invoked by uid 89); 18 Sep 2014 01:49:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 Sep 2014 01:49:25 +0000 Received: from svr-orw-fem-05.mgc.mentorg.com ([147.34.97.43]) by relay1.mentorg.com with esmtp id 1XUQqX-0006vU-VE from Yao_Qi@mentor.com ; Wed, 17 Sep 2014 18:49:22 -0700 Received: from GreenOnly (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.3.181.6; Wed, 17 Sep 2014 18:49:21 -0700 From: Yao Qi To: Pedro Alves CC: Subject: Re: [PATCH v2 3/3] Fix "breakpoint always-inserted off"; remove "breakpoint always-inserted auto" References: <1410994028-24282-1-git-send-email-palves@redhat.com> <1410994028-24282-4-git-send-email-palves@redhat.com> Date: Thu, 18 Sep 2014 01:49:00 -0000 In-Reply-To: <1410994028-24282-4-git-send-email-palves@redhat.com> (Pedro Alves's message of "Wed, 17 Sep 2014 23:47:08 +0100") Message-ID: <87r3z9zopi.fsf@codesourcery.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: 2014-09/txt/msg00609.txt.bz2 Pedro Alves writes: > - /* Insert locations now, even if breakpoints_always_inserted_mode is > - false. */ > + /* Insert locations now, irrespective of > + breakpoints_should_be_inserted_now. E.g., say all threads are > + stopped right now, and the user did "continue". We need to > + insert breakpoints _before_ resuming the target, but > + UGLL_MAY_INSERT wouldn't insert them, because > + breakpoints_should_be_inserted_now returns false at that point, > + as no thread is running yet. */ > UGLL_INSERT Yeah, that is clear to me. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see .= */ > + > +#include > +#include > +#include pthread.h is included twice. > + > + gdb_breakpoint [gdb_get_line_number "breakpoint A child here"] > + gdb_continue_to_breakpoint "run to child breakpoint" > + gdb_test "info threads" "\\\* 2 .* 1.*" "info threads shows all thre= ads" > + > + delete_breakpoints > + > + # Leave one thread stopped, so GDB > + gdb_test_no_output "set scheduler-locking on" > + > + gdb_test "continue &" "Continuing\." > + > + # Switch to a stopped thread, so GDB can poke at memory freely. > + gdb_test "thread 1" "Switching to .*" "switch to stopped thread" > + > + gdb_test "info threads" "2.*running.*\\\* 1.*" "info threads shows r= unning thread" > + IWBN to check thread 1 is stopped too, because thread 1 isn't stopped in non-stop mode, or the test can stop thread 1 explicitly if it isn't. --=20 Yao (=E9=BD=90=E5=B0=A7)