next up previous contents index
Next: 10.17.4 gdb_state: processor register Up: 10.17 Remote Kernel Debugging Previous: 10.17.2 Using the remote

10.17.3 Debugging address spaces other than the kernel's

Although the OSKit's remote debugging support code is most directly and obviously useful for debugging the OS kernel itself, most of the code does not assume that the kernel is the entity being debugged. In fact, it is quite straightforward to adapt the mechanism to allow remote debugging of other entities, such as user-level programs running on top of the kernel. To make the debugging stub operate on a different address space than the kernel's, it is simply necessary to override the gdb_copyin and gdb_copyout routines with alternate versions that transfer data to or from the appropriate address space. Operating systems that support a notion of user-level address spaces generally have some kind of ``copyin'' and ``copyout'' routines anyway to provide safe access to user address spaces; the replacement gdb_copyin and gdb_copyout routines can call those standard user space access routines. In addition, the trap handling mechanism may need to be set up so that only traps occurring in a particular context (e.g., within a particular user process or thread) will be dispatched to the remote debugger.



University of Utah Flux Research Group