From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yLV8AAUcyGMLlhkAWB0awg (envelope-from ) for ; Wed, 18 Jan 2023 11:19:17 -0500 Received: by simark.ca (Postfix, from userid 112) id F2D541E128; Wed, 18 Jan 2023 11:19:16 -0500 (EST) 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=tAb1L1FS; 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 AC4A21E110 for ; Wed, 18 Jan 2023 11:19:16 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 521833858417 for ; Wed, 18 Jan 2023 16:19:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 521833858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674058754; bh=rZkOoTaoZ/26sQ5YZxxEHdir7t2ATXyzcN36nTQz838=; 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=tAb1L1FSy+j0CW2Njfotkr5POPp/Qj/tuZworxfzgzhD1mnL3AWsLC3pXMEoYIdSj Ju70/KCQfNIRUT3uZyArNo+HOF3/AWXfrHpyn1vGRZrGmfUp0dCpt/hUlK5+96Uc1P RLBIMYxyg44WojYAOHBcvg61CQyhF5b+8kOtTHsU= 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 96357385841E for ; Wed, 18 Jan 2023 16:18:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 96357385841E Received: from mail-yb1-f198.google.com (mail-yb1-f198.google.com [209.85.219.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-164-Epa5yIY7OzuyafZvpzMxHw-1; Wed, 18 Jan 2023 11:18:32 -0500 X-MC-Unique: Epa5yIY7OzuyafZvpzMxHw-1 Received: by mail-yb1-f198.google.com with SMTP id i135-20020a25d18d000000b007e64108adb4so8983779ybg.0 for ; Wed, 18 Jan 2023 08:18:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=rZkOoTaoZ/26sQ5YZxxEHdir7t2ATXyzcN36nTQz838=; b=Y3bELX0vCUmKVUa+d8PrZ9kQKgPATkUtb5vtfXvB0vdKbDOmGXTyVGoSGRzs+oW3Dr CSKjsf4h+pl+TSYi2IcWbGj5ii7KXnvz7ZBeHoJQ7Py4FwPfLnCdUAmXNtwoHSAIujCr ptXbougezh0A5oDFWsdoGjd11XgqEF6k6JzEwF0PmeS0//AprrEOw09jsrOjrH/BruEE Ds7oAheyahW3IOHrIIm9MDZ1K52DMrbXfRxd/0awgOcQYKQEVWw09Ugm2TjvGRoPJTa4 NDEfG7nFWkUbHsiZNPj90qqLkKhGrD4O8K+OUwK8SLivoQ9QT4gG6NKgpM6O0Y8SgnAQ SyNw== X-Gm-Message-State: AFqh2kqkh1V7K9fsGG+hAg0BNvlectRbjGhaKH3PM7j7u9gSISeL/ZcN sjFApYZXfJ4emkNZVt2lPxueqwi9KeWuewuaHcetz+1WhT2n8xZt4i9V05mvlV/M+XuYVk1HVLd yVuC4H+zmKH2D4RBCW7LifMErfSDwGyVNSJMfqrazdb2YZti/8C1OCj+7lfyykf3PS4fMzBPkvw == X-Received: by 2002:a05:7508:630a:b0:4a:823a:3271 with SMTP id cl10-20020a057508630a00b0004a823a3271mr498124gbb.10.1674058711365; Wed, 18 Jan 2023 08:18:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXsw8hkZSD4hRrHbAkkwlbG/t6XvUgOQpo3AKquXsB/x6jlIeNBGmzn1e8IQIkPtrp8c+w2lZw== X-Received: by 2002:a05:7508:630a:b0:4a:823a:3271 with SMTP id cl10-20020a057508630a00b0004a823a3271mr498108gbb.10.1674058710922; Wed, 18 Jan 2023 08:18:30 -0800 (PST) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id bk14-20020a05620a1a0e00b006ce580c2663sm22612663qkb.35.2023.01.18.08.18.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 08:18:30 -0800 (PST) To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv2 08/13] Revert "gdb: remove unnecessary parameter wait_ptid from do_target_wait" Date: Wed, 18 Jan 2023 16:18:04 +0000 Message-Id: <60af9af218f6b6753fec0a9bca8c78b91d54f41e.1674058360.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. --- gdb/infrun.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index edfb5ab0a91..5af8635a1ab 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -3741,7 +3741,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; @@ -3751,9 +3752,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 () != NULL + && ptid_t (inf->pid).matches (wait_ptid)); }; /* First see how many matching inferiors we have. */ @@ -3792,7 +3794,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); }; @@ -4169,7 +4171,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