From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yp5BC5ZVgGTFYiAAWB0awg (envelope-from ) for ; Wed, 07 Jun 2023 06:01:58 -0400 Received: by simark.ca (Postfix, from userid 112) id 196811E11E; Wed, 7 Jun 2023 06:01:58 -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=tCdRATc9; 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 BBF451E111 for ; Wed, 7 Jun 2023 06:01:57 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 091C2385735D for ; Wed, 7 Jun 2023 10:01:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 091C2385735D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1686132117; bh=mm+/XWRQ+DsnGO4nNmVLBFhfnxnpv17BL9oqvmNRQ7s=; 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=tCdRATc9eDtEoGoWRY69vUvWb9a4CaRww7TA0E0S6hmwsYALoNPqswr/ACErRH1lQ niJ/v34CZsb3RHPcSyrAXcJYnisKXDIsHJ5v0oCZ8f8jTidqj16OQwPQhFjDwxPK/e lEL1Uv6mDoUGqRDFn7D8jKQ4NK27J0j0Mt5HAAJs= 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 1882E385842C for ; Wed, 7 Jun 2023 10:01:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1882E385842C Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-178-EuHabKshNs64qLSp4pJthQ-1; Wed, 07 Jun 2023 06:01:25 -0400 X-MC-Unique: EuHabKshNs64qLSp4pJthQ-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3f7f4a7b289so392165e9.2 for ; Wed, 07 Jun 2023 03:01:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686132084; x=1688724084; 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=mm+/XWRQ+DsnGO4nNmVLBFhfnxnpv17BL9oqvmNRQ7s=; b=LzPfQYiotSG59NdOc4Twxv1j33mBI9+DLbR1KQAYSnHVGgVBblC5WIpMMrYvnBDJHB tGYhp43RBhGoZ4MRr70U0kL2tSKjfPnq9zIVQbeOUJnVvQ0KCPwtqumR1Vyri9ApLgQ5 Ik7/w0oTCjn9B6gOE1UwXY/8vPuu1TqY6hEnAY3nvQe1HL4+jrWzwBqsKOw995tmp0Rp fs+tujOQfOhgW8wUNz0Dss4gKUwH9LaHYcScCd/i44dgjrEOJBIofhYOBRxsIuEq1hx7 SAyg9JiuXH6SPmCNEH7Sjhby9MGuGBVuJMxeIFsyTFda4nM4btd7oRHUHEGGFthmtER5 J98A== X-Gm-Message-State: AC+VfDyHzy4yyZQMvUeWIzVASBi1TzBB3njU0ddkNLtj5FPJuQBs4knC gMggpzouRHNpDXYEFRkHU+qNs1vWzMdqhWnqaLmESWkYFSkujJw6YSPdGnVkTgdn9OpYG69utvO Q0u1bbIvku0Pp5PnZIHn0xbqMJdDG1dOYogOgcd446LRt3h7h+DJf86VUum5IeWpa7vX3B0TTok IlyTq/+Q== X-Received: by 2002:a1c:7215:0:b0:3f5:d0b8:4a53 with SMTP id n21-20020a1c7215000000b003f5d0b84a53mr4779947wmc.34.1686132084346; Wed, 07 Jun 2023 03:01:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7d0OA62foZud7gtjLJFjp3yCBnmLqpg9vxYI8gPtWWO3fx7tUJpjjmnADG+2OkgSSuXdpPPw== X-Received: by 2002:a1c:7215:0:b0:3f5:d0b8:4a53 with SMTP id n21-20020a1c7215000000b003f5d0b84a53mr4779932wmc.34.1686132084052; Wed, 07 Jun 2023 03:01:24 -0700 (PDT) Received: from localhost (11.72.115.87.dyn.plus.net. [87.115.72.11]) by smtp.gmail.com with ESMTPSA id k11-20020a5d428b000000b0030aded83385sm15119245wrq.27.2023.06.07.03.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 03:01:23 -0700 (PDT) To: gdb-patches@sourceware.org Cc: Andrew Burgess , Tankut Baris Aktemur Subject: [PATCHv8 1/6] Revert "gdb: remove unnecessary parameter wait_ptid from do_target_wait" Date: Wed, 7 Jun 2023 11:01:13 +0100 Message-Id: <487f03fdc1ff646e069e50a839c03b622d270a49.1686131880.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'. 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 58da1cef29e..db8b918986c 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -3881,7 +3881,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; @@ -3891,9 +3892,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. */ @@ -3932,7 +3934,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); }; @@ -4362,7 +4364,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