This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: provide pass-through value in bfd_elf_bfd_from_remote_memory


Andrew Cagney <ac131313@redhat.com> writes:
> > The only effect of this patch at the moment is to make
> > bfd_elf_bfd_from_remote_memory a bit clumsier to use by the only code
> > that uses it.  That function is only expected to be used from GDB,
> > which actually does have a function called "target_read_memory", whose
> > type is exactly that expected by the old interface.  It does, in fact,
> > rely on global variables to decide what to read.
> > But I do think it's a better interface, and that eventually GDB's
> > target_read_memory function will change.  So I think it's a good idea
> > to get the interface right early.
> 
> Yes, but while you're there can the can you please also expunge that
> ehdr_vma parameter so that this uses a normal read() function that
> takes an offset.

In other words, make the target_read_memory function responsible for
adding in the base address of the ELF image in memory, so that the BFD
code deals strictly in offsets?  That does seem nicer.

> However, I think this really should be done right the first time (a
> proper way of supplying the read functions to a generic bfd).

Sure.  But for what it's worth, nothing in this interface precludes
doing that as a compatible improvement.

> PS: Please anything but baton, context for instance.

Well, I'm more than happy to follow any existing convention.  But
where are there other pointers named 'context'?  As far as I can see,
there is no convention for naming these little pass-through pointers.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]