MCPcopy Create free account
hub / github.com/F-Stack/f-stack / db_write_bytes

Function db_write_bytes

freebsd/amd64/amd64/db_interface.c:73–94  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

71 * memory.
72 */
73int
74db_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
96void
97db_show_mdpcpu(struct pcpu *pc)

Callers

nothing calls this directly

Calls 4

kdb_jmpbufFunction · 0.85
setjmpFunction · 0.85
disable_wpFunction · 0.85
restore_wpFunction · 0.85

Tested by

no test coverage detected