From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 211893858C74 for ; Thu, 13 Jul 2023 12:23:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 211893858C74 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689250982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S7CUSB6sACRl5k9/3KfjwTYHlBFfiY6sQBqC8D6DmfE=; b=A9NMHvdlXqptC+Sz27PHJpE+uDtp16Mdj9cLoWOSeA53oPiw26KZevkwEOwF8zrnVtW8pd lAQSMfhr7pI8tk6mDd/UaBFdYLHV/bPzAzDbNTWUhcKGuIU7XmRByDT/bF0bBA7pP+g9Qb jZEV0P9O5Lrm3F4hh9SPCd9xwOekdpk= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-19-IhL1NkDKOP2QzJOnCdYGjQ-1; Thu, 13 Jul 2023 08:23:00 -0400 X-MC-Unique: IhL1NkDKOP2QzJOnCdYGjQ-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-76594ad37fcso97169385a.2 for ; Thu, 13 Jul 2023 05:22:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689250978; x=1691842978; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=S7CUSB6sACRl5k9/3KfjwTYHlBFfiY6sQBqC8D6DmfE=; b=QIaaSAv7thb+l+qyYcIWxihSqHESsB01fK/2l/vdt88Zzu2AWDl/JtGmmdjXThsoid CHl3uoXnV8N3J+k7EyD6E2dRsFk5qG8+WTcO7V7ykWwLziS3io4IoiX1TotYsDmcdoqJ bASY93RmbFoYkof3XlnvA8ZK9RheWYVFXhc6scx3yzUuy3cQgjWavbk08mAGzpWOAVtW byR4CUY8QZ3N7Ia/m9kkl/MAhUqH2ENzVQ5XBlT8SWyTwnBY+Yw44omVjdYV4Zr54iDD hnWabFv+7GCM0B2Tyl0W4ptJ3ojzzKEo0N/KYaYbDXcp0H/GkRYT0Q7hs7GhmtR4m0c1 7ofw== X-Gm-Message-State: ABy/qLZHdZmq7XJ8pwFht2pXy5pr0ofBlHVDsVh3ccuqCpznCGa5jMrQ Bc3+87NXu1Xo8E8LM5iRIO+4/iAzZjsOio0qNK2Nzb5wmwdjcr96YhP5N5L8MBjt3mqGokvj/wL beIVHVP1asSgJPuFA6DSJmHZS0oPhCQ== X-Received: by 2002:a05:620a:24d3:b0:763:aa49:bd3f with SMTP id m19-20020a05620a24d300b00763aa49bd3fmr1963847qkn.43.1689250978776; Thu, 13 Jul 2023 05:22:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlGvc01cGdTp3A0dGAeH6aYWQCxhyDbFh3DguIV0suMNJwe02HmUMcs48io8UMAdi3fgLmoKDQ== X-Received: by 2002:a05:620a:24d3:b0:763:aa49:bd3f with SMTP id m19-20020a05620a24d300b00763aa49bd3fmr1963804qkn.43.1689250978182; Thu, 13 Jul 2023 05:22:58 -0700 (PDT) Received: from [192.168.0.129] (ip-94-112-225-44.bb.vodafone.cz. [94.112.225.44]) by smtp.gmail.com with ESMTPSA id oo15-20020a05620a530f00b00767e1c593acsm2407313qkn.79.2023.07.13.05.22.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Jul 2023 05:22:57 -0700 (PDT) Message-ID: Date: Thu, 13 Jul 2023 14:22:56 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v2 2/2] gdb: retain thread-specific breakpoints in reverse execution targets To: Magne Hov , gdb-patches@sourceware.org References: <20230629083651.3145268-1-mhov@undo.io> <20230707162451.3605544-1-mhov@undo.io> <20230707162451.3605544-3-mhov@undo.io> From: Bruno Larsen In-Reply-To: <20230707162451.3605544-3-mhov@undo.io> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 07/07/2023 18:24, Magne Hov via Gdb-patches wrote: > Thread-specific breakpoints are currently ignored and removed (since > 49fa26b0411d990d36f3f6c095d167f3d12afdf4) if the corresponding thread > has exited. This makes sense for targets that only execute in the > forward direction because those breakpoints can never be hit again, but > for targets with reverse execution the same thread can be seen again. > --- Hi! Thanks for working on this. Same as the other one, it looks good to go Reviewed-By: Bruno Larsen I hope a global maintainer or Markus look at it soon to approve it! -- Cheers, Bruno > gdb/breakpoint.c | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) > > diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c > index da6c8de9d14..9a25c5f663d 100644 > --- a/gdb/breakpoint.c > +++ b/gdb/breakpoint.c > @@ -3157,10 +3157,12 @@ insert_breakpoint_locations (void) > continue; > > /* There is no point inserting thread-specific breakpoints if > - the thread no longer exists. ALL_BP_LOCATIONS bp_location > - has BL->OWNER always non-NULL. */ > + the thread no longer exists, unless the target supports > + reverse execution. ALL_BP_LOCATIONS bp_location has > + BL->OWNER always non-NULL. */ > if (bl->owner->thread != -1 > - && !valid_global_thread_id (bl->owner->thread)) > + && !valid_global_thread_id (bl->owner->thread) > + && !target_can_execute_reverse ()) > continue; > > switch_to_program_space_and_thread (bl->pspace); > @@ -3245,12 +3247,18 @@ remove_breakpoints (void) > return val; > } > > -/* When a thread exits, remove breakpoints that are related to > - that thread. */ > +/* When a thread exits, remove breakpoints that are related to that > + thread and cannot be hit again. */ > > static void > remove_threaded_breakpoints (struct thread_info *tp, int silent) > { > + /* Targets that support reverse execution may navigate to a point in > + time where an exited thread reappears and where its breakpoints > + are still relevant. */ > + if (target_can_execute_reverse ()) > + return; > + > for (breakpoint &b : all_breakpoints_safe ()) > { > if (b.thread == tp->global_num && user_breakpoint_p (&b))