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 5F5DD385842E for ; Sat, 2 Dec 2023 10:52:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5F5DD385842E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5F5DD385842E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701514364; cv=none; b=Et4ZjSLtGukhnddMNkulhvytnvckemK0eUWpVPqJBa502OTWnm/6pBU4PbPHXm9zQipT1FwhvPtxqQsFzSRtYp1qoGk/tm6uGKrV4jy5ZaDiT3HgJz+HKd9du/cbFO5TX5O/ko9cWGWrnFHbBmoaJYTIoyxIIPoLd+cSnID5c58= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701514364; c=relaxed/simple; bh=37bgEsICtTrrqZK/dRqYH/z2o+Ydr3AHF2SF6Gwu2MY=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=LD/gxyzedkPhitXiEpIYPwrSNdhuR1rhuRBarB0HgfypCKj8zILsq6Ja8g/29HoFfXlGmIHHamDwRpbMAZKxYJ2EZDpGX7pCbVfaGL4rq3Qxth6wZ/a1puj63YmP6EMdCcGuFwQjJaAoNz+JK9szKeXZuRFoCvwzuKBn1gmWT3M= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701514363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pJMEDZO/YfIvQ8BxnYGw7L8d6eGBsR9Lw+57W9O+Jmc=; b=ZBm4FRD/zdlESsrIGMh5+tuaGQqfmdA8yoTjV9kgVZitwvXgzyU9lKMHbyg7Dd1Ir+xAdn o3Upe8zbw1XXnHExK3bHHdltMRQzmwhyPlF6Vmd4Zd3wCoOvIPMkljbMImGlQiAw+68SBg 9AhbDMyzTUkdnnJ7uz6urhGJaITrhc4= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-391-UsV8W55qOtaEe3PIg3ibcw-1; Sat, 02 Dec 2023 05:52:41 -0500 X-MC-Unique: UsV8W55qOtaEe3PIg3ibcw-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-40b357e2a01so19235465e9.1 for ; Sat, 02 Dec 2023 02:52:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701514360; x=1702119160; 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=pJMEDZO/YfIvQ8BxnYGw7L8d6eGBsR9Lw+57W9O+Jmc=; b=IyTlTGgZLmsMVS1Hngk/ABGLFBK41j8c8w1JGWH+P5mLwoTrJvzKrpfsn0yQuYmWyf 1SZ3H8H8KdigO538/43TH1JYCIX7t6gwrdrulEtn8e8vv6UNJtBZI4s7gZGfoBp82Qgf vK2IHX4KIZgN9DKmatUbP7qJ31UQ6TRuawtoi9xY/yM8NwCD74PfPca9GxG7WDU4Qzj2 lOFkyCy3mMiGj/oEIlNrEOB1nEaAD0X8nhXyR4YGrCZRGP8y0bSpaDKKy0kSzkRbTCjc ud/2nPsylj3jXMrXjrm5Vp4jL6iCDDH4h9hfLTewBjnP0XCM+X19RFqigVNIoD5u2t8I X2JQ== X-Gm-Message-State: AOJu0YwnOFjmvQlOMyiLhFDKOsOwBJxMIuDyZH2NS5YXHLXwNRL3M7og n6Xg5MDTWND/TnPd8zzAgtv3iCzkLSlxPUIZEmbcZP8FNSyckMGRGnJ2KgoFv+M3gezXNj4YjKg JOhL4hAaMLxCiXPV5r4Dze3EcUfNl7P80fRqxsO6T8i09Fo18xP8XbODz5+1HVAuUQmeIOP8GWS sElMbzeQ== X-Received: by 2002:a7b:cc0c:0:b0:40b:5e4a:40b0 with SMTP id f12-20020a7bcc0c000000b0040b5e4a40b0mr759643wmh.208.1701514360581; Sat, 02 Dec 2023 02:52:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IEpruTLvQ6kLY/GhkDOSqXtciFqMNVqk1Vn88AwvEiAAmGGuZwK0+eV76hBNzjPX2UX1t6Hxw== X-Received: by 2002:a7b:cc0c:0:b0:40b:5e4a:40b0 with SMTP id f12-20020a7bcc0c000000b0040b5e4a40b0mr759638wmh.208.1701514360267; Sat, 02 Dec 2023 02:52:40 -0800 (PST) Received: from localhost (92.40.184.5.threembb.co.uk. [92.40.184.5]) by smtp.gmail.com with ESMTPSA id gq18-20020a170906e25200b00a0988d69549sm2919490ejb.189.2023.12.02.02.52.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 02:52:39 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess , Tankut Baris Aktemur Subject: [PATCHv9 1/5] Revert "gdb: remove unnecessary parameter wait_ptid from do_target_wait" Date: Sat, 2 Dec 2023 10:52:30 +0000 Message-Id: <50f6f3a71303cb84646a6761dd53a56a3b6ca8c3.1701514066.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_ABUSEAT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,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: This reverts commit ac0d67ed1dcf470bad6a3bc4800c2ddc9bedecca. There was nothing wrong with the commit which I'm reverting here, but it removed some functionality that will be needed for a later commit; that is, the ability for GDB to ask for events from a specific ptid_t via the do_target_wait function. In a follow up commit, this functionality will be used to implement inferior function calls in multi-threaded inferiors. This is not a straight revert of the above commit. Reverting the above commit replaces a 'nullptr' with 'NULL', I've gone in and changed that, preserving the 'nullptr'. Reviewed-By: Tankut Baris Aktemur --- gdb/infrun.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index 45c1b4a79bb..8ef22c6453a 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -4118,7 +4118,8 @@ do_target_wait_1 (inferior *inf, ptid_t ptid, more events. Polls for events from all inferiors/targets. */ static bool -do_target_wait (execution_control_state *ecs, target_wait_flags options) +do_target_wait (ptid_t wait_ptid, execution_control_state *ecs, + target_wait_flags options) { int num_inferiors = 0; int random_selector; @@ -4128,9 +4129,10 @@ do_target_wait (execution_control_state *ecs, target_wait_flags options) polling the rest of the inferior list starting from that one in a circular fashion until the whole list is polled once. */ - auto inferior_matches = [] (inferior *inf) + auto inferior_matches = [&wait_ptid] (inferior *inf) { - return inf->process_target () != nullptr; + return (inf->process_target () != nullptr + && ptid_t (inf->pid).matches (wait_ptid)); }; /* First see how many matching inferiors we have. */ @@ -4169,7 +4171,7 @@ do_target_wait (execution_control_state *ecs, target_wait_flags options) auto do_wait = [&] (inferior *inf) { - ecs->ptid = do_target_wait_1 (inf, minus_one_ptid, &ecs->ws, options); + ecs->ptid = do_target_wait_1 (inf, wait_ptid, &ecs->ws, options); ecs->target = inf->process_target (); return (ecs->ws.kind () != TARGET_WAITKIND_IGNORE); }; @@ -4619,7 +4621,7 @@ fetch_inferior_event () the event. */ scoped_disable_commit_resumed disable_commit_resumed ("handling event"); - if (!do_target_wait (&ecs, TARGET_WNOHANG)) + if (!do_target_wait (minus_one_ptid, &ecs, TARGET_WNOHANG)) { infrun_debug_printf ("do_target_wait returned no event"); disable_commit_resumed.reset_and_commit (); -- 2.25.4