-/* $OpenBSD: db_interface.c,v 1.28 2022/04/14 19:47:10 naddy Exp $ */
+/* $OpenBSD: db_interface.c,v 1.29 2024/02/23 18:19:02 cheloha Exp $ */
/* $NetBSD: db_interface.c,v 1.8 1999/10/12 17:08:57 jdolecek Exp $ */
/*
* Read bytes from kernel address space for debugger.
*/
void
-db_read_bytes(addr, size, data)
+db_read_bytes(addr, size, datap)
vaddr_t addr;
register size_t size;
- register char *data;
+ register void *datap;
{
- register char *src;
+ register char *data = datap, *src;
src = (char *)addr;
while (size-- > 0)
* Write bytes to kernel address space for debugger.
*/
void
-db_write_bytes(addr, size, data)
+db_write_bytes(addr, size, datap)
vaddr_t addr;
register size_t size;
- register char *data;
+ register void *datap;
{
- register char *dst;
+ register char *data = datap, *dst;
dst = (char *)addr;
while (size-- > 0)
-/* $OpenBSD: db_memrw.c,v 1.8 2017/04/30 13:04:49 mpi Exp $ */
+/* $OpenBSD: db_memrw.c,v 1.9 2024/02/23 18:19:02 cheloha Exp $ */
/* $NetBSD: db_memrw.c,v 1.1 2003/04/26 18:39:27 fvdl Exp $ */
/*-
* 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 *data = datap, *src;
src = (char *)addr;
* 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;
- char *dst;
+ char *data = datap, *dst;
/* If any part is in kernel text, use db_write_text() */
if (addr >= KERNBASE && addr < (vaddr_t)&etext) {
-/* $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 $ */
/*
* 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);
* 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() */
-/* $OpenBSD: db_interface.c,v 1.14 2022/11/07 09:43:04 mpi Exp $ */
+/* $OpenBSD: db_interface.c,v 1.15 2024/02/23 18:19:03 cheloha Exp $ */
/* $NetBSD: db_interface.c,v 1.34 2003/10/26 23:11:15 chris Exp $ */
/*
* 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((vaddr_t)src)) {
db_printf("address %p is invalid\n", src);
* 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[];
- char *dst;
+ char *data = datap, *dst;
size_t loop;
/* If any part is in kernel text, use db_write_text() */
-/* $OpenBSD: db_interface.c,v 1.49 2023/04/26 16:53:58 claudio Exp $ */
+/* $OpenBSD: db_interface.c,v 1.50 2024/02/23 18:19:03 cheloha Exp $ */
/*
* Copyright (c) 1999-2003 Michael Shalayeff
}
void
-db_read_bytes(vaddr_t addr, size_t size, char *data)
+db_read_bytes(vaddr_t addr, size_t size, void *datap)
{
+ char *data = datap;
register char *src = (char *)addr;
while (size--)
}
void
-db_write_bytes(vaddr_t addr, size_t size, char *data)
+db_write_bytes(vaddr_t addr, size_t size, void *datap)
{
+ char *data = datap;
register char *dst = (char *)addr;
while (size--)
-/* $OpenBSD: db_memrw.c,v 1.18 2020/09/23 15:13:26 deraadt Exp $ */
+/* $OpenBSD: db_memrw.c,v 1.19 2024/02/23 18:19:03 cheloha Exp $ */
/* $NetBSD: db_memrw.c,v 1.6 1999/04/12 20:38:19 pk Exp $ */
/*
* 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 *data = datap, *src;
src = (char *)addr;
while (size-- > 0)
* 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)
{
- char *dst;
+ char *data = datap, *dst;
extern char etext;
if (addr >= VM_MIN_KERNEL_ADDRESS &&
-/* $OpenBSD: db_interface.c,v 1.28 2022/04/14 19:47:11 naddy Exp $ */
+/* $OpenBSD: db_interface.c,v 1.29 2024/02/23 18:19:03 cheloha Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1991 Carnegie Mellon University
* 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 *data = datap, *src;
src = (char *)addr;
* 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 pt_entry_t *pmap_pte(pmap_t, vaddr_t);
- char *dst = (char *)addr;
+ char *data = datap, *dst = (char *)addr;
vaddr_t va;
paddr_t pa;
pt_entry_t *pte, opte, npte;
-/* $OpenBSD: db_machdep.c,v 1.60 2023/01/11 03:17:56 visa Exp $ */
+/* $OpenBSD: db_machdep.c,v 1.61 2024/02/23 18:19:03 cheloha Exp $ */
/*
* Copyright (c) 1998-2003 Opsycon AB (www.opsycon.se)
#endif
void
-db_read_bytes(vaddr_t addr, size_t size, char *data)
+db_read_bytes(vaddr_t addr, size_t size, void *datap)
{
+ char *data = datap;
+
while (size >= sizeof(uint32_t)) {
*(uint32_t *)data = kdbpeek(addr);
data += sizeof(uint32_t);
}
void
-db_write_bytes(vaddr_t addr, size_t size, char *data)
+db_write_bytes(vaddr_t addr, size_t size, void *datap)
{
+ char *data = datap;
vaddr_t ptr = addr;
size_t len = size;
/* $NetBSD: db_memrw.c,v 1.4 2001/05/18 20:38:27 matt Exp $ */
-/* $OpenBSD: db_memrw.c,v 1.6 2022/10/15 08:04:02 jsg Exp $ */
+/* $OpenBSD: db_memrw.c,v 1.7 2024/02/23 18:19:03 cheloha Exp $ */
/*
* Mach Operating System
* 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;
faultbuf env;
faultbuf *old_onfault = curpcb->pcb_onfault;
if (setfault(&env)) {
* 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)
{
- char *dst = (char *)addr;
+ char *data = datap, *dst = (char *)addr;
faultbuf env;
faultbuf *old_onfault = curpcb->pcb_onfault;
-/* $OpenBSD: db_memrw.c,v 1.2 2020/06/12 22:01:01 gkoehler Exp $ */
+/* $OpenBSD: db_memrw.c,v 1.3 2024/02/23 18:19:03 cheloha Exp $ */
/* $NetBSD: db_memrw.c,v 1.1 2003/04/26 18:39:27 fvdl Exp $ */
/*-
* 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 *data = datap, *src;
src = (char *)addr;
* 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 _start[], _etext[];
- char *dst;
+ char *data = datap, *dst;
/* If any part is in kernel text, use db_write_text() */
if (addr >= (vaddr_t)_start && addr < (vaddr_t)_etext) {
-/* $OpenBSD: db_interface.c,v 1.8 2022/04/14 19:47:11 naddy Exp $ */
+/* $OpenBSD: db_interface.c,v 1.9 2024/02/23 18:19:03 cheloha Exp $ */
/*
* Copyright (c) 1996 Scott K. Stevens
* 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((vaddr_t)src)) {
db_printf("address %p is invalid\n", src);
* 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)
{
// XXX
}
-/* $OpenBSD: db_memrw.c,v 1.1.1.1 2006/10/06 21:02:55 miod Exp $ */
+/* $OpenBSD: db_memrw.c,v 1.2 2024/02/23 18:19:03 cheloha Exp $ */
/* $NetBSD: db_memrw.c,v 1.8 2006/02/24 00:57:19 uwe Exp $ */
/*
* 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;
/* properly aligned 4-byte */
if (size == 4 && ((addr & 3) == 0) && (((uintptr_t)data & 3) == 0)) {
* 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)
{
- char *dst = (char *)addr;
+ char *data = datap, *dst = (char *)addr;
/* properly aligned 4-byte */
if (size == 4 && ((addr & 3) == 0) && (((uintptr_t)data & 3) == 0)) {
-/* $OpenBSD: db_interface.c,v 1.61 2023/01/31 15:18:55 deraadt Exp $ */
+/* $OpenBSD: db_interface.c,v 1.62 2024/02/23 18:19:03 cheloha Exp $ */
/* $NetBSD: db_interface.c,v 1.61 2001/07/31 06:55:47 eeh Exp $ */
/*
* 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 *data = datap;
register char *src;
src = (char *)addr;
* 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)
{
+ char *data = datap;
register char *dst;
extern vaddr_t ktext;
extern paddr_t ktextp;
-/* $OpenBSD: db_access.h,v 1.11 2020/01/20 15:58:23 visa Exp $ */
+/* $OpenBSD: db_access.h,v 1.12 2024/02/23 18:19:02 cheloha Exp $ */
/* $NetBSD: db_access.h,v 1.6 1994/10/09 08:29:57 mycroft Exp $ */
/*
db_expr_t db_get_value(vaddr_t, size_t, int);
void db_put_value(vaddr_t, size_t, db_expr_t);
-void db_read_bytes(vaddr_t, size_t, char *);
-void db_write_bytes(vaddr_t, size_t, char *);
+void db_read_bytes(vaddr_t, size_t, void *);
+void db_write_bytes(vaddr_t, size_t, void *);