From patchwork Mon Oct 30 15:08:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 78762 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 6ED4F3858C2F for ; Mon, 30 Oct 2023 15:09:12 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by sourceware.org (Postfix) with ESMTPS id 52F533858C5F for ; Mon, 30 Oct 2023 15:08:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 52F533858C5F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 52F533858C5F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::d31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698678539; cv=none; b=sc7ROLg7NTKYnAoYnZ8NpVbMggOJK+bsYIC/JMy3Yuax6mFt0Nh4xFNgi6jVfO7Dyw3W4+5XaFwmpE0gxKh+yI6uJn8w5DVKtEsGbjgsVy+aSWwtlQg5dJySsJr7lvu8uQGykDF8QYgNUWloGyMJVzzhqHuFyUjvWIX7wfgMi8Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698678539; c=relaxed/simple; bh=/xwygptjYe7sINUy7smxLltENZnlDwnyW2QWAaTVCLk=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=xvaengkx7a2dBnaKVa9OzhxcXUloQDQjEIAvW0QAKSAw5jmJewxkjWfxAEK8IpywFcX08oZmj1+8aQBDRwm8yqgNSbL7VItlF+22dTNWcgm14xCeYkmTAR7u8FzDUfulXVW9hXDcFgRCQfwoUyoI6KKq8tu1YplML1+Aw7JgOIw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-7a6acc8e222so162017439f.0 for ; Mon, 30 Oct 2023 08:08:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1698678537; x=1699283337; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=eqT/8WI79z07E5+4Q4ClQxPfoKGD5DVjfTyGfd70wVQ=; b=DUbBYaShwsnXsjLRqhcoQLlq3HiGfRh41mxFoneHolhw0I155U8FKmprPNnjx0zuah Pz1cnuHg1sTFEQmiH24XO59PGXuuqsTuOEtgeyD+SfywGXdWcwch1vLJxTcxg4kAjVgC 7q3cpZBQsfhgQEcXJmxcArQuHPL4t9afzXbp2bEFHPyInsvAdbcWH1fzOhMaeUxaL+uS i5hkMNyVY5+0+pmOx0Z7pupT5+wxgxmmgxfxZWUoxwT/YUTiu5jqs37/PZ6OKmLEo6oq 8HVrz0Oxp5ZLk4WzgIB0IZ3p4JAyHJ6ZmixzlQ9jqYBv+5zwXImXwQKYQgTHCbLzsvSX QIcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698678537; x=1699283337; 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=eqT/8WI79z07E5+4Q4ClQxPfoKGD5DVjfTyGfd70wVQ=; b=Y6MGNGG02j+em5GHOPfmgw5LM7h72Z+UsNk9GnW/jSL4uPpq+vv4S/BecRaSXOP1hz PDNpcOXRiRO4TlZDDlsOXIug5CyGCR4Q/N3gmVs2dSWywWFx8X48fzLoChow/YigwrIE wBiFepJKOzq5TmKkk5UmNuusGiLio5yE/v7QkIo6V615Aac8Cn3IvLT+tmMGcJar4+o4 QsLl7pc0Tc919CR8xugj/ctepMeGwn/6m758JKe6XKbdXI2P04WBwCJsqO7fLAzHmwRO Y2Mrrd6DVRG0l1ElKo2gfajt6rDrMOAjqNaOrKcPpDmBLqBObRnlTpPTTNF2O3uhHmXK 1DHg== X-Gm-Message-State: AOJu0YyVfs9+byBlik0xwMn231fiosoau43x90nalPtI70E/nZxouO4g 7T1jALIU1KIyrl6sLFzrEKwOKQqBTSPD9+YLKtrZ5Q== X-Google-Smtp-Source: AGHT+IEDsMAfqU4ej3aRwQjAZKb2f5aW8QCi0mvwhOVIzXLWvuCpdUIftwQ4uoNWJ/CFKgDC3pzXyw== X-Received: by 2002:a05:6602:154a:b0:79f:e707:8813 with SMTP id h10-20020a056602154a00b0079fe7078813mr15489472iow.4.1698678537509; Mon, 30 Oct 2023 08:08:57 -0700 (PDT) Received: from localhost.localdomain (97-122-77-73.hlrn.qwest.net. [97.122.77.73]) by smtp.gmail.com with ESMTPSA id y20-20020a02ce94000000b0045100cbfbedsm2222422jaq.61.2023.10.30.08.08.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 08:08:56 -0700 (PDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Reword gdb.Frame.read_var documentation Date: Mon, 30 Oct 2023 09:08:50 -0600 Message-Id: <20231030150850.2580129-1-tromey@adacore.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 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 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: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org I noticed that the docs for gdb.Frame.read_var are mildly incorrect. They don't really document how the 'block' argument is handled. This patch tries to correct the oversight. --- gdb/doc/python.texi | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index 8cc3f92cbfe..5eb4c1664b7 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -5719,12 +5719,16 @@ object. @end defun @defun Frame.read_var (variable @r{[}, block@r{]}) -Return the value of @var{variable} in this frame. If the optional -argument @var{block} is provided, search for the variable from that -block; otherwise start at the frame's current block (which is -determined by the frame's current program counter). The @var{variable} -argument must be a string or a @code{gdb.Symbol} object; @var{block} must be a -@code{gdb.Block} object. +Return the value of @var{variable} in this frame. @var{variable} must +be a string or a @code{gdb.Symbol} object. + +If @var{variable} is a string, then @var{block} may be provided. In +this case, search for the variable from that block; otherwise start at +the frame's current block (which is determined by the frame's current +program counter). + +If @var{variable} is a @code{gdb.Symbol} object, then @var{block} is +ignored. @end defun @defun Frame.select ()