From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id MFnIF5zcKmSDLCIAWB0awg (envelope-from ) for ; Mon, 03 Apr 2023 10:03:08 -0400 Received: by simark.ca (Postfix, from userid 112) id 5F1DC1E15D; Mon, 3 Apr 2023 10:03:08 -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=EDOLr5ur; 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=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.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 192001E0D3 for ; Mon, 3 Apr 2023 10:03:08 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DFB2C3853D0C for ; Mon, 3 Apr 2023 14:03:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DFB2C3853D0C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680530586; bh=fnN5R767v0roLalh+PURnycrMWqykvwjAO4A6t3Melk=; 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=EDOLr5urIJNWBWdOK39qFul2F2F4CvOIM8pqjw44Fy8I2VOLgFny6+oorB6JbbezN BlxI1WJzcnawOVAjI95s7K3IUTU/Jb+8Y49ZxfWhzgzuAPnxEiprp35IB1ipqcaKQs df8vZkXodjor/vj0M9hqQQldjUUoFiYItGBIytew= 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 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) 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-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 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