minix/kernel/arch/i386
Erik van der Kouwe b42c66ed10 this patch adds access to the debug breakpoints to
the kernel. They are not used atm, but having them in trunk allows them
to be easily used when needed. To set a breakpoint that triggers when
the variable foo is written to (the most common use case), one calls:

breakpoint_set(vir2phys((vir_bytes) &foo), 0,
  BREAKPOINT_FLAG_MODE_GLOBAL |
  BREAKPOINT_FLAG_RW_WRITE |
  BREAKPOINT_FLAG_LEN_4);

It can later be disabled using:

breakpoint_set(vir2phys((vir_bytes) &foo), 0,
  BREAKPOINT_FLAG_MODE_OFF);

There are some limitations:

- There are at most four breakpoints (hardware limit); the index of the
  breakpoint (0-3) is specified as the second parameter of
  breakpoint_set.

- The breakpoint exception in the kernel is not handled and causes a
  panic; it would be reasonably easy to change this by inspecing DR6,
  printing a message, disabling the breakpoint and continuing. However,
  in my experience even just a panic can be very useful.

- Breakpoints can be set only in the part of the address space that is
  in every page table. It is useful for the kernel, but to use this for
  user processes would require saving and restoring the debug registers
  as part of the context switch. Although the CPU provides support for
  local breakpoints (I implemened this as BREAKPOINT_FLAG_LOCAL) they
  only work if task switching is used.
2010-03-19 19:15:20 +00:00
..
include Move archtypes.h, fpu.h, and stackframe.h 2010-03-09 09:41:14 +00:00
apic.c no more kprintf - kernel uses libsys printf now, only kputc is special 2010-03-03 15:45:01 +00:00
apic.h NMI watchdog is an awesome feature for debugging locked up kernels. 2010-01-16 20:53:55 +00:00
apic_asm.h Local APIC 2009-11-16 21:41:44 +00:00
apic_asm.S Move archtypes.h, fpu.h, and stackframe.h 2010-03-09 09:41:14 +00:00
arch_do_vmctl.c panic() cleanup. 2010-03-05 15:05:11 +00:00
breakpoints.c this patch adds access to the debug breakpoints to 2010-03-19 19:15:20 +00:00
clock.c Include directory reorg and makefile updates. 2010-03-08 11:04:59 +00:00
clock.h Removed unused symbols. 2010-01-25 18:13:48 +00:00
debugreg.h this patch adds access to the debug breakpoints to 2010-03-19 19:15:20 +00:00
debugreg.S this patch adds access to the debug breakpoints to 2010-03-19 19:15:20 +00:00
do_int86.c Include directory reorg and makefile updates. 2010-03-08 11:04:59 +00:00
do_iopenable.c This patch removes the global variables who_p and who_e from the 2010-02-03 09:04:48 +00:00
do_readbios.c This patch removes the global variables who_p and who_e from the 2010-02-03 09:04:48 +00:00
do_sdevio.c no more kprintf - kernel uses libsys printf now, only kputc is special 2010-03-03 15:45:01 +00:00
exception.c New RS and new signal handling for system processes. 2010-03-17 01:15:29 +00:00
glo.h Local APIC 2009-11-16 21:41:44 +00:00
hw_intr.h Fixed some type inconsistencies in the kernel. 2010-01-26 12:26:06 +00:00
i8259.c Include directory reorg and makefile updates. 2010-03-08 11:04:59 +00:00
klib386.S change messy CREATEPDE macro to clean little function. 2010-03-18 13:35:41 +00:00
Makefile this patch adds access to the debug breakpoints to 2010-03-19 19:15:20 +00:00
memory.c Specify missing return type 2010-03-19 19:07:00 +00:00
mpx386.S Fixed kernel stack comment 2010-03-18 16:18:22 +00:00
protect.c Move archtypes.h, fpu.h, and stackframe.h 2010-03-09 09:41:14 +00:00
proto.h this patch adds access to the debug breakpoints to 2010-03-19 19:15:20 +00:00
sconst.h NMI watchdog is an awesome feature for debugging locked up kernels. 2010-01-16 20:53:55 +00:00
system.c Move archtypes.h, fpu.h, and stackframe.h 2010-03-09 09:41:14 +00:00
watchdog.c panic() cleanup. 2010-03-05 15:05:11 +00:00
watchdog.h NMI watchdog is an awesome feature for debugging locked up kernels. 2010-01-16 20:53:55 +00:00