Commit Graph

15 Commits

Author SHA1 Message Date
Ingo Weinhold
34b3b26b3b 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
2008-01-11 00:36:44 +00:00
Ingo Weinhold
65a7804abe Set default team debug flags to 0. Threads of a team were
unnecessarily stopped, when another thread crashed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22119 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-08-30 01:10:46 +00:00
Ingo Weinhold
44b5d72b5a Added new functions to the debugger API:
{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
2007-03-20 16:20:13 +00:00
Ingo Weinhold
37a25a6ceb * Fail, if debug_thread() is invoked for the debug nub thread.
* 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
2005-11-03 00:40:36 +00:00
Axel Dörfler
50374cbdca Changed the signal handling code so that handle_signals() can be called without
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
2005-10-20 16:56:04 +00:00
Ingo Weinhold
3eae1fea40 * Added support for debugging through exec*().
* 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
2005-03-25 18:40:07 +00:00
Ingo Weinhold
823f4c5bf4 * Various modifications needed due to the changes in <debugger.h>.
* 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
2005-03-13 23:57:34 +00:00
Ingo Weinhold
293a59b0e9 * The debug_thread_info records now, which signals the debugger wishes
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
2005-03-12 21:43:35 +00:00
Ingo Weinhold
2eece8633c * Added support for debugger handover.
* 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
2005-03-10 22:04:27 +00:00
Ingo Weinhold
6bbfd2627b New syscall _kern_wait_for_debugger().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11635 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-09 22:46:31 +00:00
Ingo Weinhold
2562e5185c Command B_DEBUG_MESSAGE_GET_WHY_STOPPED supports a reply port now.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11633 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-09 22:05:43 +00:00
Ingo Weinhold
ae7c619aae * Added architecture specific structure to thread_debug_info.
* 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
2005-03-01 23:47:59 +00:00
Ingo Weinhold
a7ad39fe09 * New locking strategy for the team debug info. It's no longer protected
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
2005-02-28 00:34:06 +00:00
Ingo Weinhold
e988d66022 * Added B_TEAM_DEBUG_DEFAULT_FLAGS and B_THREAD_DEBUG_DEFAULT_FLAGS for
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
2005-02-24 16:07:19 +00:00
Ingo Weinhold
bc797a9ee5 The beginnings of userland debugger support. Currently basically only what is needed for strace is implemented.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11308 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-10 02:47:46 +00:00