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 96357385841E for ; Wed, 18 Jan 2023 16:18:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 96357385841E 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=1674058714; 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=rZkOoTaoZ/26sQ5YZxxEHdir7t2ATXyzcN36nTQz838=; b=axFmAth8EBaunxnce2wiz+NdMK13e8ZYBoiy0EMnuFkP5DQIP8MRAzsVOSEjCWQBLNHFjP j8/z5BTXcoGDUDhrHmsVSCxcSLjfITtwO8q3chjlLKDz5GTF+WSbUhwMEU2xowRn4t5mcb S8nlOZGI7ZjQjO9q37QID7CYEX5V/ew= 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) From: Andrew Burgess 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-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,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. --- 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