public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Michael Snyder <msnyder@vmware.com>
Cc: Hui Zhu <teawater@gmail.com>, Eli Zaretskii <eliz@gnu.org>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [RFA/DOC] record pic
Date: Wed, 01 Sep 2010 23:04:00 -0000	[thread overview]
Message-ID: <20100901225135.GJ2986@adacore.com> (raw)
In-Reply-To: <20100901182754.GC2986@adacore.com>

> Hui: With your permission, I wold like to take this patch over.

Here is, in short, what I have found out from reverse-engineering
the code.  That should allow me to write some half-decent documentation
for this feature.  However, before you read on, and before I do so,
I would like to recommend that this feature be actually backed out.
More about this in the appropriate thread.

-------------------------------------------------------------------------

This feature produces a graph description using the VCG syntax.
Graphs essentially have two elements: nodes and edges (the edges
connect one node to the next).

Notations: `[source name]' means optional source name
           `<source name>' means mandatory source name

There are 3 types of edges:

  - Edges that correspond to a function call (drawn in red)
  - Edges that correspond to a function return (drawn in blue)
  - All other edges (drawn in the default color, I assume black)

  In the VCG file, the edges are written as:
  edge: {[color:<red|blue>] sourcename: "<from>" target_name: "<to>"}

There are two kinds of nodes.  Only one kind gets used for a given
graph. Which kind is used is determined by the user setting "set record
pic type <line|function>".  Nodes have a `title', which is displayed in
the node contents by the viewers.

  - Nodes associated to functions
    [filename-if-available] <function linkage name|function addr>

  - Nodes associated to source lines either:
      (a) <filename>:<line> [function linkage name] <addr> 
    or:
      (b) [function linkage name] [line number] <addr>

    (a) is used in the case when the new instruction corresponds
        to a different frame from the previous instruction (either
        a function call or a return) AND when the new instruction
        has a symtab (debug info)

    (b) is used otherwise.

    The `function linkage name' is provided when known.
    WARNING: The code only checks the symbol table, and ignores
             debugging info. This is a problem on platforms where
             the linker eliminates static functions.

    The line number is provided if known (symtab). This is the case
    where we have debugging info, but it's still in the same frame.

Effect of the various user settings:

  - set record pic hide-nofunction <on|off>
    If set to on, then nodes associated to instructions for which
    we cannot find a function in the symbol table are not included
    in the graph.

  - set record pic hide-nosource <on|off>
    If on, filters out the nodes associated to instructions for which
    no debugging information is available (typically, code compiled
    without debugging information, or code that got stripped).

  - set record pic hide-sameaddr <on|off>
    If on, nodes corresponding to the same address get merged.
    For "function" graphs, the merging stops as soon as the associated
    function returns. For line graphs, the merging is always done.
    The number of nodes being merged is indicated at the end of the node
    title as c:<N> where <N> is the number of times this node was found.

    If off, nodes are not merged.  Instead of the cound, the intruction
    number, whetever that might be, is indicated at the end of the node
    title as i:<N> where <N> is that instruction number.

-- 
Joel

  reply	other threads:[~2010-09-01 23:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-01  7:12 Hui Zhu
2010-07-01 17:31 ` Eli Zaretskii
2010-07-02  6:29   ` Hui Zhu
2010-08-20  9:22     ` Eli Zaretskii
2010-08-23  8:26       ` Hui Zhu
2010-08-23 16:35         ` Eli Zaretskii
2010-08-24  3:19           ` Hui Zhu
2010-08-24 17:22             ` Eli Zaretskii
2010-08-25  2:28               ` Hui Zhu
2010-08-27 14:40                 ` Joel Brobecker
2010-08-27 15:50                   ` Eli Zaretskii
2010-08-27 15:58                     ` Joel Brobecker
2010-08-28  1:15                       ` Hui Zhu
2010-08-28  1:24                         ` Joel Brobecker
2010-09-01 18:21                           ` Michael Snyder
2010-09-01 18:28                             ` Joel Brobecker
2010-09-01 23:04                               ` Joel Brobecker [this message]
2010-09-02  1:21                                 ` Joel Brobecker

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=20100901225135.GJ2986@adacore.com \
    --to=brobecker@adacore.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@vmware.com \
    --cc=teawater@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).