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
{set,clear}_debugger_{break,watch}point(), allowing to set/clear break
and watchpoints for the calling team. When a break/watchpoint is hit,
the team enters the debugger. Handy in situations when the program in
question can't really be started in a debugger (or it would be
complicated to do so). The functions work only as long as no debugger is
installed for the team.
We clear the arch specific team and thread debug infos now, when a new
debugger is installed, thus clearing break- and watchpoints.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20396 a95241bf-73f2-0310-859d-f6bbb57e9c96
* To always be on the safe side, thread_hit_debug_event() now checks
whether the thread is the debug nub thread.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14655 a95241bf-73f2-0310-859d-f6bbb57e9c96
having the thread lock held and interrupts disabled.
Cleaned up the signal handling code, and fixed some minor bugs with blockable
vs. non-blockable signals.
thread_debug_info was using uint64 for signals sets instead of sigset_t.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14457 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added initialization function. Currently only need to init the
single step hack for qemu.
* Fixed a deadlock when the nub thread destroyed the debug info. It was
waiting for itself.
* Moved the filling in the origin info of the debug messages into
thread_hit_debug_event_internal(). No need for code duplication.
* Writing to user memory can now be partial. We also change the area
protection, if it wasn't writable. Necessary for setting software
breakpoints.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11996 a95241bf-73f2-0310-859d-f6bbb57e9c96
* user_debug_break_or_watchpoint_hit() into separate functions for
break- and watchpoints. The one for breakpoints gets another parameter
which indicates whether the breakpoint was a soft- or hardware
breakpoint. This info is also sent to the debugger.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11714 a95241bf-73f2-0310-859d-f6bbb57e9c96
not to be notified.
* Added debugger commands for setting/getting of thread signal ignore
masks and signal handlers.
* Renamed user_debug_fault_occurred() to a more correct
user_debug_exception_occurred(). It no longer sends a `stopped' message,
but the new one dedicated to exceptions. Additionally the number of the
signal is supplied that will be sent, when the thread continues (without
indicating to ignore the event).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11703 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Implemented _user_wait_for_debugger().
* Reworked a few bits to ensure that after a remove_team_debugger() or
after requesting a debugger handover the debugger doesn't get any more
messages.
* When the debugger is removed or dies, the debugged threads should now
cleanup their debug info and continue, instead of waiting at their
debug port forever.
All the new features are not tested. Will happen, when gdb will be
debugged.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11664 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added event callbacks for break- and watchpoints and single stepping.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11520 a95241bf-73f2-0310-859d-f6bbb57e9c96
by the team lock, but by a lock in the structure. This is necessary
since we can't acquire the team lock while thread switching, for then the
thread lock is already held.
* Added support for single stepping and break-/watchpoints.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11503 a95241bf-73f2-0310-859d-f6bbb57e9c96
convenience.
* Added/implemented callbacks for almost all missing debug events (team,
thread, image creation/deletion, exceptions/faults, signals).
* The debugger can now specify how to deal with the event that stopped an
event (ignore or handle signals, exceptions/faults).
* Implemented B_DEBUGGED_THREAD_GET_WHY_STOPPED debugger message.
* The cpu_state is now passed to the debugger with
B_DEBUGGER_MESSAGE_THREAD_STOPPED notifications.
* Completed _user_debugger() implementation.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11474 a95241bf-73f2-0310-859d-f6bbb57e9c96