From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id BBZXMp410mmHawgAWB0awg (envelope-from ) for ; Sun, 05 Apr 2026 06:12:46 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=J65s4h+D; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B18501E0B1; Sun, 05 Apr 2026 06:12:46 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 91E921E0B1 for ; Sun, 05 Apr 2026 06:12:45 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 3E8524BA23DA for ; Sun, 5 Apr 2026 10:12:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3E8524BA23DA Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=J65s4h+D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id E2DBB4BA2E14 for ; Sun, 5 Apr 2026 10:12:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E2DBB4BA2E14 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine 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 E2DBB4BA2E14 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775383935; cv=none; b=YriTvBMh+PjDFQTweLtIjn9Hppj/08AWm7sXAC07Hoq0pyMQqi/5q+PICYFTENCYj6K4Q0zvGps4Tcs5KBzzFN4ED4TUjaMuY7UUh1o6h4plmSJcHexDawTJIRMqwM3m4SKDOlaFdRHxLfJ3F3WlxTejKoKHmmuFtrVnAPiJxKs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775383935; c=relaxed/simple; bh=nG7hlpkf6SXvhJFm6IacaDpx/uMTb8duTQB8YEy8PlI=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=AlEokTrpgV19xvP/s+UZ8XGlhVcKhIqndss9qb26MjwTQkTieskiT7airGqvihXMMyGBOtQyXfna/DoGFGQOlKp5eyNEd9r0ykZY6nfoW+mrhG62LN40x2hsY+OIiTtKjh1jBfdIa7wQA/t6pFUmrCpEhqfOdkIfyHPY2WQjqEY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E2DBB4BA2E14 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1775383934; 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=SkjWuN+9ICKIO+KRZVFyxUg0X9KZVBC3684liqExNfk=; b=J65s4h+DrWq6dw684SEgrgWkOh1fGtMqWD0PhXj4ioiZ3EaYjyO2TlMp3bYew0gFaSEAPH CjGLv1dNcRd03v5KGfZkrkpChYDSlYyZcY2gX+LvfFiQ1BrDuxAgtl0/T4h2kV/7PmFJN6 D+C3qpahJkJ7KPRa/qirxlXohswbnkg= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-269-TvsbeCk-Nhev8FcPlU3y6A-1; Sun, 05 Apr 2026 06:12:13 -0400 X-MC-Unique: TvsbeCk-Nhev8FcPlU3y6A-1 X-Mimecast-MFC-AGG-ID: TvsbeCk-Nhev8FcPlU3y6A_1775383932 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-43cff5ef652so2074415f8f.2 for ; Sun, 05 Apr 2026 03:12:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775383932; x=1775988732; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=SkjWuN+9ICKIO+KRZVFyxUg0X9KZVBC3684liqExNfk=; b=N1fUCObKyvvRxFT/k74Fgkr3vTlcAkm8pMdWzIAZzFlbNhE8mmNmhWdk6FelOL3Pul tONEFUrgTFY6OMF+r6suicLglBUEgfUregiM6LXtSGgILtk+uJxy+J/l7g800NxzW/Le eKngDBZXUYZcaJmm6B1j1IrztZeKjtPuNba4paQGhTN5qV86w6O3sJj9awkedRuwMcd0 zF9S19waQcoXeuQSwHbog2L8xS9A2qwptZ1Eo88OQ2VyvwaRx4rXRP/eKVK9Qv5Zem5T BsSEawbwaghi4eTprOUumUPn4L4xui9i9zLDI8vJ7Y9ZfUnvVf39m5ONKj7+IPfzQ57q szyQ== X-Gm-Message-State: AOJu0YyfiTaplrfcpDb+otJkW6zucNgwVR7IKDLrdOkQDtTmWQAD7eY8 VN3UKTWwGfBS6/vj5xpZ+2qkMYecQhq19AKuZqGUZW8DoD8NtlTT729/y+gJvh4BhBzoIZUMuC/ XzPOVrUHh5a/+XKWl8hMAx4Ta/SMe52Si7hjW415APENcwsCGCEVEz3Qnl8Hive6klVnvTRAcHh hOL4PPpymSSCXMPyQwmS5aBg+KMRD4e2irbfkqkb69Lf1spoo= X-Gm-Gg: AeBDiesxYSp1FhOfPFgSfo600zBkya/zgUF2klBs+6ibE4BD7z0bSykjLOT3YmtHFdi rC1Vy9LsqyeA91WANsfkMA62onw3R2BSgtYZQVBao0bks/rt9GdWONjGh+jxI5eK+1w5Y/gPchv trVDT3dXHJ+c34V20rtRmeCxfy4GNF7kY7UP0XU37w4RStX/MBzo/P9wBPEbmTIrM9HEGlcppaB 82O3hzvJTXkYGFkbpYXvDN802w4jwAeMt9sKZo7lO1gqfYb1dUB6ax+gh1xtXW62L5hRs16j/UV BOKgLmBoZngrUQnxbzEcRQUMZf8v62PuyIN6JryfBhRN+zBsFf4bWMzh3MEIE7QOF5OU1Z/2vQ9 4yyUF4fpu7J8Qq/qp X-Received: by 2002:a05:600c:8b75:b0:486:f634:ef1 with SMTP id 5b1f17b1804b1-4889978c516mr140566115e9.17.1775383931969; Sun, 05 Apr 2026 03:12:11 -0700 (PDT) X-Received: by 2002:a05:600c:8b75:b0:486:f634:ef1 with SMTP id 5b1f17b1804b1-4889978c516mr140565755e9.17.1775383931482; Sun, 05 Apr 2026 03:12:11 -0700 (PDT) Received: from localhost ([31.111.84.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48897b93d86sm66048975e9.0.2026.04.05.03.12.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Apr 2026 03:12:11 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess , Tom de Vries Subject: [PATCH 1/2] gdb: use get_current_frame consistently in print_stop_location Date: Sun, 5 Apr 2026 11:12:06 +0100 Message-Id: <640943dbfd2e2d6555be950b04a4c50288e3334a.1775383137.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: <20260331132342.1050954-1-tdevries@suse.de> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 6aqZn7n-enb2aYC6uF-iEdGEaaYriYBzt5K_AwhCPSM_1775383932 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org In print_stop_location, in the PRINT_UNKNOWN case we currently use a strange mix of get_current_frame and get_selected_frame. This works fine because at the point print_stop_location is called the selected frame will always be the current frame, but calling these two different functions is confusing, at least for me. As we are stopping, and deciding whether to print information about the frame, it makes sense, I think, to make the choice based on the current frame, and so let's call get_current_frame once, and then use that result throughout the decision making process. There should be no user visible changes after this commit. --- gdb/infrun.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index 6ca2a505299..aa1c3553131 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -9362,13 +9362,13 @@ print_stop_location (const target_waitstatus &ws) /* FIXME: cagney/2002-12-01: Given that a frame ID does (or should) carry around the function and does (or should) use that when doing a frame comparison. */ - if (tp->control.stop_step - && (tp->control.step_frame_id - == get_frame_id (get_current_frame ())) + if (frame_info_ptr frame = get_current_frame (); + tp->control.stop_step + && (tp->control.step_frame_id == get_frame_id (frame)) && (tp->control.step_start_function == find_symbol_for_pc (tp->stop_pc ()))) { - symtab_and_line sal = find_frame_sal (get_selected_frame (nullptr)); + symtab_and_line sal = find_frame_sal (frame); if (sal.symtab != tp->current_symtab) { /* Finished step in same frame but into different file, print -- 2.25.4