diff options
author | Scott Soule Cheloha <cheloha@cvs.openbsd.org> | 2024-02-23 18:19:04 +0000 |
---|---|---|
committer | Scott Soule Cheloha <cheloha@cvs.openbsd.org> | 2024-02-23 18:19:04 +0000 |
commit | e40219c6038fbc57fe8538ac3e33cec4c95cf895 (patch) | |
tree | 5f6a89aaa64b80d23bed8c3bad9d976ef8dfc200 /sys/arch/arm | |
parent | b2a2e7effefaadd9001bab00a50206c972260c8f (diff) |
ddb(4): db_read_bytes/db_write_bytes: change dst/src parameter to void*
Almost all db_read_bytes() callers cast the destination buffer
argument to char*, which suggests the API's prototype is incompatible
with how the API is actually used.
Change db_read_bytes() and db_write_bytes() to take a void* as the
destination/source buffer parameter so callers don't need to cast the
argument.
With input from bluhm@. Bugs caught by Clemens Gossnitzer (ASCII
approximation of name).
Thread: https://marc.info/?l=openbsd-tech&m=170740813021636&w=2
ok bluhm@
Diffstat (limited to 'sys/arch/arm')
-rw-r--r-- | sys/arch/arm/arm/db_interface.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/arm/arm/db_interface.c b/sys/arch/arm/arm/db_interface.c index 45ab8bc6d2d..40ee1d84c6e 100644 --- a/sys/arch/arm/arm/db_interface.c +++ b/sys/arch/arm/arm/db_interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_interface.c,v 1.20 2022/10/15 08:04:02 jsg Exp $ */ +/* $OpenBSD: db_interface.c,v 1.21 2024/02/23 18:19:02 cheloha Exp $ */ /* $NetBSD: db_interface.c,v 1.34 2003/10/26 23:11:15 chris Exp $ */ /* @@ -182,9 +182,9 @@ db_validate_address(vaddr_t addr) * Read bytes from kernel address space for debugger. */ void -db_read_bytes(vaddr_t addr, size_t size, char *data) +db_read_bytes(vaddr_t addr, size_t size, void *datap) { - char *src = (char *)addr; + char *data = datap, *src = (char *)addr; if (db_validate_address((u_int)src)) { db_printf("address %p is invalid\n", src); @@ -301,11 +301,11 @@ db_write_text(vaddr_t addr, size_t size, char *data) * Write bytes to kernel address space for debugger. */ void -db_write_bytes(vaddr_t addr, size_t size, char *data) +db_write_bytes(vaddr_t addr, size_t size, void *datap) { extern char etext[]; extern char kernel_text[]; - char *dst; + char *data = datap, *dst; size_t loop; /* If any part is in kernel text, use db_write_text() */ |