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.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 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=1686059005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Is8txygkGVQbOjQIwcWswFcDKc21gocZWMAwW0Zz9P4=; b=SSzhScTB3C+CsihqmmB1R08iI83NTYtpSl4cJe5Rm6kTdtc/B0h+PuLuULTZmxlx+sF1lc g5PPZ319K8qd62yRFmgCalgK8C1JysuWY1GgKTPXJqhFCOa4rbJh6AqM7zXAmUvAU4Sgme Tpn6FEQ80MEF3ziytmI8PNli4f40yxY= 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) From: Andrew Burgess 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-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,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: 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