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 | 38e5cc81a76e9d16ddd1b0edeb740d2c6d9c7436 (patch) | |
tree | 40543654e28daa336bb897de7424419bb9207312 /gdb/corefile.c | |
parent | 0069f5f2869ac5f4170f17cc93a1ceb59812e0c7 (diff) | |
download | gdb-38e5cc81a76e9d16ddd1b0edeb740d2c6d9c7436.tar.gz |
* 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/corefile.c')
-rw-r--r-- | gdb/corefile.c | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/gdb/corefile.c b/gdb/corefile.c index 51a3b03568b..4e096f05908 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 |