From patchwork Fri May 19 15:41:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 69691 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 10B7D3858415 for ; Fri, 19 May 2023 15:42:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10B7D3858415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684510931; bh=PQqrypBB7Rdzorq+vnepfbLYnClue2PXA0pWc4TigMQ=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=aL9zNNtZY5U3N37Mdr+evgM26jEk0KxbNPDid1uxkCrKHotASrScyjymOrlzOw3nM iMjvYRmNn2u92RBM66PZ9+v4F+Ne6BMPiBLn0vebIfhcfeX67J9t7+c/eTg4sJ8FOl TVrDNZY0Qol3wCvx30GuzcT6XgC5ItzB95CABh/0= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by sourceware.org (Postfix) with ESMTPS id F3B263858C41 for ; Fri, 19 May 2023 15:41:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F3B263858C41 Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-76c5749b10fso90059539f.2 for ; Fri, 19 May 2023 08:41:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684510907; x=1687102907; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PQqrypBB7Rdzorq+vnepfbLYnClue2PXA0pWc4TigMQ=; b=HP+M/fQTLcb/AWkv3UhgyaAO/c4WlCw+xvUFsDOGJgEMAMFjYQC5EatN+0Eieh0T2L Dr7pW/NccuAHyQNkYYGx0zDcYxtUz1sWyw3UKnsO55yh5MBX5lXW0LesMg+PtZxgI89M 3XFaUwTfx+yoFfVprTCpTlmaDL38IPeXPl5OhzLvni7eEolgnj3NHOZy1qbys5sd/Y8T L87X3Xtmlwd/LeU2XNbLO0p/xH5n885THOw//7t+hVvTnpsodGZnckj8Ct9LxsD+BB81 qGc6IgM77kBT9n7hpUduqCiENIldcPIpCneKEEmx4m2ZtS0s/5jKA41CGq4HyNiSv+5H BslQ== X-Gm-Message-State: AC+VfDzvLI4JyXFUInyr9GqIAexmHX4VE9lyRExq/Scfr7zXvxsSnq5c J/TiKo1as1CQjIX74dAfV9fgGZPxTk3W9NvdoET4Mg== X-Google-Smtp-Source: ACHHUZ50GWeIIjOHzq+sKN6GaX6ISwg8T54Q2aCN+Ep2Y1tHTdhcmeBarDR232Zp0h4fQCbBBNQaeg== X-Received: by 2002:a92:d58e:0:b0:338:3543:728c with SMTP id a14-20020a92d58e000000b003383543728cmr1527239iln.7.1684510907261; Fri, 19 May 2023 08:41:47 -0700 (PDT) Received: from localhost.localdomain (75-166-157-55.hlrn.qwest.net. [75.166.157.55]) by smtp.gmail.com with ESMTPSA id k4-20020a056638140400b0040fa45dbec2sm1219830jad.99.2023.05.19.08.41.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 08:41:46 -0700 (PDT) To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Update documentatio for Python Frame.older and Frame.newer Date: Fri, 19 May 2023 09:41:37 -0600 Message-Id: <20230519154137.3303282-1-tromey@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom Tromey via Gdb-patches From: Tom Tromey Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" I noticed that Frame.older and Frame.newer don't document that they return None at the ends of the stack. This patch updates the documentation, and also fixes a somewhat related typo in a comment that I noticed while digging into this. --- gdb/doc/python.texi | 6 ++++-- gdb/frame.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index d93ee55690e..4066dafb601 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -5367,11 +5367,13 @@ Return the symbol for the function corresponding to this frame. @end defun @defun Frame.older () -Return the frame that called this frame. +Return the frame that called this frame. If this is the oldest frame, +@code{None} is returned. @end defun @defun Frame.newer () -Return the frame called by this frame. +Return the frame called by this frame. If this is the newest frame, +@code{None} is returned. @end defun @defun Frame.find_sal () diff --git a/gdb/frame.c b/gdb/frame.c index c8b8d2e257e..57d53410cc0 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -2601,7 +2601,7 @@ inside_entry_func (frame_info_ptr this_frame) } /* Return a structure containing various interesting information about - the frame that called THIS_FRAME. Returns NULL if there is entier + the frame that called THIS_FRAME. Returns NULL if there is either no such frame or the frame fails any of a set of target-independent condition that should terminate the frame chain (e.g., as unwinding past main()).