This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: dwarf2read.c: passing objfile as parameter?
- From: Daniel Jacobowitz <drow at false dot org>
- To: Doug Evans <dje at google dot com>
- Cc: gdb at sourceware dot org
- Date: Fri, 12 Sep 2008 11:56:07 -0400
- Subject: Re: dwarf2read.c: passing objfile as parameter?
- References: <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