From patchwork Sun Sep 24 12:58:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 76616 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3E2283857728 for ; Sun, 24 Sep 2023 13:03:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3E2283857728 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1695560603; bh=myPy377fWxksHLXtT+n/TpPIVZouL24q0IauXh8J9Eg=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Uh/t3R8fLof9N8p1eiRDXVqxvw9b0x170g24WLgPA54ap9JK2GzJvSOlyMrxhlRzr k3LrqssovjbNSLxIv1mp9LIPf1laABeqnJ0zD5CoqfVpL19Ks6TXzkZOAGuJimu93z c2Tyi9xKaPgHClbeF/GGoUQGqbCC8uMFQJ2uoSfQ= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 9293238582AC for ; Sun, 24 Sep 2023 13:02:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9293238582AC Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-135-pj0Vb5FQM4qs8SQC4zLB9Q-1; Sun, 24 Sep 2023 09:02:33 -0400 X-MC-Unique: pj0Vb5FQM4qs8SQC4zLB9Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DAD7B801FA9 for ; Sun, 24 Sep 2023 13:02:32 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.42.28.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5EEF7140E950; Sun, 24 Sep 2023 13:02:32 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH v2 2/2] gdb/infrun: simplify process_event_stop_test Date: Sun, 24 Sep 2023 14:58:56 +0200 Message-ID: <20230924125855.983839-4-blarsen@redhat.com> In-Reply-To: <20230923103457.29768-2-blarsen@redhat.com> References: <20230923103457.29768-2-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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_H4, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Guinevere Larsen via Gdb-patches From: Guinevere Larsen Reply-To: Guinevere Larsen Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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 3491327422d..71e52e230d5 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -7014,9 +7014,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. */ } @@ -7189,7 +7187,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]", @@ -7619,8 +7617,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"); @@ -7668,10 +7665,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"); @@ -7701,8 +7696,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.