From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SZN7FSA4f2TtoR8AWB0awg (envelope-from ) for ; Tue, 06 Jun 2023 09:44:00 -0400 Received: by simark.ca (Postfix, from userid 112) id 4426D1E11E; Tue, 6 Jun 2023 09:44:00 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=adpFAbRL; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A5AF11E111 for ; Tue, 6 Jun 2023 09:43:58 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BC00B385802F for ; Tue, 6 Jun 2023 13:43:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BC00B385802F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1686059037; bh=Is8txygkGVQbOjQIwcWswFcDKc21gocZWMAwW0Zz9P4=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=adpFAbRLfJJog3Bq2WXzLxkl4xubsLw9Xu3g0btZG1UTcATDroc4fRuZchL3+VPMk g6hS7PBssW9YMfvOHKblL/dAl0fBaNc0+C5fz6dg+FBNpHIksPwB2FR1ha7RVlr8io /UaeAHVC9+2g87Yi1vI8+Gdijy17bnuaVU8mqMms= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 9D05F3857707 for ; Tue, 6 Jun 2023 13:43:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9D05F3857707 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-178-x9aD4UV3M7On_CM-kpIwlg-1; Tue, 06 Jun 2023 09:43:24 -0400 X-MC-Unique: x9aD4UV3M7On_CM-kpIwlg-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3f611d31577so30432315e9.0 for ; Tue, 06 Jun 2023 06:43:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686059002; x=1688651002; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Is8txygkGVQbOjQIwcWswFcDKc21gocZWMAwW0Zz9P4=; b=GLEAiePpIHD+kUTlslhpAFVLCOUUciJsElK/SfSvYFbVARBvJVMq2cSmg2W4rra1Sc GUm4Qa7exrq5Qnv9/VhIeFhxUAqz6LGnaA12tElLHV/5q86WjXxGWgnu1IImBgGf4WdO kOyzlAmKpDR+qf2wfSqcr4p1fzzHNX5DgwE3oBZSLM76SZiaXI/JU7/Ttr/OzP3607tH TAQ761d9r/j7KA6agDXuRrBOPL6AYQtRVA0Qgwi7eCrd/ohDnd/xWlbqkEuWNA2QIfco COwcki4ShEb5jUmAeiC3pw7JXOKMAw8Itz0kFham0hwCMIxI1aKvtrmSjuX+uO7VPw9r pv2g== X-Gm-Message-State: AC+VfDw+rEVgFUzo9aM1KxzVCa2Bt244rEumePf0o/xy+9aY1Zfbx344 Khcj8jVmno1udemcDiMD6Vj3N2SSgWU6qwUAMQIsJu9yyUJHWISsuYlEth7wt7tnElzcGPV9lk9 60cN1RGBDpjNDt0anrFiMKtxSN22qIw== X-Received: by 2002:adf:da51:0:b0:30a:ed4c:e17d with SMTP id r17-20020adfda51000000b0030aed4ce17dmr8643613wrl.5.1686059002743; Tue, 06 Jun 2023 06:43:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5g6BHIVZYd1tMy3rrmldoE1p8qBFtqRb9Fk1Gg3tdCIZcoL+doKIUdvLYaOl4gzD9dwXH2Kw== X-Received: by 2002:adf:da51:0:b0:30a:ed4c:e17d with SMTP id r17-20020adfda51000000b0030aed4ce17dmr8643600wrl.5.1686059002468; Tue, 06 Jun 2023 06:43:22 -0700 (PDT) Received: from localhost (11.72.115.87.dyn.plus.net. [87.115.72.11]) by smtp.gmail.com with ESMTPSA id d5-20020adfef85000000b003062675d4c9sm12620807wro.39.2023.06.06.06.43.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 06:43:21 -0700 (PDT) To: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [PATCH 09/31] Thread options & clone events (native Linux) In-Reply-To: <20221212203101.1034916-10-pedro@palves.net> References: <20221212203101.1034916-1-pedro@palves.net> <20221212203101.1034916-10-pedro@palves.net> Date: Tue, 06 Jun 2023 14:43:20 +0100 Message-ID: <87jzwg3dvr.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Pedro Alves writes: > This commit teaches the native Linux target about the > GDB_THREAD_OPTION_CLONE thread option. It's actually simpler to just > continue reporting all clone events unconditionally to the core. > There's never any harm in reporting a clone event when the option is > disabled. All we need to do is to report support for the option, > otherwise GDB falls back to use target_thread_events(). > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=19675 > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27830 > Change-Id: If90316e2dcd0c61d0fefa0d463c046011698acf9 LGTM. Reviewed-By: Andrew Burgess Thanks, Andrew > --- > gdb/linux-nat.c | 7 +++++++ > gdb/linux-nat.h | 2 ++ > 2 files changed, 9 insertions(+) > > diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c > index f3d02b740e8..5fadc82deb0 100644 > --- a/gdb/linux-nat.c > +++ b/gdb/linux-nat.c > @@ -4468,6 +4468,13 @@ linux_nat_target::thread_events (int enable) > report_thread_events = enable; > } > > +bool > +linux_nat_target::supports_set_thread_options (gdb_thread_options options) > +{ > + constexpr gdb_thread_options supported_options = GDB_THREAD_OPTION_CLONE; > + return ((options & supported_options) == options); > +} > + > linux_nat_target::linux_nat_target () > { > /* We don't change the stratum; this target will sit at > diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h > index 3ed25cc5ba4..258041b8271 100644 > --- a/gdb/linux-nat.h > +++ b/gdb/linux-nat.h > @@ -82,6 +82,8 @@ class linux_nat_target : public inf_ptrace_target > > void thread_events (int) override; > > + bool supports_set_thread_options (gdb_thread_options options) override; > + > bool can_async_p () override; > > bool supports_non_stop () override; > -- > 2.36.0