aboutsummaryrefslogtreecommitdiff
path: root/gdb/exec.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-11-03 14:44:08 +0000
committerAndrew Cagney <cagney@redhat.com>2003-11-03 14:44:08 +0000
commit8530209598630c25438f6c2cd323482b1a1ec886 (patch)
tree9bb710670d8d7f6b0e9e8ede71da25e463afaaa3 /gdb/exec.c
parent794cd17b2840c7b3b1d994f46d04845b91ea8104 (diff)
downloadgdb-8530209598630c25438f6c2cd323482b1a1ec886.zip
gdb-8530209598630c25438f6c2cd323482b1a1ec886.tar.gz
gdb-8530209598630c25438f6c2cd323482b1a1ec886.tar.bz2
2003-11-03 Andrew Cagney <cagney@redhat.com>
* section.c (bfd_set_section_contents): Make the "location" buffer constant. * bfd-in2.h: Re-generate. Index: gdb/ChangeLog 2003-11-03 Andrew Cagney <cagney@redhat.com> * exec.c (xfer_memory): Eliminate xfer_fn.
Diffstat (limited to 'gdb/exec.c')
-rw-r--r--gdb/exec.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/gdb/exec.c b/gdb/exec.c
index 8ca669e..a8ae0c0 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -457,7 +457,6 @@ xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
int res;
struct section_table *p;
CORE_ADDR nextsectaddr, memend;
- int (*xfer_fn) (bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
asection *section = NULL;
if (len <= 0)
@@ -471,7 +470,6 @@ xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
}
memend = memaddr + len;
- xfer_fn = write ? bfd_set_section_contents : bfd_get_section_contents;
nextsectaddr = memend;
for (p = target->to_sections; p < target->to_sections_end; p++)
@@ -484,8 +482,14 @@ xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
if (memend <= p->endaddr)
{
/* Entire transfer is within this section. */
- res = xfer_fn (p->bfd, p->the_bfd_section, myaddr,
- memaddr - p->addr, len);
+ if (write)
+ res = bfd_set_section_contents (p->bfd, p->the_bfd_section,
+ myaddr, memaddr - p->addr,
+ len);
+ else
+ res = bfd_get_section_contents (p->bfd, p->the_bfd_section,
+ myaddr, memaddr - p->addr,
+ len);
return (res != 0) ? len : 0;
}
else if (memaddr >= p->endaddr)
@@ -497,8 +501,14 @@ xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
{
/* This section overlaps the transfer. Just do half. */
len = p->endaddr - memaddr;
- res = xfer_fn (p->bfd, p->the_bfd_section, myaddr,
- memaddr - p->addr, len);
+ if (write)
+ res = bfd_set_section_contents (p->bfd, p->the_bfd_section,
+ myaddr, memaddr - p->addr,
+ len);
+ else
+ res = bfd_get_section_contents (p->bfd, p->the_bfd_section,
+ myaddr, memaddr - p->addr,
+ len);
return (res != 0) ? len : 0;
}
}