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.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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686132086; 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=mm+/XWRQ+DsnGO4nNmVLBFhfnxnpv17BL9oqvmNRQ7s=; b=BhCGtcmqoNRN/8ugLu9aLE2CGGRVEE+XNIQbct6yO4qyVgl26dce12+esvFxxSOTxfUs62 MSahn9BqPKaoqOjM5LagqPhHQzHC5LnqedT0eJ4j8piSvgbaya819VmhxV83/27qk3C/EM g66/ieVqdcwYAR83Z+MDy8J8a3Aqupo= 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) From: Andrew Burgess 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-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,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 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