From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by sourceware.org (Postfix) with ESMTPS id 48A6A38CA5FE for ; Mon, 13 Nov 2023 15:05:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 48A6A38CA5FE Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 48A6A38CA5FE Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699887912; cv=none; b=AnmVsHMtPhEzs3Qr8Btecie6/O4uapZS7SP/Z43xwnLPO3j7MyiprEHjLdw4xBrJVb68aICyh3t+tYwpEmN4VK1w6yGesn9JC4Rx6xiEQvU7MDt49KqHiXZMNUPj6dTx9XVbCgh7JN2KqN0XuwS6Z7vmDCOTVO90JyfaeP1qHxo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699887912; c=relaxed/simple; bh=dMRci4gD45iFyNob/ent34oTKm2B0dh6P8Sw4LH5Z2A=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=Ttf2muZY4Eulr9nyRZAR0J4TrYb76xQdph5uk7im9McjZsDuh4ZIa75OgJwef5ArhLY1k8YDFg8PaM90kXzqOeBcgswaLIg39slCIme2lQ0Bs4seQLbF/fH+5wIW+5jO0Qp68uPzc3GXKclt0AwkLEFUe2IPBPyebyFCBESLutA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-40859dee28cso37942415e9.0 for ; Mon, 13 Nov 2023 07:05:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699887909; x=1700492709; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MEArM3chMuSpOogq7GO84AxddDwcITYlG0Ehkl6Xebc=; b=aY+C5MnfZn4ltuSKAJb5meYayRl8Mf1ou/5uXSe9HuZRQzIEqy6R8KiieYkrXrIRAo GPiscrIKjqrJXj+UTmCMjnZteMfDaEjoMG2BpZR0fY2Py3rsmqrhnGhcBEuZZpKmP80s cBgpKBFML3QAxbZ7dZFGCJ56572W85vYL8jyurmeOEkwaTj+FGX9jlXpbXlKo0JtN7KZ bpduf/kpD4UAOHDH/ha2pvxxldgJ4g/PrVeiLlVBLz4zsWMWnc+5Wyx64rNGRo71zk1s th1Nx9W4QHPj1Ln2ZQdgocbS03ynFc/6d2cJ8Yj2sopqBRIHh4jTVfff7lQ9K+OskZd1 mkGQ== X-Gm-Message-State: AOJu0Yx0OElf55ObwstFbFzfToRlgNn6W/ez/EXXsSh2G2Hs+tXivm6V EdJ6RBzKQjOunJs3IXEeDkpeIQRNB18= X-Google-Smtp-Source: AGHT+IEBph6JW7wxSCcAB+dBcAoiFNL/zFamEtGVndAvJzxWGWkRt+ISsz3UBfAEAO/sK82Sj9+law== X-Received: by 2002:a05:600c:4706:b0:405:4a78:a892 with SMTP id v6-20020a05600c470600b004054a78a892mr5106571wmo.9.1699887909120; Mon, 13 Nov 2023 07:05:09 -0800 (PST) Received: from localhost ([2001:8a0:f91e:1a00:8060:1e54:fb28:9635]) by smtp.gmail.com with UTF8SMTPSA id f23-20020a1c6a17000000b0040648217f4fsm13957400wmc.39.2023.11.13.07.05.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Nov 2023 07:05:08 -0800 (PST) From: Pedro Alves To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [FYI/pushed v4 07/25] Thread options & clone events (native Linux) Date: Mon, 13 Nov 2023 15:04:09 +0000 Message-Id: <20231113150427.477431-8-pedro@palves.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231113150427.477431-1-pedro@palves.net> References: <20231113150427.477431-1-pedro@palves.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,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: 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 Reviewed-By: Andrew Burgess Change-Id: If90316e2dcd0c61d0fefa0d463c046011698acf9 --- 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 da870e84922..5bbdabc241a 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -4503,6 +4503,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 1cdbeafd4f3..cf236160b4a 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.34.1