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 7BD863858419 for ; Tue, 7 Nov 2023 12:47:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7BD863858419 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7BD863858419 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699361232; cv=none; b=Rn+Neulq2DxzDwD/veJIF5c/hYTSGkIAZiGXLiK2cVYnnGW6bn12hTg8BJfXSSR1zJ7MI62uzfPRinydHX40t1xt5/BDjNAHtFGPKedU60wqTXpP47VMM8LIpjDllfQt9RoN3rTF0pIWTBCSqECdc1bnVKzJ1J8Sg0Ww8L5dEGI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699361232; c=relaxed/simple; bh=c78FoeOsowbYmAI2vd0VXhp9bh1q5fHiIJNFlSn3Uy4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=XKelL/QTw5vUvV2J9jXWNz7rZcbxRn56YdNNbW3EzqEyF82o1wyFe+hXxyL8qUU0iApAJUdlpa6mAHwPBpMpcPyt+ocITUubEFXYMpoHXiZteMJc/gjeMgYF6qAC5ru3OnOBmH075mNXTWqRV8M1nWXZa7p/7xHKDL3fZo6TSIE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699361231; 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=wltPaoytJoGVXLoCEzW5GPbOMlaPO7WKUXtjVsIjU+8=; b=WKwO6CHsgIX/ZPLASAmSlUXMNzSGmTmyiZmC4Q/oPm5VTbBKGqxV4qUlFV/0ySLQidJ74g 2u0chAv7t51xzu/Vpdqc2GAW7IMr3/tiWA9BkDqWUAGGe27gzEAU7CbwK2JLQBX8OwcEpV C86aKKPTGeu43GZXckNR8emSwQ3qEb8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-302-xocRKJcuMHeNYfUG5wHUrg-1; Tue, 07 Nov 2023 07:47:10 -0500 X-MC-Unique: xocRKJcuMHeNYfUG5wHUrg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id CDF04837221 for ; Tue, 7 Nov 2023 12:47:09 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.224.103]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 567C42026D37; Tue, 7 Nov 2023 12:47:09 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: [PATCH v4 2/2] gdb/infrun: simplify process_event_stop_test Date: Tue, 7 Nov 2023 13:41:51 +0100 Message-ID: <20231107124150.116140-4-blarsen@redhat.com> In-Reply-To: <20231107124150.116140-2-blarsen@redhat.com> References: <20231107124150.116140-2-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 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.5 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_H3,RCVD_IN_MSPIKE_WL,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: The previous commit introduced some local variables to make some if statements simpler. This commit uses them more liberally throughout the process_event_stop_test in order to simplify the function a little more. No functional changes are expected. --- gdb/infrun.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index 9571acef1fa..2f4c8632336 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -7016,9 +7016,7 @@ process_event_stop_test (struct execution_control_state *ecs) if (init_frame) { - struct frame_id current_id - = get_frame_id (get_current_frame ()); - if (current_id == ecs->event_thread->initiating_frame) + if (curr_frame_id == ecs->event_thread->initiating_frame) { /* Case 2. Fall through. */ } @@ -7191,7 +7189,7 @@ process_event_stop_test (struct execution_control_state *ecs) if (pc_in_thread_step_range (ecs->event_thread->stop_pc (), ecs->event_thread) && (execution_direction != EXEC_REVERSE - || get_frame_id (frame) == ecs->event_thread->control.step_frame_id)) + || curr_frame_id == original_frame_id)) { infrun_debug_printf ("stepping inside range [%s-%s]", @@ -7621,8 +7619,7 @@ process_event_stop_test (struct execution_control_state *ecs) frame machinery detected some skipped call sites, we have entered a new inline function. */ - if ((get_frame_id (get_current_frame ()) - == ecs->event_thread->control.step_frame_id) + if ((curr_frame_id == original_frame_id) && inline_skipped_frames (ecs->event_thread)) { infrun_debug_printf ("stepped into inlined function"); @@ -7670,10 +7667,8 @@ process_event_stop_test (struct execution_control_state *ecs) through a more inlined call beyond its call site. */ if (get_frame_type (get_current_frame ()) == INLINE_FRAME - && (get_frame_id (get_current_frame ()) - != ecs->event_thread->control.step_frame_id) - && stepped_in_from (get_current_frame (), - ecs->event_thread->control.step_frame_id)) + && (curr_frame_id != original_frame_id) + && stepped_in_from (get_current_frame (), original_frame_id)) { infrun_debug_printf ("stepping through inlined function"); @@ -7703,8 +7698,7 @@ process_event_stop_test (struct execution_control_state *ecs) end_stepping_range (ecs); return; } - else if (get_frame_id (get_current_frame ()) - == ecs->event_thread->control.step_frame_id) + else if (curr_frame_id == original_frame_id) { /* We are not at the start of a statement, and we have not changed frame. -- 2.41.0