* target.h (target_memory_bfd_section): Removed declaration.

* target.c (target_memory_bfd_section): Removed.
* exec.c (xfer_memory): Removed #if'ed-out code which referenced
target_memory_bfd_section.

* target.h (target_read_memory_section): Removed declaration.
* target.c (target_read_memory_section): Removed.
(target_xfer_memory): Update, removed bfd_section argument.
(target_read_string, target_read_memory, target_write_memory):
Update for above change.

* gdbcore.h (read_memory_section): Removed declaration.
* corefile.c (read_memory_section): Removed.
* jv-lang.c (get_java_utf8_name): Changed calls to
read_memory_section to read_memory.
* printcmd.c (printf_command): Likewise.
* valops.c (value_at, value_fetch_lazy): Likewise.
This commit is contained in:
J.T. Conklin 2000-05-20 10:29:51 +00:00
parent b8166459e1
commit d4b2399a9c
9 changed files with 32 additions and 97 deletions

View File

@ -1,3 +1,23 @@
2000-05-20 J.T. Conklin <jtc@redback.com>
* target.h (target_memory_bfd_section): Removed declaration.
* target.c (target_memory_bfd_section): Removed.
* exec.c (xfer_memory): Removed #if'ed-out code which referenced
target_memory_bfd_section.
* target.h (target_read_memory_section): Removed declaration.
* target.c (target_read_memory_section): Removed.
(target_xfer_memory): Update, removed bfd_section argument.
(target_read_string, target_read_memory, target_write_memory):
Update for above change.
* gdbcore.h (read_memory_section): Removed declaration.
* corefile.c (read_memory_section): Removed.
* jv-lang.c (get_java_utf8_name): Changed calls to
read_memory_section to read_memory.
* printcmd.c (printf_command): Likewise.
* valops.c (value_at, value_fetch_lazy): Likewise.
2000-05-18 J.T. Conklin <jtc@redback.com>
* configure.host, configure.tgt (powerpc-*-netbsd*): New entry.

View File

@ -270,21 +270,7 @@ read_memory (memaddr, myaddr, len)
memory_error (status, memaddr);
}
void
read_memory_section (memaddr, myaddr, len, bfd_section)
CORE_ADDR memaddr;
char *myaddr;
int len;
asection *bfd_section;
{
int status;
status = target_read_memory_section (memaddr, myaddr, len, bfd_section);
if (status != 0)
memory_error (status, memaddr);
}
/* Like target_read_memory, but slightly different parameters. */
int
dis_asm_read_memory (memaddr, myaddr, len, info)
bfd_vma memaddr;

View File

@ -490,49 +490,6 @@ xfer_memory (memaddr, myaddr, len, write, target)
xfer_fn = write ? bfd_set_section_contents : bfd_get_section_contents;
nextsectaddr = memend;
#if 0 /* Stu's implementation */
/* If a section has been specified, try to use it. Note that we cannot use the
specified section directly. This is because it usually comes from the
symbol file, which may be different from the exec or core file. Instead, we
have to lookup the specified section by name in the bfd associated with
to_sections. */
if (target_memory_bfd_section)
{
asection *s;
bfd *abfd;
asection *target_section;
bfd *target_bfd;
s = target_memory_bfd_section;
abfd = s->owner;
target_bfd = target->to_sections->bfd;
target_section = bfd_get_section_by_name (target_bfd, bfd_section_name (abfd, s));
if (target_section)
{
bfd_vma sec_addr;
bfd_size_type sec_size;
sec_addr = bfd_section_vma (target_bfd, target_section);
sec_size = target_section->_raw_size;
/* Make sure the requested memory starts inside the section. */
if (memaddr >= sec_addr
&& memaddr < sec_addr + sec_size)
{
/* Cut back length in case request overflows the end of the section. */
len = min (len, sec_addr + sec_size - memaddr);
res = xfer_fn (target_bfd, target_section, myaddr, memaddr - sec_addr, len);
return res ? len : 0;
}
}
}
#endif /* 0, Stu's implementation */
for (p = target->to_sections; p < target->to_sections_end; p++)
{
if (overlay_debugging && section && p->the_bfd_section &&

View File

@ -51,9 +51,6 @@ extern void memory_error PARAMS ((int status, CORE_ADDR memaddr));
extern void read_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len));
extern void read_memory_section PARAMS ((CORE_ADDR memaddr, char *myaddr,
int len, asection * bfd_section));
/* Read an integer from debugged memory, given address and number of
bytes. */

View File

@ -224,7 +224,7 @@ get_java_utf8_name (obstack, name)
+ TYPE_LENGTH (VALUE_TYPE (temp));
chrs = obstack_alloc (obstack, name_length + 1);
chrs[name_length] = '\0';
read_memory_section (data_addr, chrs, name_length, NULL);
read_memory (data_addr, chrs, name_length);
return chrs;
}

