History log of /haiku/headers/private/kernel/arch/user_debugger.h
Revision Date Author Comments
# 99f00556 20-Apr-2016 Ingo Weinhold <ingo_weinhold@gmx.de>

kernel: +arch_get_thread_debug_cpu_state()

Similar to arch_get_debug_cpu_state(), but the thread whose CPU state
to retrieve is specified. Works only for threads that aren't running,
and on x86-64 we can get the FPU state only when the thread was
interrupted in userland.
Not implemented for the incomplete architecture ports.


# 4535495d 10-Jan-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged the signals branch into trunk, with these changes:
* The team and thread kernel structures have been renamed to Team and Thread
respectively and moved into the new BKernel namespace.
* Several (kernel add-on) sources have been converted from C to C++ since
private kernel headers are included that are no longer C compatible.

Changes after merging:
* Fixed gcc 2 build (warnings mainly in the scary firewire bus manager).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40196 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0b11ecb1 21-Jul-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Always include the public arch_debugger.h headers. The structures defined
there are prefixed with the respective architecture name. Useful for remote
debugging a different architecture.
* <x86/arch_debugger.h>: Introduced a structure for the FPU state, so that it
isn't left to the debugger.
* Removed the _kern_get_thread_cpu_state() syscall. Was originally intended for
bdb compatiblity, but isn't really needed.
* Kernel x86 arch_get_debug_cpu_state(): The use of fnsave was broken, since
it reinits the FPU after saving the state. This resulted in weird results
when debugging functions using the FPU. We now use fxsave, if available.
Otherwise fnsave + frstor should be used -- not fully implemented yet.
Same for arch_set_debug_cpu_state().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31682 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b0f12d64 23-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added transparent software breakpoint support for user debuggers:
* The bulk of the work -- i.e. juggling the software and hardware breakpoints,
watchpoints, and memory reads/writes -- is done in the new class
BreakpointManager.
* For the architectures a few capability macros have to be defined, one
pointing to the software breakpoint instruction opcode. Done for x86.
* Some more simplifications in the user debugger code, made possible by the
recently introduced debugger_changed_condition attribute.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31214 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 568ade58 13-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

User debugger support:
* Generalized address checks. The debugger can now also read the commpage.
* Added new syscall _kern_get_thread_cpu_state() to get the CPU state of a
not running thread. Introduced arch_get_thread_debug_cpu_state() for that
purpose, which is only implemented for x86 ATM (uses the new
i386_get_thread_user_iframe()).
* Don't allow a debugger to change a thread's "esp" anymore. That's the esp
register in the kernel. "user_esp" can still be changed.
* Generally set RF (resume flag) in eflags in interrupt handlers, not only
after a instruction breakpoint debug exception. This should prevent
breakpoints from being triggered more than once (e.g. when the breakpoint is
on an instruction that can cause a page fault). I still saw those with bdb
in VMware, but that might be a VMware bug.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31045 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6e595b29 16-Oct-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Moved KERNEL_BREAKPOINTS to kernel_debug_config.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28197 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0490454c 26-Aug-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Made safe to be included from assembly code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27212 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 34b3b26b 10-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged branch haiku/branches/developer/bonefish/optimization revision
23139 into trunk, with roughly the following changes (for details svn
log the branch):
* The int 99 syscall handler is now fully in assembly.
* Added a sysenter/sysexit handler and use it on Pentiums that support
it (via commpage).
* Got rid of i386_handle_trap(). A bit of functionality was moved into
the assembly handler which now uses a jump table to call C functions
handling the respective interrupt.
* Some optimizations to get user debugger support code out of the
interrupt handling path.
* Introduced a thread::flags fields which allows to skip handling of
rare events (signals, user debug enabling/disabling) on the
common interrupt handling path.
* Got rid of the explicit iframe stack. The iframes can still be
retrieved by iterating through the stack frames.
* Made the commpage an architecture independent feature. It's used for
the real time data stuff (instead of creating a separate area).
* The x86 CPU modules can now provide processor optimized versions for
common functions (currently memcpy() only). They are used in the
kernel and are provided to the userland via commpage entries.
* Introduced build system feature allowing easy use of C structure
member offsets in assembly code.

Changes after merging:
* Fixed merge conflict in src/system/kernel/arch/x86/arch_debug.cpp
(caused by refactoring and introduction of "call" debugger command).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23370 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 667f1eeb 02-Sep-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added support for setting (hardware) break-/watchpoints in the kernel.
Can be enabled by defining KERNEL_BREAKPOINTS in arch/user_debugger.h
and will provide the arch_{set,clear}_kernel_{break,watch}point()
function. Hitting a break-/watchpoint will throw the thread into KDL.
* Finally added a comment, what's the point of
i386_reinit_user_debug_after_context_switch(), since I wonder every
time I see it. Should be optimized aways soon.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22150 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 00a2b607 01-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added functions for clearing/destroying the architecture specific thread
debug info.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11521 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dd07f600 27-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added functions for clearing/destroying the architecture specific team
debug infos.
* Added function for setting the CPU state.
* Added functions for setting break-/watchpoints.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11507 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c7eab67f 24-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Architecture specific debugger interface.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11469 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4535495d80c86e19e2610e7444a4fcefe3e0f8e6 10-Jan-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged the signals branch into trunk, with these changes:
* The team and thread kernel structures have been renamed to Team and Thread
respectively and moved into the new BKernel namespace.
* Several (kernel add-on) sources have been converted from C to C++ since
private kernel headers are included that are no longer C compatible.

