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.129.124]) by sourceware.org (Postfix) with ESMTPS id B360E3858D33 for ; Mon, 15 May 2023 19:22:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B360E3858D33 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=1684178542; 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=F3wfEdI3GFZJy6TVBxDTlD4hpyyIPk5HFZ0+rtSg8PE=; b=Czyo8NfShVShc5YTrnQTU5mfipCHNB1Sqd/OkzG1X3WaJYxp2NFD5VCC/r4eZufPZ/PFkB yZswz/V43P9d3bkNVzXrdXuJxgUeFmV+PbEZOA/sCBEDIlciy/+lwmC3sZ58lCR2maiy89 VLZBMevr8QMt3anotT4i5GWC7hTsYoQ= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-441-zSHWU10EPiW89Lk9hY1jQw-1; Mon, 15 May 2023 15:22:20 -0400 X-MC-Unique: zSHWU10EPiW89Lk9hY1jQw-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-30643d4a430so4669854f8f.0 for ; Mon, 15 May 2023 12:22:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684178539; x=1686770539; 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=F3wfEdI3GFZJy6TVBxDTlD4hpyyIPk5HFZ0+rtSg8PE=; b=HGIMj/YvgsENX7Fp1uWZoGjWnuhSOxZxs2Um1SjIOOFK9obPi/BifWAkQW45GDdlxq 5jAvFB1br+JV1TndYwjGaDeuhYAzu5hC5g53BQCa/x/IxKSvODKUaM1bATlYNuVmiYPl ZBuTerSnnUG3081tpVxs8CxxqRmzR1C278Izhs+U5TLhPwTe8SI4ofbtIe53OmIbgXVd gdfWhGvAvg4vsJLUs/8WDykYqztxeUMPcttduJKa/Bbcy2OmqbUA0WrUpAExNwz480mw knDQokxkq4Qby4VQJkWFPjhh34WLowMqz/lsU2zFUFYJqgsSuKqhVqrIbc/reVDx5pyb evTw== X-Gm-Message-State: AC+VfDwCHDIhK+9+TSaaEegYR/wXqqWVj8nVRUa6cqavGOmhRga/u1SD pDGqpprCFroDY3he7YJ3uwH1ySo/gphq78/SLEauBMXJSC7IuGIhzRlcxFbEuTe4//PAGhZTEL6 cfYzjKnby68hO6LGUlZ2BGCXYlPqgg54bEdyItaPp9YT3ptfBp4gT55KXFYVAzXe+Kww3+NL50N E9rqqQBg== X-Received: by 2002:a5d:6a8b:0:b0:304:6762:2490 with SMTP id s11-20020a5d6a8b000000b0030467622490mr27633438wru.3.1684178539376; Mon, 15 May 2023 12:22:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5EaINbvXIqVz+6UglCDPx0Q6yl1mcSHTbQCv9GLksfppUxKflMC7ChhYz/W9+ZitHxXb1fQg== X-Received: by 2002:a5d:6a8b:0:b0:304:6762:2490 with SMTP id s11-20020a5d6a8b000000b0030467622490mr27633426wru.3.1684178538976; Mon, 15 May 2023 12:22:18 -0700 (PDT) Received: from localhost (11.72.115.87.dyn.plus.net. [87.115.72.11]) by smtp.gmail.com with ESMTPSA id b4-20020adfde04000000b0030632833e74sm107977wrm.11.2023.05.15.12.22.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 12:22:18 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv7 1/6] Revert "gdb: remove unnecessary parameter wait_ptid from do_target_wait" Date: Mon, 15 May 2023 20:22:08 +0100 Message-Id: <60689fdeeceadfe1824f99f47f88f4172838f45f.1684178293.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.6 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'. --- gdb/infrun.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index efe2c00c489..07ef3c7c187 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -3869,7 +3869,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; @@ -3879,9 +3880,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. */ @@ -3920,7 +3922,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); }; @@ -4350,7 +4352,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