From: Eli Zaretskii <eliz@gnu.org>
To: Tom de Vries <tdevries@suse.de>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH][gdb/python] Add interface to access minimal_symbols
Date: Fri, 05 Oct 2018 06:46:00 -0000 [thread overview]
Message-ID: <834le03n8u.fsf@gnu.org> (raw)
In-Reply-To: <20181004211115.GA31056@delia> (message from Tom de Vries on Thu, 4 Oct 2018 23:11:17 +0200)
> Date: Thu, 4 Oct 2018 23:11:17 +0200
> From: Tom de Vries <tdevries@suse.de>
>
> [ Submitted earlier here (
> https://sourceware.org/ml/gdb-patches/2016-02/msg00124.html ). ]
>
> This patch adds a new gdb.MinSymbol object to export the minimal_symbol
> interface.
Thanks.
> Build and reg-tested on x86_64-linux.
>
> OK for trunk?
I have a couple of comments for the documentation part.
I think this warrants a NEWS entry.
> +@value{GDBN} represents every variable, function and type as an
> +entry in a symbol table. @xref{Symbols, ,Examining the Symbol Table}.
> +Typical symbols like functions, variables, etc are represented by
> +gdb.Symbol objects in Python. Some symbols are defined with less
"gdb.Symbol" should be in @code.
> +@findex gdb.lookup_minimal_symbol
> +@defun gdb.lookup_minimal_symbol (name @r{[}, sfile@r{]}, objfile@r{[})
There's no need to use @findex for methods you introduce with @defun,
since the latter automatically creates an @findex entry.
> +This function searches for a minimal symbol by name.
> +The search scope can be restricted by the sfile and objfile arguments.
^^^^^ ^^^^^^^
Argument names in text should have the @var markup, like you did below:
> +The optional @var{sfile} argument restricts the search to the source file
> +in which the minimal symbol was defined.
> +The @var{sfile} argument must be a string. The optional @var{objfile}
> +restricts the search to the objfile that contains the minimal symbol.
> +@defvar MinSymbol.print_name
> +The name of the symbol in a form suitable for output. This is either
> +@code{name} or @code{linkage_name}, depending on whether the user
> +asked @value{GDBN} to display demangled or mangled names.
When you refer to other GDB features, it is generally a good idea to
have a hyperlink there. In this case, I believe you refer to the
command "set print demangle", described in "Print Settings", so please
use @pxref or @xref to add a cross-reference there.
> +@defvar MinSymbol.filename
> +The file name of the source file where the minimal symbol is defined. This
> +value may represent filenames used internally by the compiler rather
> +than a viewable/editable source file.
The last sentence sounds a bit mysterious to me: what are "filenames
used internally by the compiler"? Maybe an example will clarify that.
> +@defvar MinSymbol.section
> +The name of the binary section containing this minimal symbol.
I would suggest to use "section in the object file"; "binary" might be
misinterpreted to mean that the section itself is binary.
> +@vindex MINSYMBOL_TYPE_SLOT_GOT_PLT
> +@item gdb.MINSYMBOL_TYPE_SLOT_GOT_PLT
> +This type represents GOT for .plt sections.
I don't believe we have "GOT" mentioned anywhere else in the manual,
so (1) please use @acronym{GOT}, and (2) please tell in the text what
this acronym stands for.
> +@vindex MINSYMBOL_TYPE_FILE_DATA
> +@item gdb.MINSYMBOL_TYPE_FILE_DATA
> +This type represents the static version of gdb.MINSYMBOL_TYPE_DATA.
> +
> +@vindex MINSYMBOL_TYPE_FILE_BSS
> +@item gdb.MINSYMBOL_TYPE_FILE_BSS
> +This type represents the static version of gdb.MINSYMBOL_TYPE_BSS.
> +@end vtable
The 2 "gdb.*" symbols above should be in @code.
The documentation part is approved with the above gotchas fixed.
next prev parent reply other threads:[~2018-10-05 6:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-04 21:11 Tom de Vries
2018-10-05 4:43 ` Simon Marchi
2018-10-31 16:59 ` Tom de Vries
2018-11-26 11:17 ` [PING][PATCH][gdb/python] " Tom de Vries
2018-11-26 21:31 ` [PATCH][gdb/python] " Simon Marchi
2018-11-27 18:10 ` Matt Rice
2018-11-29 22:32 ` Tom Tromey
2018-11-29 22:12 ` Tom Tromey
2018-10-05 6:46 ` Eli Zaretskii [this message]
2018-10-31 17:02 ` Tom de Vries
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=834le03n8u.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=tdevries@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox