From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QBEMLyEv/mPnuQAAWB0awg (envelope-from ) for ; Tue, 28 Feb 2023 11:43:13 -0500 Received: by simark.ca (Postfix, from userid 112) id BC42E1E222; Tue, 28 Feb 2023 11:43:13 -0500 (EST) 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=A8vjD0nS; 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 429551E128 for ; Tue, 28 Feb 2023 11:43:13 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E485F3857BB3 for ; Tue, 28 Feb 2023 16:43:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E485F3857BB3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677602592; bh=/gJ+DOvtdWVTE4jY7aTJ0i2eZBUvNvtYZg30Qse+R7Y=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=A8vjD0nSSPpFfBNrAyaBsYT1u9TVAMEktEhG3BnqIVTPDQEDy/F4N9DXApyTzRkfQ vHszYLelBGddX41hUOi4HBUoqo+s3BD9y1ecYa4IoJKamEVXLFKYzNIAXyVdtA+GQJ RzFZ3pMF46k+Zgn+KyUIZvoA5t99u/9W6TEStuvQ= 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 4879E3858C54 for ; Tue, 28 Feb 2023 16:42:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4879E3858C54 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-504-RQp9sICrP76VhYVIZw4QCA-1; Tue, 28 Feb 2023 11:42:31 -0500 X-MC-Unique: RQp9sICrP76VhYVIZw4QCA-1 Received: by mail-ed1-f72.google.com with SMTP id dk16-20020a0564021d9000b004aaa054d189so14930425edb.11 for ; Tue, 28 Feb 2023 08:42:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677602550; 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=/gJ+DOvtdWVTE4jY7aTJ0i2eZBUvNvtYZg30Qse+R7Y=; b=6Rrdp3vDkK4DPesArg2MUwah8LhkFj65EW+PNct4dJyL1CKW50rOAUdpCaDYwapymZ Omsm8PC27s28eEpMiAgPuWHX4VPEc6nJ8WoJRzH11Kbv/TC+aO01d2XEXGiLic7XrVYQ AHI3PAzDeUrjfaa7TOi0h7DEhQBau0ABSRfQZKkYc4Ng3K8+Dxq4EP5NegEL3/HthnRq I6thxCzzszNo2eQNzFrCMBNBWP+8Ro0IBz2qJwxDOjdK1pWgcsBFGATW3od/iP1X4NTQ 7xF/blxm+uiC1pl22f7oupRwuoxPHgiH5PASAFNK4KoJ1UfykBUFDd8d/PULyAv60Ud/ jNpA== X-Gm-Message-State: AO0yUKXPadAvzgcH2Yop4mY+5fbmamOLA/IYTesxZiDArnVWyAk8pERH ZI4LCQFqhulmiBp+o0s0HGak1RnksoSs1e/1Osrd/Cnr1LTnF0mXHsFmhj8uteMWoI23SuTFmHz rZ7lnTT95tvttWrNWM1c04yK7PWUAb7baqyrmosysoPtEGcElrtzewP4VL+xGh8KFz1wAgAyh3+ h0qM0= X-Received: by 2002:a05:6402:1488:b0:4ad:7055:ed09 with SMTP id e8-20020a056402148800b004ad7055ed09mr3936322edv.6.1677602550526; Tue, 28 Feb 2023 08:42:30 -0800 (PST) X-Google-Smtp-Source: AK7set+I/Q9RT0YMrkbWLyuu0HsuGDGng4anmiQg7YV97l595HNsf2TRjaR7VbjW0dBZBlG4o+FVug== X-Received: by 2002:a05:6402:1488:b0:4ad:7055:ed09 with SMTP id e8-20020a056402148800b004ad7055ed09mr3936306edv.6.1677602550332; Tue, 28 Feb 2023 08:42:30 -0800 (PST) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id s1-20020a1709060c0100b008dd2db45c0bsm4686026ejf.105.2023.02.28.08.42.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 08:42:29 -0800 (PST) To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv4 07/12] Revert "gdb: remove unnecessary parameter wait_ptid from do_target_wait" Date: Tue, 28 Feb 2023 16:42:12 +0000 Message-Id: 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-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" 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'. --- gdb/infrun.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index ab77300f1ff..aa1c9e94bda 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -3830,7 +3830,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; @@ -3840,9 +3841,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. */ @@ -3881,7 +3883,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); }; @@ -4311,7 +4313,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