This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: target_xfer_memory()
- To: jtc at redback dot com
- Subject: Re: target_xfer_memory()
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Tue, 04 Apr 2000 14:59:26 +1000
- CC: gdb at sourceware dot cygnus dot com
- Organization: Cygnus Solutions
- References: <5mu2i1uo7p.fsf@jtc.redbacknetworks.com>
"J.T. Conklin" wrote:
>
> I'm changing target_xfer_memory() to support memory region attributes.
> While poking around, I came up with a few of questions:
>
> * target_xfer_memory takes a bfd_section argument, which it assigns to
> the global variable target_memory_bfd_section. The only place it is
> used is within a #if 0'd section of code. There is a comment above
> its definition in target.c:
>
> /* This variable is used to pass section information down to
> targets. This *should* be done by adding an argument to
> the target_xfer_memory function of all the targets, but I
> didn't feel like changing 50+ files. */
>
> Does anyone know the history and/or future of this? I'm going to
> add a memory attribute pointer to the target_xfer_function of all
> the targets anyway, so it would not be difficult to add a section
> pointer at the same time. On the other hand, if it's one of GDBs
> dead ends, I can remove it (and target_xfert_memory's section
> pointer argument) as well.
Stu Grossman added the comment and the code back at 04-Jan-97. Look for:
Fri Jan 3 12:08:16 1997 Stu Grossman (grossman@critters.cygnus.com)
at the end of ChangeLog-97.
It was then commented out by Michael Snyder on 03-Apr-97 when he added
support for overlays. Look for:
Thu Apr 3 15:10:30 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
Given, no one has since said boo (3 years now!) about the removal of
that code, I'd agree with any suggestion to delete it.
> * how much does using current_target.to_xfer_memory win over going
> through the target stack? When I added the code to break up a
> transfer into region-sized chunks, handling the special case for
> current_target became a bit more complicated.
I'm lost here. You mean:
/* The quick case is that the top target does it all. */
res = current_target.to_xfer_memory
(memaddr, myaddr, len, write, ¤t_target);
if (res == len)
? I don't know.
Andrew