Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Sanjoy Das <sanjoy@playingwithpointers.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 3/4] Adds documentation.
Date: Sun, 24 Jul 2011 17:51:00 -0000	[thread overview]
Message-ID: <83zkk3egjr.fsf@gnu.org> (raw)
In-Reply-To: <1311523427-20501-4-git-send-email-sanjoy@playingwithpointers.com>

> From: Sanjoy Das <sanjoy@playingwithpointers.com>
> Cc: Sanjoy Das <sanjoy@playingwithpointers.com>
> Date: Sun, 24 Jul 2011 21:33:46 +0530
> 
> Adds some basic documentation to gdb.texinfo about the new JIT reader functionality. This should be a good entry point for developers writing parsers for the debug info their JIT compiler generates.

Thanks.

> gdb/ChangeLog
> 	* gdb.texinfo: Some documentation about the new JIT debug info reader functionality.

This should state the name(s) of the new node(s), in the same format
as gdb/ChangeLog documents functions, as if each node were a function.

> +@node Custom Object File Format

You cannot add a node without also adding it to the menu in its parent
(which happens to be "JIT Interface" in this case).  I guess you
didn't actually say "make info", because I don't think it would have
worked for you.

> +@section Custom Object File Format

As a general rule, each @section should have a @cindex entry whose
text is identical to the section name, but with all lower-case
letters.

> +Generating debug information in native file formats (like ELF or COFF) can become an overkill for JIT compilers; especially if all the debug info is used for displaying a meaningful backtrace. The issue can be resolved by having the JIT writers decide on a debug info format and provide a third-party reader that parses the debug info generated by the JIT compiler. This section gives an overview on writing such a parser. More details can be found in the file @code{gdb/jit-reader.h.in}.

First, please don't make such long lines, they make reading harder.

Second, please leave 2 spaces after a period that ends a sentence.

And third, "gdb/jit-reader.h.in" is a file, so it should have the
@file markup, not @code.

> +The reader is implemented as a shared object. GDB, when trying to read the debug information generated by a JIT compiler, looks for such shared objects in a special, pre-configured, directory. If such a (conforming) shared object is found, it is dynamically loaded and used to parse the debug info.

Please use "@value{GDBN}" instead of a literal "GDB".  That allows to
change the name in only one place, if someone wants to produce a
manual for a customized GDB that has a different name.

> +@node Writing A Parser
> +@subsection Writing A Parser

There should be a @menu in the previous node before you can use a
@subsection here.

Please add an index entry here, something like

  @cindex JIT parser
  @cindex writing JIT parsers

> +The parser needs to include @code{jit-reader.h}, which defines the required structures, macros and functions.
                               ^^^^^
@file

> +@node Elements Of @code{jit-reader.h}

A @node cannot use @-commands.  So just "Elements of jit-reader.h"

Also, this node has to appear in a menu, see above.

> +@subsubsection Elements Of @code{jit-reader.h}
                              ^^^^^
@file

> +After the plugin is loaded, GDB looks for the function @code{gdb_init_reader}. The prototype of the function (also included in @code{jit-reader.h}) is:
                                                  ^^^^^
@file

> +@node The API

Should be in a menu.

> +The plugin provides an API for creating symbol files (which GDB will use to, for instance, display function names in the backtrace) and implementing a frame unwinder.
                                                               ^^^
@value{GDBN}

> +@strong{Symbol Reading}

If this is supposed to be a heading, please use @heading.

> +The @code{read} function in @code{struct gdb_reader_funcs} is called to read in the debug info emitted by the JIT compiler and create the appropriate symbol tables. To keep the API clean and stable, GDB's internal structures are not exposed. Instead, a @code{struct} full of function pointers are passed to @code{read} which it is supposed to use to construct the symbol table.

Again, @value{GDBN}.


  reply	other threads:[~2011-07-24 17:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-24 16:00 JIT debug info parser Sanjoy Das
2011-07-24 16:00 ` [PATCH 3/4] Adds documentation Sanjoy Das
2011-07-24 17:51   ` Eli Zaretskii [this message]
2011-07-24 16:00 ` [PATCH 1/4] Adds a new header file, jit-reader.h.in Sanjoy Das
2011-07-28 16:39   ` Tom Tromey
2011-07-24 17:26 ` [PATCH 2/4] Populates jit-reader.h.in Sanjoy Das
2011-07-28 16:40   ` Tom Tromey
2011-07-24 17:41 ` [PATCH 4/4] Adds platform agnostic dynamic loading code Sanjoy Das
2011-07-28 17:33   ` Tom Tromey

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=83zkk3egjr.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=sanjoy@playingwithpointers.com \
    /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