Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Doug Evans <dje@google.com>
Cc: gdb@sourceware.org
Subject: Re: dwarf2read.c: passing objfile as parameter?
Date: Fri, 12 Sep 2008 15:56:00 -0000	[thread overview]
Message-ID: <20080912155607.GA15222@caradoc.them.org> (raw)
In-Reply-To: <20080912060152.F10F01C789F@localhost>

On Thu, Sep 11, 2008 at 11:01:52PM -0700, Doug Evans wrote:
> While passing parameters in globals Is Bad (tm), is there any reason
> to keep passing objfile around instead of storing it in
> dwarf2_per_objfile?
> 
> E.g. dwarf2_find_containing_comp_unit takes objfile as a parameter:
> 
> static struct dwarf2_per_cu_data *
> dwarf2_find_containing_comp_unit (unsigned long offset,
> 				  struct objfile *objfile)
> 
> but it also references dwarf2_per_objfile:
> 
>   high = dwarf2_per_objfile->n_comp_units - 1;
> 
> Is there a reason why objfile isn't recorded in dwarf2_per_objfile?

The only one I can think of is that in some cases cross-objfile DWARF
references are possible; but GDB doesn't support that, GCC doesn't
either, and it doesn't seem very likely.

-- 
Daniel Jacobowitz
CodeSourcery


      reply	other threads:[~2008-09-12 15:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-12  6:02 Doug Evans
2008-09-12 15:56 ` Daniel Jacobowitz [this message]

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=20080912155607.GA15222@caradoc.them.org \
    --to=drow@false.org \
    --cc=dje@google.com \
    --cc=gdb@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