Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Matt Rice <ratmice@gmail.com>
To: Siva Chandra <sivachandra@google.com>
Cc: Doug Evans <dje@google.com>, Tom Tromey <tromey@redhat.com>,
		Phil Muldoon <pmuldoon@redhat.com>, Eli Zaretskii <eliz@gnu.org>,
	gdb-patches@sourceware.org
Subject: Re: [RFC - Python scripting] New methods Symtab.global_block and Symtab.static_block (docs included)
Date: Fri, 20 Apr 2012 12:12:00 -0000	[thread overview]
Message-ID: <CACTLOFrp7Hg0ZG8h=NVkyjD-_400Zv=Zdrf2Lq_OW-ga=qiTbw@mail.gmail.com> (raw)
In-Reply-To: <CAGyQ6gzK7FvC0EYvJD+DGnCRssbNREoSjdROfpbv0u22sBNOKQ@mail.gmail.com>

On Thu, Apr 19, 2012 at 9:57 PM, Siva Chandra <sivachandra@google.com> wrote:

>  Similarly, if my
> understanding is correct, static functions and static variables
> defined in a source file should always be present in a static block.
> Hence, we again document saying that the user rely only on this
> information being constant.  Does this sound reasonable?

I personally don't know a lot about this area, but I do recall seeing
some comments which hint at the unreliability in this.

I can't find the specific comment I went looking for,
which I recall as saying that sometimes it is a 'best guess'.  could
be a figment of my imagination

the following from (possibly outdated) symtab.c stuff is what i did
find, i believe there is other uncommented occurrences, anyhow given
the fudge and lack of errors I wouldn't be suprised to weirdness here
go unnoticed.



      int other_kind = kind == GLOBAL_BLOCK ? STATIC_BLOCK : GLOBAL_BLOCK;

      /* This shouldn't be necessary, but as a last resort
       * try looking in the 'other kind' even though the psymtab
       * claimed the symbol was one thing.  It's possible that
       * the psymtab gets it wrong in some cases.
       */
      block = BLOCKVECTOR_BLOCK (bv, other_kind);
      sym = lookup_block_symbol (block, name, STRUCT_DOMAIN);

....

      /* This shouldn't be necessary, but as a last resort try
         looking in the statics even though the psymtab claimed
         the symbol was global, or vice-versa.  It's possible
         that the psymtab gets it wrong in some cases.  */

      /* FIXME: carlton/2002-09-30: Should we really do that?
         If that happens, isn't it likely to be a GDB error, in
         which case we should fix the GDB error rather than
         silently dealing with it here?  So I'd vote for
         removing the check for the symbol in the other
         block.  */
      block = BLOCKVECTOR_BLOCK (bv,
                                 kind == GLOBAL_BLOCK ?
                                 STATIC_BLOCK : GLOBAL_BLOCK);


  reply	other threads:[~2012-04-20 11:44 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-17  8:39 Siva Chandra
2012-04-17 13:00 ` Phil Muldoon
2012-04-17 17:34   ` Siva Chandra
2012-04-17 17:44     ` Tom Tromey
2012-04-17 17:41   ` Tom Tromey
2012-04-17 17:05 ` Eli Zaretskii
     [not found]   ` <CAGyQ6gxxEeYeCKw_iHXh74Gg223GHxMoW=gvt9kU+ax396kKBQ@mail.gmail.com>
2012-04-18  9:15     ` Siva Chandra
2012-04-18 20:45       ` Phil Muldoon
2012-04-18 20:48         ` Tom Tromey
2012-04-19 17:33           ` Siva Chandra
2012-04-19 19:18             ` Doug Evans
2012-04-20  6:48               ` Siva Chandra
2012-04-20 12:12                 ` Matt Rice [this message]
2012-04-20 14:16                   ` Doug Evans
2012-04-20 15:21                   ` Matt Rice
2012-04-20 19:12                   ` Tom Tromey
2012-04-20 19:53                     ` Doug Evans
2012-04-20 19:57                       ` Siva Chandra
2012-04-23 13:21                         ` Tom Tromey
2012-04-23 13:35                           ` Phil Muldoon
2012-04-23 14:11                             ` Eli Zaretskii
2012-04-23 14:45                               ` Phil Muldoon
2012-04-23 16:00                                 ` Eli Zaretskii
2012-04-24 11:15                                   ` Siva Chandra
2012-04-24 17:40                                     ` Eli Zaretskii
2012-04-25  7:11                                   ` Tom Tromey
2012-04-25  8:19                                     ` Siva Chandra
2012-04-26 12:35                                     ` Siva Chandra
2012-04-26 15:21                                       ` Doug Evans
2012-05-02 17:41                                         ` Siva Chandra
2012-05-02 18:15                                           ` Doug Evans
2012-05-03  7:13                                             ` Siva Chandra
2012-05-04 18:05                                               ` FAILing new testcase for -fdebug-types-section [Re: [RFC - Python scripting] New methods Symtab.global_block and Symtab.static_block (docs included)] Jan Kratochvil
2012-05-05  7:01                                                 ` Siva Chandra
2012-05-05  7:05                                                   ` Jan Kratochvil
2012-05-05  7:11                                                     ` Siva Chandra
2012-05-05  7:13                                                       ` Jan Kratochvil
2012-05-23 21:38                                                         ` [patch KFAIL] Re: FAILing new testcase for -fdebug-types-section (PR symtab/14148) Jan Kratochvil
2012-04-18 20:48       ` [RFC - Python scripting] New methods Symtab.global_block and Symtab.static_block (docs included) Tom Tromey
2012-04-20  8:13       ` Eli Zaretskii
2012-04-17 17:37 ` Tom Tromey
2012-04-18 18:41   ` Tom Tromey
2012-04-18 19:53     ` Siva Chandra
2012-04-18 20:49       ` 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='CACTLOFrp7Hg0ZG8h=NVkyjD-_400Zv=Zdrf2Lq_OW-ga=qiTbw@mail.gmail.com' \
    --to=ratmice@gmail.com \
    --cc=dje@google.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=pmuldoon@redhat.com \
    --cc=sivachandra@google.com \
    --cc=tromey@redhat.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