View File

@ -2319,15 +2319,14 @@ printf_command (arg, from_tty)
{
char c;
QUIT;
read_memory_section (tem + j, &c, 1,
VALUE_BFD_SECTION (val_args[i]));
read_memory (tem + j, &c, 1);
if (c == 0)
break;
}
/* Copy the string contents into a string inside GDB. */
str = (char *) alloca (j + 1);
read_memory_section (tem, str, j, VALUE_BFD_SECTION (val_args[i]));
read_memory (tem, str, j);
str[j] = 0;
printf_filtered (current_substring, str);

View File

@ -95,7 +95,7 @@ static void normal_target_post_startup_inferior PARAMS ((int pid));
static int
target_xfer_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len,
int write, asection * bfd_section));
int write));
static void init_dummy_target PARAMS ((void));
@ -836,7 +836,7 @@ target_read_string (memaddr, string, len, errnop)
tlen = MIN (len, 4 - (memaddr & 3));
offset = memaddr & 3;
errcode = target_xfer_memory (memaddr & ~3, buf, 4, 0, NULL);
errcode = target_xfer_memory (memaddr & ~3, buf, 4, 0);
if (errcode != 0)
{
/* The transfer request might have crossed the boundary to an
@ -844,7 +844,7 @@ target_read_string (memaddr, string, len, errnop)
a single byte. */
tlen = 1;
offset = 0;
errcode = target_xfer_memory (memaddr, buf, 1, 0, NULL);
errcode = target_xfer_memory (memaddr, buf, 1, 0);
if (errcode != 0)
goto done;
}
@ -896,17 +896,7 @@ target_read_memory (memaddr, myaddr, len)
char *myaddr;
int len;
{
return target_xfer_memory (memaddr, myaddr, len, 0, NULL);
}
int
target_read_memory_section (memaddr, myaddr, len, bfd_section)
CORE_ADDR memaddr;
char *myaddr;
int len;
asection *bfd_section;
{
return target_xfer_memory (memaddr, myaddr, len, 0, bfd_section);
return target_xfer_memory (memaddr, myaddr, len, 0);
}
int
@ -915,15 +905,9 @@ target_write_memory (memaddr, myaddr, len)
char *myaddr;
int len;
{
return target_xfer_memory (memaddr, myaddr, len, 1, NULL);
return target_xfer_memory (memaddr, myaddr, len, 1);
}
/* 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. */
asection *target_memory_bfd_section = NULL;
/* Move memory to or from the targets. Iterate until all of it has
been moved, if necessary. The top target gets priority; anything
it doesn't want, is offered to the next one down, etc. Note the
@ -935,12 +919,11 @@ asection *target_memory_bfd_section = NULL;
Result is 0 or errno value. */
static int
target_xfer_memory (memaddr, myaddr, len, write, bfd_section)
target_xfer_memory (memaddr, myaddr, len, write)
CORE_ADDR memaddr;
char *myaddr;
int len;
int write;
asection *bfd_section;
{
int curlen;
int res;
@ -951,8 +934,6 @@ target_xfer_memory (memaddr, myaddr, len, write, bfd_section)
if (len == 0)
return 0;
target_memory_bfd_section = bfd_section;
/* to_xfer_memory is not guaranteed to set errno, even when it returns
0. */
errno = 0;

View File

@ -614,10 +614,6 @@ target_read_string PARAMS ((CORE_ADDR, char **, int, int *));
extern int
target_read_memory PARAMS ((CORE_ADDR memaddr, char *myaddr, int len));
extern int
target_read_memory_section PARAMS ((CORE_ADDR memaddr, char *myaddr, int len,
asection * bfd_section));
extern int
target_write_memory PARAMS ((CORE_ADDR, char *, int));
@ -1388,7 +1384,6 @@ extern int baud_rate;
/* Timeout limit for response from target. */
extern int remote_timeout;
extern asection *target_memory_bfd_section;
/* Functions for helping to write a native target. */

View File

@ -465,7 +465,7 @@ value_at (type, addr, sect)
store_address (VALUE_CONTENTS_RAW (val), 4, num);
}
else
read_memory_section (addr, VALUE_CONTENTS_ALL_RAW (val), TYPE_LENGTH (type), sect);
read_memory (addr, VALUE_CONTENTS_ALL_RAW (val), TYPE_LENGTH (type));
VALUE_LVAL (val) = lval_memory;
VALUE_ADDRESS (val) = addr;
@ -540,8 +540,8 @@ value_fetch_lazy (val)
store_address (VALUE_CONTENTS_RAW (val), 4, num);
}
else if (length)
read_memory_section (addr, VALUE_CONTENTS_ALL_RAW (val), length,
VALUE_BFD_SECTION (val));
read_memory (addr, VALUE_CONTENTS_ALL_RAW (val), length);
VALUE_LAZY (val) = 0;
return 0;
}