* Write bytes to kernel address space for debugger. * We need to disable write protection temporarily so we can write * things (such as break points) that might be in write-protected * memory. */
| 71 | * memory. |
| 72 | */ |
| 73 | int |
| 74 | db_write_bytes(vm_offset_t addr, size_t size, char *data) |
| 75 | { |
| 76 | jmp_buf jb; |
| 77 | void *prev_jb; |
| 78 | char *dst; |
| 79 | bool old_wp; |
| 80 | int ret; |
| 81 | |
| 82 | old_wp = false; |
| 83 | prev_jb = kdb_jmpbuf(jb); |
| 84 | ret = setjmp(jb); |
| 85 | if (ret == 0) { |
| 86 | old_wp = disable_wp(); |
| 87 | dst = (char *)addr; |
| 88 | while (size-- > 0) |
| 89 | *dst++ = *data++; |
| 90 | } |
| 91 | restore_wp(old_wp); |
| 92 | (void)kdb_jmpbuf(prev_jb); |
| 93 | return (ret); |
| 94 | } |
| 95 | |
| 96 | void |
| 97 | db_show_mdpcpu(struct pcpu *pc) |
nothing calls this directly
no test coverage detected