Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* dwarf2read.c: passing objfile as parameter?
@ 2008-09-12  6:02 Doug Evans
  2008-09-12 15:56 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Doug Evans @ 2008-09-12  6:02 UTC (permalink / raw)
  To: gdb

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?


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: dwarf2read.c: passing objfile as parameter?
  2008-09-12  6:02 dwarf2read.c: passing objfile as parameter? Doug Evans
@ 2008-09-12 15:56 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2008-09-12 15:56 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-12 15:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-12  6:02 dwarf2read.c: passing objfile as parameter? Doug Evans
2008-09-12 15:56 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox