diff options
author | Jim Blandy <jimb@codesourcery.com> | 2001-11-12 21:08:04 +0000 |
---|---|---|
committer | Jim Blandy <jimb@codesourcery.com> | 2001-11-12 21:08:04 +0000 |
commit | c26e46834fdfc080054fb546f879533daa5229da (patch) | |
tree | 07ae1696559b7597fadf107af06802ea0f243775 /gdb | |
parent | cbbab8fb38cde6c25134a9648f132af8157c2751 (diff) | |
download | gdb-c26e46834fdfc080054fb546f879533daa5229da.zip gdb-c26e46834fdfc080054fb546f879533daa5229da.tar.gz gdb-c26e46834fdfc080054fb546f879533daa5229da.tar.bz2 |
* corefile.c (write_memory_unsigned_integer,
write_memory_signed_integer): New functions.
(write_memory): Move to be with other write_memory_* functions.
* gdbcore.h (write_memory_unsigned_integer,
write_memory_signed_integer): New declarations.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/corefile.c | 41 | ||||
-rw-r--r-- | gdb/gdbcore.h | 8 |
3 files changed, 46 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f2ddf39..8237646 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2001-11-12 Jim Blandy <jimb@redhat.com> + + * corefile.c (write_memory_unsigned_integer, + write_memory_signed_integer): New functions. + (write_memory): Move to be with other write_memory_* functions. + * gdbcore.h (write_memory_unsigned_integer, + write_memory_signed_integer): New declarations. + 2001-11-11 Geoffrey Keating <geoffk@redhat.com> * dwarf2read.c (dwarf_decode_lines): Properly deal with diff --git a/gdb/corefile.c b/gdb/corefile.c index 51a3b03..4e096f0 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -260,17 +260,6 @@ dis_asm_print_address (bfd_vma addr, struct disassemble_info *info) print_address (addr, info->stream); } -/* Same as target_write_memory, but report an error if can't write. */ -void -write_memory (CORE_ADDR memaddr, char *myaddr, int len) -{ - int status; - - status = target_write_memory (memaddr, myaddr, len); - if (status != 0) - memory_error (status, memaddr); -} - /* Read an integer from debugged memory, given address and number of bytes. */ LONGEST @@ -317,6 +306,36 @@ read_memory_string (CORE_ADDR memaddr, char *buffer, int max_len) break; } } + +/* Same as target_write_memory, but report an error if can't write. */ +void +write_memory (CORE_ADDR memaddr, char *myaddr, int len) +{ + int status; + + status = target_write_memory (memaddr, myaddr, len); + if (status != 0) + memory_error (status, memaddr); +} + +/* Store VALUE at ADDR in the inferior as a LEN-byte unsigned integer. */ +void +write_memory_unsigned_integer (CORE_ADDR addr, int len, ULONGEST value) +{ + char *buf = alloca (len); + store_unsigned_integer (buf, len, value); + write_memory (addr, buf, len); +} + +/* Store VALUE at ADDR in the inferior as a LEN-byte signed integer. */ +void +write_memory_signed_integer (CORE_ADDR addr, int len, LONGEST value) +{ + char *buf = alloca (len); + store_signed_integer (buf, len, value); + write_memory (addr, buf, len); +} + #if 0 diff --git a/gdb/gdbcore.h b/gdb/gdbcore.h index 95b6862..03ac799 100644 --- a/gdb/gdbcore.h +++ b/gdb/gdbcore.h @@ -72,6 +72,14 @@ extern void read_memory_string (CORE_ADDR, char *, int); extern void write_memory (CORE_ADDR memaddr, char *myaddr, int len); +/* Store VALUE at ADDR in the inferior as a LEN-byte unsigned integer. */ +extern void write_memory_unsigned_integer (CORE_ADDR addr, int len, + ULONGEST value); + +/* Store VALUE at ADDR in the inferior as a LEN-byte unsigned integer. */ +extern void write_memory_signed_integer (CORE_ADDR addr, int len, + LONGEST value); + extern void generic_search (int len, char *data, char *mask, CORE_ADDR startaddr, int increment, CORE_ADDR lorange, CORE_ADDR hirange, |