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 BC5143858C5E for ; Mon, 3 Apr 2023 14:01:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BC5143858C5E 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=1680530486; 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=fnN5R767v0roLalh+PURnycrMWqykvwjAO4A6t3Melk=; b=ffkyzWRyEB/CoVum3puo3yX59CsrJMFidUHVMytRiomVvnVJ3MSUAKiBBF+6Fz5Rmy1pyL uM8DQ887szvObPbUV2cFJ7EtyeBITRQSolJFTXKDvJLMp5e+jv7U/Pv8RP3eximYqWKLry K8SAcxaRpzEt0xNsFP9gMdR1QGWw9qk= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-64-Nc0L-YUcPJa3tfprVcF6XQ-1; Mon, 03 Apr 2023 10:01:25 -0400 X-MC-Unique: Nc0L-YUcPJa3tfprVcF6XQ-1 Received: by mail-qv1-f70.google.com with SMTP id l18-20020ad44bd2000000b005a9cf5f609eso13085967qvw.15 for ; Mon, 03 Apr 2023 07:01:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680530484; 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=fnN5R767v0roLalh+PURnycrMWqykvwjAO4A6t3Melk=; b=tB9PqEtb66Mtm3vJL8U13qivaHeXPbhr8AmPeDpwdVIN7actpreQRGCXsFq6V27Yd3 ZHUGxFsieGqBk58sD9CqkanvNouLkEX2uJmr8Qhy9ct75Mg+4JrXGCTvV9IwHwdHoP9n YDrjex0sNVAamf/D6t0VEtmB2J7vE6qSxaEJ6JG7mMZn6MGwCo7jdCvdNnHr5Qegc8Zl kGBT3I6NzjnsJiSGXZw7z3wRL2U7hnxoPuJV6lYCRu/B/KDp97qrdGOQwWBmgYrmYUzS EXMGxAnpiehzupxEaqNJ77gMpwRl7B7TVG4TreETRXPplbB1RL+hBvE1lURnyrusMVro A/XQ== X-Gm-Message-State: AO0yUKU5A4XKW/A7solgC6fEt1V8V5dQEeKDr3UKoO/c3I8Xw4905gn3 39A8Hy+S7agEARSDqdaIic5MWi25mtdbe4CTytR/hH5kRSVtHEPVR1tO7oE7j1Es6Xl2KIb28T7 +Rgd84jSfRCcAbUcCfDYOQnxQDmBMWZGTgDMORpV7pG+G4sl9rQVIC4/scJ7QwDx0EwcvJT/gZ8 bqrZk5zQ== X-Received: by 2002:ac8:58c6:0:b0:3e3:803b:e5c9 with SMTP id u6-20020ac858c6000000b003e3803be5c9mr63663945qta.0.1680530483904; Mon, 03 Apr 2023 07:01:23 -0700 (PDT) X-Google-Smtp-Source: AKy350Ywmsx1wrwkPJhCdvyMjMOS7ne0IrhD1uKUuoKjL04fzgz/D23qnY3p25xeiYtJPbHEPGSMeA== X-Received: by 2002:ac8:58c6:0:b0:3e3:803b:e5c9 with SMTP id u6-20020ac858c6000000b003e3803be5c9mr63663903qta.0.1680530483514; Mon, 03 Apr 2023 07:01:23 -0700 (PDT) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id o26-20020ac841da000000b003de4e646d63sm2553360qtm.32.2023.04.03.07.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 07:01:23 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv6 1/6] Revert "gdb: remove unnecessary parameter wait_ptid from do_target_wait" Date: Mon, 3 Apr 2023 15:01:13 +0100 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-Spam-Status: No, score=-11.7 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,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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'. --- gdb/infrun.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index 8a8439f6da5..b7047ae4c69 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -3863,7 +3863,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; @@ -3873,9 +3874,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. */ @@ -3914,7 +3916,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); }; @@ -4344,7 +4346,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