Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA 3/3] Windows-specific iterate_over_objfiles_in_search_order
Date: Mon, 04 Jun 2012 04:55:00 -0000	[thread overview]
Message-ID: <CADPb22RwVgu3F_Wrp4bG-B=fBPBfm-arwF+EYKx7YfV8ZMMvzA@mail.gmail.com> (raw)
In-Reply-To: <1338496603-5423-4-git-send-email-brobecker@adacore.com>

On Thu, May 31, 2012 at 1:36 PM, Joel Brobecker <brobecker@adacore.com> wrote:
> This patch sets the windows target to use their own version of
> the iterate_over_objfiles_in_search_order gdbarch method, in
> order to make global symbol searches sensitive to the current
> objfile.
>
> gdb/ChangeLog:
>
>        * windows-tdep.h (windows_iterate_over_objfiles_in_search_order):
>        Add declaration.
>        * windows-tdep.c: #include "objfiles.h".
>        (windows_iterate_over_objfiles_in_search_order): New function.
>        * amd64-windows-tdep.c (amd64_windows_init_abi): Set
>        iterate_over_objfiles_in_search_order gdbarch method to
>        windows_iterate_over_objfiles_in_search_order.
>        * i386-cygwin-tdep.c (i386_cygwin_init_abi): Likewise.
>[...]
>+/* Implement the "iterate_over_objfiles_in_search_order" gdbarch
>+   method.  It searches all objfiles, starting with CURRENT_OBJFILE
>+   first (if not NULL).
>+
>+   On Windows, the system behaves a little differently when two
>+   objfiles each define a global symbol using the same name, compared
>+   to other platforms such as GNU/Linux for instance.  On GNU/Linux,
>+   all instances of the symbol effectively get merged into a single
>+   one, but on Windows, they remain distinct.
>+
>+   As a result, it usually makes sense to start global symbol searches
>+   with the current objfile before expanding it to all other objfiles.
>+   This helps for instance when a user debugs some code in a DLL that
>+   refers to a global variable defined inside that DLL.  When trying
>+   to print the value of that global variable, it would be unhelpful
>+   to print the value of another global variable defined with the same
>+   name, but in a different DLL.  */


GDB's notion of a global symbol isn't a perfect match for ELF's notion.
I'm wondering if there are examples where we'd want this for ELF too.
[And are there examples where we don't want this for ELF?]


  parent reply	other threads:[~2012-06-04  4:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-31 20:37 [RFA 0/3] Make global symbol objfile search order arch-dependent Joel Brobecker
2012-05-31 20:37 ` [RFA 3/3] Windows-specific iterate_over_objfiles_in_search_order Joel Brobecker
2012-06-02 13:57   ` Jan Kratochvil
2012-06-02 15:32     ` Joel Brobecker
2012-06-02 15:49       ` Jan Kratochvil
2012-06-04  4:55   ` Doug Evans [this message]
2012-06-04 13:02     ` Joel Brobecker
2012-05-31 20:37 ` [RFA 2/3] New "iterate_over_objfiles_in_search_order" gdbarch method Joel Brobecker
2012-05-31 20:37 ` [RFA/commit 1/3] Revert "Search global symbols from the expression's block objfile first." Joel Brobecker
2012-06-01 18:06 ` [RFA 0/3] Make global symbol objfile search order arch-dependent Pedro Alves

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='CADPb22RwVgu3F_Wrp4bG-B=fBPBfm-arwF+EYKx7YfV8ZMMvzA@mail.gmail.com' \
    --to=dje@google.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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