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 D33C4385DC35 for ; Wed, 27 Sep 2023 10:26:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D33C4385DC35 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=1695810390; 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=myPy377fWxksHLXtT+n/TpPIVZouL24q0IauXh8J9Eg=; b=IZmRp9ov+CILakpJYx4100wSetRkwYIEJXZn6aIQHQb4QFkRkVgyPJb/lyMwRs9DOtGrge J+QpbC1TFxznyWkFer+Pe2vPEqfQKgPPUeVXupAEujRPGV3jWp+wpj2ml9uCxXQAYDyIH0 0GrFkSwUf1ZWAGmHzH3epudX+a8BIjA= 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-694-sWc8bcFeOZ2U5IQjx_SkLg-1; Wed, 27 Sep 2023 06:26:29 -0400 X-MC-Unique: sWc8bcFeOZ2U5IQjx_SkLg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 9321F85A5BA for ; Wed, 27 Sep 2023 10:26:28 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.224.75]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F36F6492B05; Wed, 27 Sep 2023 10:26:27 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: kevinb@redhat.com, Guinevere Larsen Subject: [PATCH v3 2/2] gdb/infrun: simplify process_event_stop_test Date: Wed, 27 Sep 2023 12:19:52 +0200 Message-ID: <20230927101950.1913970-5-blarsen@redhat.com> In-Reply-To: <20230927101950.1913970-3-blarsen@redhat.com> References: <20230927101950.1913970-3-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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 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 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. -- 2.41.0