forked from Imagelibrary/binutils-gdb
2003-10-24 Andrew Cagney <cagney@redhat.com>
* target.c: Include "gdbcore.h". (get_target_memory, get_target_memory_unsigned): New functions. * target.h (get_target_memory, get_target_memory_unsigned): Declare. * ppc-linux-tdep.c (ppc64_linux_convert_from_func_ptr_addr): Use get_target_memory_unsigned. * Makefile.in (target.o): Update dependencies.
This commit is contained in:
23
gdb/target.c
23
gdb/target.c
@@ -37,6 +37,7 @@
|
||||
#include <signal.h>
|
||||
#include "regcache.h"
|
||||
#include "gdb_assert.h"
|
||||
#include "gdbcore.h"
|
||||
|
||||
static void target_info (char *, int);
|
||||
|
||||
@@ -1214,6 +1215,28 @@ target_write (struct target_ops *ops,
|
||||
return len;
|
||||
}
|
||||
|
||||
/* Memory transfer methods. */
|
||||
|
||||
void
|
||||
get_target_memory (struct target_ops *ops, CORE_ADDR addr, void *buf,
|
||||
LONGEST len)
|
||||
{
|
||||
if (target_read (ops, TARGET_OBJECT_MEMORY, NULL, buf, addr, len)
|
||||
!= len)
|
||||
memory_error (EIO, addr);
|
||||
}
|
||||
|
||||
ULONGEST
|
||||
get_target_memory_unsigned (struct target_ops *ops,
|
||||
CORE_ADDR addr, int len)
|
||||
{
|
||||
char buf[sizeof (ULONGEST)];
|
||||
|
||||
gdb_assert (len <= sizeof (buf));
|
||||
get_target_memory (ops, addr, buf, len);
|
||||
return extract_unsigned_integer (buf, len);
|
||||
}
|
||||
|
||||
static void
|
||||
target_info (char *args, int from_tty)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user