From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id aI73L4SGYmS8HgsAWB0awg (envelope-from ) for ; Mon, 15 May 2023 15:22:44 -0400 Received: by simark.ca (Postfix, from userid 112) id B7B741E121; Mon, 15 May 2023 15:22:44 -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=YqcZfeQA; 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 E10C51E0D6 for ; Mon, 15 May 2023 15:22:43 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 702F03857001 for ; Mon, 15 May 2023 19:22:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 702F03857001 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684178563; bh=F3wfEdI3GFZJy6TVBxDTlD4hpyyIPk5HFZ0+rtSg8PE=; 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=YqcZfeQAde5NkeLs4QRvlWUtWwWVf6InvH8wucHA901kPmJaKZXrNWAvY5K4rs/lk 6Wn8WEXTO7MD0vfbOaIVEEs8Hgar840LTsS9rIFr7O/EgXHWWz+oY1VoRcQ8G7+Cs2 7/JBq7e7t3J6rzAvtrAvlLic7hE9TAGAMBAQ7Jh0= 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 B360E3858D33 for ; Mon, 15 May 2023 19:22:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B360E3858D33 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-441-zSHWU10EPiW89Lk9hY1jQw-1; Mon, 15 May 2023 15:22:20 -0400 X-MC-Unique: zSHWU10EPiW89Lk9hY1jQw-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-30643d4a430so4669854f8f.0 for ; Mon, 15 May 2023 12:22:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684178539; x=1686770539; 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=F3wfEdI3GFZJy6TVBxDTlD4hpyyIPk5HFZ0+rtSg8PE=; b=HGIMj/YvgsENX7Fp1uWZoGjWnuhSOxZxs2Um1SjIOOFK9obPi/BifWAkQW45GDdlxq 5jAvFB1br+JV1TndYwjGaDeuhYAzu5hC5g53BQCa/x/IxKSvODKUaM1bATlYNuVmiYPl ZBuTerSnnUG3081tpVxs8CxxqRmzR1C278Izhs+U5TLhPwTe8SI4ofbtIe53OmIbgXVd gdfWhGvAvg4vsJLUs/8WDykYqztxeUMPcttduJKa/Bbcy2OmqbUA0WrUpAExNwz480mw knDQokxkq4Qby4VQJkWFPjhh34WLowMqz/lsU2zFUFYJqgsSuKqhVqrIbc/reVDx5pyb evTw== X-Gm-Message-State: AC+VfDwCHDIhK+9+TSaaEegYR/wXqqWVj8nVRUa6cqavGOmhRga/u1SD pDGqpprCFroDY3he7YJ3uwH1ySo/gphq78/SLEauBMXJSC7IuGIhzRlcxFbEuTe4//PAGhZTEL6 cfYzjKnby68hO6LGUlZ2BGCXYlPqgg54bEdyItaPp9YT3ptfBp4gT55KXFYVAzXe+Kww3+NL50N E9rqqQBg== X-Received: by 2002:a5d:6a8b:0:b0:304:6762:2490 with SMTP id s11-20020a5d6a8b000000b0030467622490mr27633438wru.3.1684178539376; Mon, 15 May 2023 12:22:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5EaINbvXIqVz+6UglCDPx0Q6yl1mcSHTbQCv9GLksfppUxKflMC7ChhYz/W9+ZitHxXb1fQg== X-Received: by 2002:a5d:6a8b:0:b0:304:6762:2490 with SMTP id s11-20020a5d6a8b000000b0030467622490mr27633426wru.3.1684178538976; Mon, 15 May 2023 12:22:18 -0700 (PDT) Received: from localhost (11.72.115.87.dyn.plus.net. [87.115.72.11]) by smtp.gmail.com with ESMTPSA id b4-20020adfde04000000b0030632833e74sm107977wrm.11.2023.05.15.12.22.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 12:22:18 -0700 (PDT) To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv7 1/6] Revert "gdb: remove unnecessary parameter wait_ptid from do_target_wait" Date: Mon, 15 May 2023 20:22:08 +0100 Message-Id: <60689fdeeceadfe1824f99f47f88f4172838f45f.1684178293.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-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 efe2c00c489..07ef3c7c187 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -3869,7 +3869,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; @@ -3879,9 +3880,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. */ @@ -3920,7 +3922,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); }; @@ -4350,7 +4352,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