Changes after merging:
* Fixed gcc 2 build (warnings mainly in the scary firewire bus manager).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40196 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0b11ecb18c9afe14114fac959f698a2bfa5b7230 21-Jul-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Always include the public arch_debugger.h headers. The structures defined
there are prefixed with the respective architecture name. Useful for remote
debugging a different architecture.
* <x86/arch_debugger.h>: Introduced a structure for the FPU state, so that it
isn't left to the debugger.
* Removed the _kern_get_thread_cpu_state() syscall. Was originally intended for
bdb compatiblity, but isn't really needed.
* Kernel x86 arch_get_debug_cpu_state(): The use of fnsave was broken, since
it reinits the FPU after saving the state. This resulted in weird results
when debugging functions using the FPU. We now use fxsave, if available.
Otherwise fnsave + frstor should be used -- not fully implemented yet.
Same for arch_set_debug_cpu_state().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31682 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b0f12d64f42dc8f5bbabf4cbcdf25178b3eb3749 23-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added transparent software breakpoint support for user debuggers:
* The bulk of the work -- i.e. juggling the software and hardware breakpoints,
watchpoints, and memory reads/writes -- is done in the new class
BreakpointManager.
* For the architectures a few capability macros have to be defined, one
pointing to the software breakpoint instruction opcode. Done for x86.
* Some more simplifications in the user debugger code, made possible by the
recently introduced debugger_changed_condition attribute.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31214 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 568ade58d054e27ce4cd9da0d4e73ecb79563b96 13-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

User debugger support:
* Generalized address checks. The debugger can now also read the commpage.
* Added new syscall _kern_get_thread_cpu_state() to get the CPU state of a
not running thread. Introduced arch_get_thread_debug_cpu_state() for that
purpose, which is only implemented for x86 ATM (uses the new
i386_get_thread_user_iframe()).
* Don't allow a debugger to change a thread's "esp" anymore. That's the esp
register in the kernel. "user_esp" can still be changed.
* Generally set RF (resume flag) in eflags in interrupt handlers, not only
after a instruction breakpoint debug exception. This should prevent
breakpoints from being triggered more than once (e.g. when the breakpoint is
on an instruction that can cause a page fault). I still saw those with bdb
in VMware, but that might be a VMware bug.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31045 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6e595b29e31f6c6a19c2e3ba4b0ec4e7c6e6d976 16-Oct-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Moved KERNEL_BREAKPOINTS to kernel_debug_config.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28197 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0490454cb8d7aa60633930e6cab414c4d9ed9dc9 26-Aug-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Made safe to be included from assembly code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27212 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 34b3b26b3b8c46ba46ddde037b10dd173f4936d6 10-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged branch haiku/branches/developer/bonefish/optimization revision
23139 into trunk, with roughly the following changes (for details svn
log the branch):
* The int 99 syscall handler is now fully in assembly.
* Added a sysenter/sysexit handler and use it on Pentiums that support
it (via commpage).
* Got rid of i386_handle_trap(). A bit of functionality was moved into
the assembly handler which now uses a jump table to call C functions
handling the respective interrupt.
* Some optimizations to get user debugger support code out of the
interrupt handling path.
* Introduced a thread::flags fields which allows to skip handling of
rare events (signals, user debug enabling/disabling) on the
common interrupt handling path.
* Got rid of the explicit iframe stack. The iframes can still be
retrieved by iterating through the stack frames.
* Made the commpage an architecture independent feature. It's used for
the real time data stuff (instead of creating a separate area).
* The x86 CPU modules can now provide processor optimized versions for
common functions (currently memcpy() only). They are used in the
kernel and are provided to the userland via commpage entries.
* Introduced build system feature allowing easy use of C structure
member offsets in assembly code.

Changes after merging:
* Fixed merge conflict in src/system/kernel/arch/x86/arch_debug.cpp
(caused by refactoring and introduction of "call" debugger command).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23370 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 667f1eeb67a4160a43f49c0be9d4d8b7c070afdd 02-Sep-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added support for setting (hardware) break-/watchpoints in the kernel.
Can be enabled by defining KERNEL_BREAKPOINTS in arch/user_debugger.h
and will provide the arch_{set,clear}_kernel_{break,watch}point()
function. Hitting a break-/watchpoint will throw the thread into KDL.
* Finally added a comment, what's the point of
i386_reinit_user_debug_after_context_switch(), since I wonder every
time I see it. Should be optimized aways soon.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22150 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 00a2b607d8489e913024570526ac92141aacac3f 01-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added functions for clearing/destroying the architecture specific thread
debug info.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11521 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dd07f6001dd30f52250b1c96163abeb095ee7c24 27-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added functions for clearing/destroying the architecture specific team
debug infos.
* Added function for setting the CPU state.
* Added functions for setting break-/watchpoints.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11507 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c7eab67fe12f2bf0f9fe97ef91468ab3b075725c 24-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Architecture specific debugger interface.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11469 a95241bf-73f2-0310-859d-f6bbb57e9c96