From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by sourceware.org (Postfix) with ESMTPS id 6B6C03858420 for ; Tue, 16 Jan 2024 19:13:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6B6C03858420 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6B6C03858420 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::22b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705432421; cv=none; b=ZbckyBsnZkvoMTalNoG77iD83KKT8OaIZPXljZioytjWRqWtVMSlcW/J9UUQFi7KJHgkqj5tLIrZ9F0pOksXL1MYtxmGW1V0xzJ6TVDADmahza/Hd+WkLd5R7JgPGF3K8fFsAy67DPBlBdA9/+qk4kgWZfF27nyZBK9fw4iF2e8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705432421; c=relaxed/simple; bh=nPt5GYsNqglI+pBq3IkZo68ojTLJj0XcIb7VIpQ0uGs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ZxxfKEoQ9F0fxXbidpEj8ctb6ORdT+u4xev6TBLu7n6mCO11G0Keqh9c9PB0xihwsuUxem0QzGZcW7dUdpzkEsOxiDk914Unce/wXbOuI/gpfRsE4u4nMOsPUNxovcvg+Ef055AZ3vxgccNqEEoA4TZ3IYULZ1fZie1UxasAeEQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2cddf596321so11312891fa.0 for ; Tue, 16 Jan 2024 11:13:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705432418; x=1706037218; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UYU9D4meJJMbhIoJtgV4Lx9R50K6TpKfhDMRretfFrE=; b=VyiDd2rG9lI7q2yA5npcRnon29FdT0y/CEc0oocDRVa1hHbOdqEhuHe6+SiW7QaE3g +e9AsW0wV72snqVQLU4EdTOPzdlCydaoyzxA7P2hEKWcDN95w2xu+YAkU6+wgCc/fP0R YsNnQQX1JWKmJvRPWVB+WQvyx00FEDoV0ckL6wu+9j4FvzA6S19Qit3DmNdScs/Rulty zJHb4djvJTc1Bf0Y58NV6XIHUaRXqlKxbCvzVw4F1XDMOiCJRFBirBpKc0OHL9z2oLpf 0YdTpjDXLGds+ttHgCy+VJ5AoDZ9yIHoPYgnOELW1rUfAQiKkSeIOILT8jrKzwNU7emr KS7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705432418; x=1706037218; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UYU9D4meJJMbhIoJtgV4Lx9R50K6TpKfhDMRretfFrE=; b=Mfeontv5oBY3PSqC6fOvEoFtbMuEfp2Qa9C8ljWoGKCyqVw1WEKIqRPqoxWhy/Zj5n yA2/eutagJdSWCDdNYUe/hg+EzTTjm3ppfFy1hZEpg2buGq7Rzyk8LdUIDdkhO2tF/Jp rkTtFarthRUu+A/1Okhv87EzartPB2y1RQbbPQhVDzRSqbIs/4Op6ancWwEH1/ZIqrUV h68vIAHCr2t3xkKDuXyuj71KQyAPE7H+hloz/w12TI5nQ4wo9RTHEN/CbGGFQSRz2n2U 1TNjvqsXmXY5KNP0DFazt9GU52TWmJWdfQzcuI+ba7svCADFhhyrAwzrLAWq7co3t1s6 zOKQ== X-Gm-Message-State: AOJu0YwCd1OEdZGARR/R1Gn76vLgPMFUzS/E8LnDWLRA1oskJxTMcGrM wSepwhRY2lveVyBvDTaAu+qiiCSTQQw= X-Google-Smtp-Source: AGHT+IF6QB41s/tPspUBTVBisByLTd/pCV8bYvigOG6JAa9DVU8g0ryk6DoF7cIHQ+jJleXUl5D8LA== X-Received: by 2002:a2e:b752:0:b0:2cc:f1ea:aa6b with SMTP id k18-20020a2eb752000000b002ccf1eaaa6bmr3422983ljo.78.1705432417634; Tue, 16 Jan 2024 11:13:37 -0800 (PST) Received: from localhost.localdomain ([2001:2044:7c:4b00:37f8:fc67:7f51:113d]) by smtp.gmail.com with ESMTPSA id u1-20020a2eb801000000b002cdc84fdef9sm630413ljo.89.2024.01.16.11.13.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 11:13:37 -0800 (PST) From: Simon Farre To: gdb-patches@sourceware.org Cc: Simon Farre Subject: [PATCH 5/5] [dap & linetable]: Added docs Date: Tue, 16 Jan 2024 20:13:05 +0100 Message-ID: <20240116191305.126345-5-simon.farre.cx@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240116191305.126345-1-simon.farre.cx@gmail.com> References: <20240116191305.126345-1-simon.farre.cx@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 List-Id: Added docs for the new `gdb.lookup_linetable` as well as the new accessor method `LineTableEntry.column`. --- gdb/doc/python.texi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index 71431878dd3..3206aef3b4f 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -6422,6 +6422,18 @@ mapping of source lines to their executable locations in memory. To acquire the line table information for a particular symbol table, use the @code{linetable} function (@pxref{Symbol Tables In Python}). +Python code can request a symtab's linetable by calling +@code{gdb.lookup_linetable} passing in the filename. The parameter +@var{filename} can be a substring of the symtab's @code{fullname}. +If multiple symtabs' fullnames share that substring, the first one +found is returned. + +@defun gdb.lookup_linetable (filename) +Return the @code{gdb.LineTable} of a symtab whose fullname matches +@var{filename}. If no symtab could be found using @var{filename} +as a substring this function returns @code{None}. +@end defun + A @code{gdb.LineTable} is iterable. The iterator returns @code{LineTableEntry} objects that correspond to the source line and address for each line table entry. @code{LineTableEntry} objects have @@ -6433,6 +6445,12 @@ corresponds to the actual line of source. This attribute is not writable. @end defvar +@defvar LineTableEntry.column +The source column number for this line table entry. This number +corresponds to the actual column of source. This attribute is not +writable. +@end defvar + @defvar LineTableEntry.pc The address that is associated with the line table entry where the executable code for that source line resides in memory. This -- 2.43.0