History log of /haiku/headers/os/kernel/debugger.h
Revision Date Author Comments
# bfd3d337 29-May-2023 Trung Nguyen <trungnt282910@gmail.com>

strace: Print detailed signal information

- Add support for retrieving the `siginfo_t` structure of a signal
event from the Debugger API.
- Add code to `strace` to display this information every time a
signal event occurs, similar to the Linux `strace` tool.

Change-Id: If4e92bbae049ee0b52efaf9fc911d66511da62f4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6393
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 372b901d 28-Aug-2021 Alexander von Gluck IV <kallisti5@unixzen.com>

riscv: cleanup architecture macro checks

* We really should get out of the habbit of making up
our own architecture defines.
* __riscv with an additional __riscv_xlen is the
standard that developed... let's just roll with it.

Change-Id: Ieb777d48340ae25a6d66f66133afa0ec5c6da9b6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4402
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 1761cb8e 30-Aug-2019 Jaroslaw Pelczar <jarek@jpelczar.com>

arm64: Add more headers for code compilation

This makes ARM64 target compile more files. This patch is one of
series of patches to support new architecture, as fixes in many
places are required just to compile the code.

Signed-off-by: Jaroslaw Pelczar <jarek@jpelczar.com>
Change-Id: Ia060612733cd3a0fcb781fec449da164ed635b8e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1807
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 5ffbe7d7 30-Mar-2019 Augustin Cavalier <waddlesplash@gmail.com>

Change all references to "__INTEL__" to "__i386__".

They are functionally identical, but the former is a BeOS/Haiku-specfic
macro that we include in the compiler specs, and the latter is defined
by GCC.


# 05dda88d 25-Feb-2019 Alexander von Gluck IV <kallisti5@unixzen.com>

headers/riscv64: Implement basic arch headers

Change-Id: I6bfbacb61eae84ffebc30c2565683348d684d88f
Reviewed-on: https://review.haiku-os.org/c/1063
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 5629675a 17-Feb-2019 Adrien Destugues <pulkomandy@gmail.com>

sparc: add defines and minimum set of required files

Gets the stage0 bootstrap to run.
Imlementation is probably nonsense at this point.

Change-Id: I10876efbb54314b864c0ad951152757cdb2fd366
Reviewed-on: https://review.haiku-os.org/c/1061
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 605e7eae 31-Jul-2018 Alexander von Gluck IV <kallisti5@unixzen.com>

arch: Cleanup a few typos. Sorry for spam.

Change-Id: Ic2fce841acdee8572005cf2a9710188d03d7cecd


# 9642f770 31-Jul-2018 Alexander von Gluck IV <kallisti5@unixzen.com>

arch: Cleanup of __ARM__ checks

* gcc 7.x defines __arm__ and __ARM__ (and others)
* clang defines __arm__ and __arm
* cleanup a few related ifdef vs if macros

Change-Id: I5da4bafac590f6fa3e10e543688001c2449f840d


# 467fe4ca 24-Apr-2016 Ingo Weinhold <ingo_weinhold@gmx.de>

kernel: Add core dump facility

* Add function core_dump_write_core_file(). It writes a core file for
the current thread's team. The file format is similar to that of
other OSs (i.e. ELF with PT_LOAD segments and a PT_NOTE segment), but
most of the notes are Haiku specific (infos for team, areas, images,
threads). More data will probably need to be added.
* Add team flag TEAM_FLAG_DUMP_CORE, thread flag
THREAD_FLAGS_TRAP_FOR_CORE_DUMP, and Team property coreDumpCondition,
a condition variable available while a core dump is progress. A
thread that finds its flag THREAD_FLAGS_TRAP_FOR_CORE_DUMP set before
exiting the kernel to userland calls core_dump_trap_thread(), which
blocks on the condition variable until the core dump has finished. We
need the team's threads to stop so we can get their CPU state (and
have a generally unchanging team state while writing the core file).
* Add user debugger message B_DEBUG_WRITE_CORE_FILE. It causes
core_dump_write_core_file() to be called for the team.
* Dumping core as an immediate effect of a terminal signal has not been
implemented yet, but that should be fairly straight forward.


# 77ea49f4 28-Jun-2013 Rene Gollent <anevilyak@gmail.com>

Adjust debug API to address some x86-64 concerns.

- The argument buffer contained in the debug_{pre,post}_syscall message structures wasn't large enough to accomodate all
arguments for some syscalls on x86-64, which could potentially have led to kernel memory corruption when using syscall
tracing via the debug API. As such, enlarge it to accomodate 64-bit platforms as well.

- Adjust TeamDebugger/SyscallInfo to discriminate the target architecture and read the arguments when trapping console
output. Gets the latter working on x86-64.


# f76bc433 13-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Added some x86_64 system/kernel headers and kernel Jamfiles.

* Not all of these headers are correct yet, just adding what's necessary
to get things to compile for the time being.


# 24df6592 11-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged signals-merge branch into trunk with the following changes:
* Reorganized the kernel locking related to threads and teams.
* We now discriminate correctly between process and thread signals. Signal
handlers have been moved to teams. Fixes #5679.
* Implemented real-time signal support, including signal queuing, SA_SIGINFO
support, sigqueue(), sigwaitinfo(), sigtimedwait(), waitid(), and the addition
of the real-time signal range. Closes #1935 and #2695.
* Gave SIGBUS a separate signal number. Fixes #6704.
* Implemented <time.h> clock and timer support, and fixed/completed alarm() and
[set]itimer(). Closes #5682.
* Implemented support for thread cancellation. Closes #5686.
* Moved send_signal() from <signal.h> to <OS.h>. Fixes #7554.
* Lots over smaller more or less related changes.


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


# 27a115f6 14-Dec-2010 Rene Gollent <anevilyak@gmail.com>

Revert r39846 and r39847.



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


# 7040b50d 13-Dec-2010 Rene Gollent <anevilyak@gmail.com>

Add support for thread rename and priority change notifications to the
debugger API/message set.



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


# a608485f 14-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Added new team flag B_TEAM_DEBUG_PREVENT_EXIT that prevents teams from exiting
via exit() (the calling thread will drop into the debugger instead).
* The DebugServer now uses this flag by default.
* Added TODO comment: the default debugger should already be able to set a flag
like this in order to close a race condition between dropping a thread into
the debugger and setting the flag.
* Cleaned up the debug_server sources a bit.


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


# 735be9db 22-Jul-2009 François Revol <revol@free.fr>

[GSoC] [ARM] Patch by Johannes Wischert.
Include ARM struct.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31698 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


# f664c647 14-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Updated comment to reality.


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


# fa8a3a17 03-May-2009 Jonas Sundström <jonas@kirilla.com>

Staking out some mipsel ground.

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


# e1975d33 23-Feb-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* When a team debugger is installed automatically, the thread causing that is
stored now.
* Extended the debugger message for B_DEBUGGER_MESSAGE_HANDED_OVER by the
causing thread.
* Also send B_DEBUGGER_MESSAGE_HANDED_OVER to the debugger to which the team
was handed over. The message will be the very first one the debugger gets
from the team in question.
* Some harmless refactoring (added thread_hit_serious_debug_event()).


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


# f965a969 28-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Extended the profiling API. When using the variable stack trace depth
buffer format, the buffer can now also contain other events than just
stack traces. ATM these are only references to the image events
(created/deleted). Therefore we no longer have to flush the profiling
buffer after such an event, since the debugger can exactly match the
samples. Since we couldn't flush when the profiling timer hit while the
thread was in the kernel, that wasn't working that well anyway.
"profile -f" fails to translate stack trace addresses only very rarely,
now.


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


# 0135e2e3 22-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Increased the maximum profiling caller stack depth significantly.
* Extended the profiling API by an option to record a variable number of
samples per tick. The stack depth is used as a maximum.
* Added new option "-f" to the "profile" tool. When specified it
increments the hit counts of all symbols in the full available caller
stack. I.e. the resulting hit counts will approximate the total time
spent in each function or any function directly or indirectly called
by it. Thus "_start" and "main" will usually get 100% and leaf
functions only what time has actually been spent in them.


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


# ecfad924 20-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Solution for the potential deadlock when needing to flush the profiling
buffer during a timer event that interrupted a kernel function: We do
now flush the buffer as soon as it is 70% full, *if* we didn't interrupt
a kernel function. When the buffer runs full and we still haven't hit a
user function, we drop the tick. The number of dropped ticks is recorded
and sent to the debugger with the next update message.
Reverted the previous partial solution (the temporary disabling of
profiling while in debugger support code).


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


# eba9a4c3 20-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduced a per-team counter that is incremented whenever an image
is created or deleted (or exec*() has been invoked). The counter is
sent with several debugger messages.
* Track the image event counter that is used when samples are added to
the profiling buffer. If the current team counter differs, we flush
the buffer first (sending an update message to the debugger), so that
the debugger has a chance to match the addresses to the correct images.
* Disable profiling for a thread while it runs in the debugger support
code. This fixes potential deadlocks which could occur when a
profiling timer event occurred that would require the buffer to be
flushed while the thread was just sending something to the debugger or
waiting for a command. As it turns out, this is not sufficient either,
since we should never try to flush the buffer when the timer event
occurred in the kernel, since the thread might hold a lock that the
debugger thread could try to acquire. Will implement a more general
solution later.


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


# 4ed8088f 20-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added new debugger message B_DEBUGGER_MESSAGE_TEAM_EXEC, sent when
exec*() has been called.


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


# 424f833b 19-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Changed the profiling API: Instead of sending all functions that shall
be tracked to the kernel, which then counts the hits, an area is
passed to kernel in which the hits are recorded. When the area is
full, the debugger is notified. For some reason that part doesn't work
yet -- the whole system freezes when waiting for a reply.
* Reorganized the profile tool code a bit. For one with respect to the
changed API, but also to prepare tracking of image creation/deletion.


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


# cbcebd33 15-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Extended the debugger API by sampling-based profiling support. This is
still pretty much work in progress.
* Introduced init_thread_debug_info() which is used instead of
clear_thread_debug_info() when the thread is created. The latter
requires former initialization.
* user_debug_thread_deleted() is now already invoked in thread_exit(),
not in the undertaker.


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


# ae8bc15a 23-Oct-2007 François Revol <revol@free.fr>

Some more of m68k. Added errors where ports should add stuff.


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


# 44b5d72b 20-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

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


# 7f9c6739 14-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduced a new debugger message B_DEBUGGER_MESSAGE_HANDED_OVER, which
is sent to a debugger when the debugged team has been successfully handed
over to another debugger.
* Fixed handling of B_DEBUG_MESSAGE_PREPARE_HANDOVER. We don't send a reply.


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


# d2c78559 25-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

We now also support partial writes to the debugged team's memory.

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


# 291e414a 13-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Somehow this B_DEBUGGER_MESSAGE_THREAD_STOPPED message bothered me.
Most of the debug events had their own message, but some were grouped
into this `stopped' message with a `why' field to describe what kind
of event it actually was. Hence the user had to check two levels until
they could know what event occurred. So I got rid of this message and
provided separate messages for the concerned events.
* Got rid of B_DEBUG_MESSAGE_GET_WHY_STOPPED and introduced
B_DEBUG_MESSAGE_GET_CPU_STATE which is pretty much the same.
* Put B_DEBUG_MESSAGE_RUN_THREAD and B_DEBUG_MESSAGE_STEP_THREAD into
a single B_DEBUG_MESSAGE_CONTINUE_THREAD message with a boolean
`single_step' field.
* get_debug_why_stopped_string() -> get_debug_message_string().


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


# 1619a2e5 12-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* The exceptions now have their own debugger message. Added
get_debug_exception_string() to get a user-readable string for an
exception type.
* Added more signal support. Now the debugger can set per thread which
signals it wishes to be notified of. It can also just ignore the next
occurrence of a signal.


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


# 1c7fbde1 10-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added message def for preparing to hand over a debugged team to another
debugger. After successful reply to the message the debugger won't receive
any more messages from the debugged team. The mechanism is completely
transparent to the target debugger. It simply installs itself as debugger
for the team.


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


# a29ecae5 09-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

New debug function wait_for_debugger(). Useful when creating teams to be debugged via fork().


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


# 9b92e8c0 09-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added missing reply port for message B_DEBUG_MESSAGE_GET_WHY_STOPPED. Removed unnecessary alignment in debug_nub_set_cpu_state.


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


# 7586a0f3 08-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Reading memory is more handy, if it allows for partial reads. So now the size is returned with the reply.


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


# 2b3216fc 01-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Correct terminology.


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


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

Added definitions for supporting single step, break- and watchpoints,
and setting the CPU state.


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


# 540103da 25-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* New function get_why_stopped_string() to get a human-readable
translation for the debug_why_stopped codes.
* Added nub_port member to debug_origin structure, so that now all
synchronous messages to the debugger also include the debug nub port.


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


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

Introduced a debug_origin structure consisting of thread and team ID of the concerned thread, and being first member of all messages sent to the debugger. This simplifies handling of messages in the debugger a good deal.


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


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

* Architecture specifics live in arch/<arch>/debugger.h now.
* team debug flags:
- Added flags for team creation, thread events (creation,
deletion), and image events (creation, deletion).
- Got rid of B_TEAM_DEBUG_SYSCALL_FAST_TRACE. We always send the syscall
arguments. The overhead should be neglectable.
- Added B_TEAM_DEBUG_STOP_NEW_THREADS.
* Added debugger notification messages for signals, team, thread and
image events.
* Added debug request B_DEBUG_MESSAGE_GET_WHY_STOPPED.
* When continuing a thread, the debugger can now specify how to deal with
the occurred event (ignore or handle).
* More data in the signal received notification message.


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


# c53b5002 09-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Trashed the old header and started a new one from the scratch.
Unless a good reason appears not to, we'll break binary compatibility here.
BDB could be considered one, but we need a replacement for it anyway. We
strive to port GDB and a couple of changes in the debugger API will make
that easier.


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


# eafe61c0 04-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Some formatting cleanup.
* Removed ARM support.
* Removed PEF references.
* Added structure and constants for pre syscall tracing.


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


# 25f83d02 14-Jan-2003 Axel Dörfler <axeld@pinc-software.de>

Added the debugger.h header file (for being able to link it from the web).


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


# 77ea49f4f2cb0e369fa27a5ca8870207e3046af6 28-Jun-2013 Rene Gollent <anevilyak@gmail.com>

Adjust debug API to address some x86-64 concerns.

- The argument buffer contained in the debug_{pre,post}_syscall message structures wasn't large enough to accomodate all
arguments for some syscalls on x86-64, which could potentially have led to kernel memory corruption when using syscall
tracing via the debug API. As such, enlarge it to accomodate 64-bit platforms as well.

- Adjust TeamDebugger/SyscallInfo to discriminate the target architecture and read the arguments when trapping console
output. Gets the latter working on x86-64.


# f76bc433e1582f4f5424cd5c95613cb247e15a98 13-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Added some x86_64 system/kernel headers and kernel Jamfiles.

* Not all of these headers are correct yet, just adding what's necessary
to get things to compile for the time being.


# 24df65921befcd0ad0c5c7866118f922da61cb96 11-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged signals-merge branch into trunk with the following changes:
* Reorganized the kernel locking related to threads and teams.
* We now discriminate correctly between process and thread signals. Signal
handlers have been moved to teams. Fixes #5679.
* Implemented real-time signal support, including signal queuing, SA_SIGINFO
support, sigqueue(), sigwaitinfo(), sigtimedwait(), waitid(), and the addition
of the real-time signal range. Closes #1935 and #2695.
* Gave SIGBUS a separate signal number. Fixes #6704.
* Implemented <time.h> clock and timer support, and fixed/completed alarm() and
[set]itimer(). Closes #5682.
* Implemented support for thread cancellation. Closes #5686.
* Moved send_signal() from <signal.h> to <OS.h>. Fixes #7554.
* Lots over smaller more or less related changes.


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


# 27a115f6685cc7821dd2ab6d528d6f3abe70158d 14-Dec-2010 Rene Gollent <anevilyak@gmail.com>

Revert r39846 and r39847.



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


# 7040b50df5e1483f3e982d5b7ef7c7f79a898b93 13-Dec-2010 Rene Gollent <anevilyak@gmail.com>

Add support for thread rename and priority change notifications to the
debugger API/message set.



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


# a608485f26d1e806f7e4d595a8a6eeafad36bd43 14-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Added new team flag B_TEAM_DEBUG_PREVENT_EXIT that prevents teams from exiting
via exit() (the calling thread will drop into the debugger instead).
* The DebugServer now uses this flag by default.
* Added TODO comment: the default debugger should already be able to set a flag
like this in order to close a race condition between dropping a thread into
the debugger and setting the flag.
* Cleaned up the debug_server sources a bit.


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


# 735be9db97d1e670ced139c1771e0f3f0dbc0cbd 22-Jul-2009 François Revol <revol@free.fr>

[GSoC] [ARM] Patch by Johannes Wischert.
Include ARM struct.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31698 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


# f664c6474b926f684ef766152d70658e4e9cf13d 14-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Updated comment to reality.


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


# fa8a3a17c61be0127541df7f546efe67ec927b4c 03-May-2009 Jonas Sundström <jonas@kirilla.com>

Staking out some mipsel ground.

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


# e1975d335369d3bec6473cc1323c65a00e8dc25c 23-Feb-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* When a team debugger is installed automatically, the thread causing that is
stored now.
* Extended the debugger message for B_DEBUGGER_MESSAGE_HANDED_OVER by the
causing thread.
* Also send B_DEBUGGER_MESSAGE_HANDED_OVER to the debugger to which the team
was handed over. The message will be the very first one the debugger gets
from the team in question.
* Some harmless refactoring (added thread_hit_serious_debug_event()).


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


# f965a969b17376e47d9d2948ba4a5cfce2a785d0 28-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Extended the profiling API. When using the variable stack trace depth
buffer format, the buffer can now also contain other events than just
stack traces. ATM these are only references to the image events
(created/deleted). Therefore we no longer have to flush the profiling
buffer after such an event, since the debugger can exactly match the
samples. Since we couldn't flush when the profiling timer hit while the
thread was in the kernel, that wasn't working that well anyway.
"profile -f" fails to translate stack trace addresses only very rarely,
now.


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


# 0135e2e3242021dd407037b1974bb7e221d5255b 22-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Increased the maximum profiling caller stack depth significantly.
* Extended the profiling API by an option to record a variable number of
samples per tick. The stack depth is used as a maximum.
* Added new option "-f" to the "profile" tool. When specified it
increments the hit counts of all symbols in the full available caller
stack. I.e. the resulting hit counts will approximate the total time
spent in each function or any function directly or indirectly called
by it. Thus "_start" and "main" will usually get 100% and leaf
functions only what time has actually been spent in them.


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


# ecfad924e044a187d0ac9fc4561b45b285e7f8c5 20-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Solution for the potential deadlock when needing to flush the profiling
buffer during a timer event that interrupted a kernel function: We do
now flush the buffer as soon as it is 70% full, *if* we didn't interrupt
a kernel function. When the buffer runs full and we still haven't hit a
user function, we drop the tick. The number of dropped ticks is recorded
and sent to the debugger with the next update message.
Reverted the previous partial solution (the temporary disabling of
profiling while in debugger support code).


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


# eba9a4c3ee6e7cb89df681a845fb1eaf581fe38e 20-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduced a per-team counter that is incremented whenever an image
is created or deleted (or exec*() has been invoked). The counter is
sent with several debugger messages.
* Track the image event counter that is used when samples are added to
the profiling buffer. If the current team counter differs, we flush
the buffer first (sending an update message to the debugger), so that
the debugger has a chance to match the addresses to the correct images.
* Disable profiling for a thread while it runs in the debugger support
code. This fixes potential deadlocks which could occur when a
profiling timer event occurred that would require the buffer to be
flushed while the thread was just sending something to the debugger or
waiting for a command. As it turns out, this is not sufficient either,
since we should never try to flush the buffer when the timer event
occurred in the kernel, since the thread might hold a lock that the
debugger thread could try to acquire. Will implement a more general
solution later.


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


# 4ed8088f9a98fa69526c08721087a942becc7545 20-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added new debugger message B_DEBUGGER_MESSAGE_TEAM_EXEC, sent when
exec*() has been called.


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


# 424f833bc9646c8d5a317485c96f4371fa3a7636 19-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Changed the profiling API: Instead of sending all functions that shall
be tracked to the kernel, which then counts the hits, an area is
passed to kernel in which the hits are recorded. When the area is
full, the debugger is notified. For some reason that part doesn't work
yet -- the whole system freezes when waiting for a reply.
* Reorganized the profile tool code a bit. For one with respect to the
changed API, but also to prepare tracking of image creation/deletion.


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


# cbcebd3330d8701dd854e5958a28bf7e1af50df4 15-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Extended the debugger API by sampling-based profiling support. This is
still pretty much work in progress.
* Introduced init_thread_debug_info() which is used instead of
clear_thread_debug_info() when the thread is created. The latter
requires former initialization.
* user_debug_thread_deleted() is now already invoked in thread_exit(),
not in the undertaker.


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


# ae8bc15af543676a2929d736ee9550ee70af6df5 23-Oct-2007 François Revol <revol@free.fr>

Some more of m68k. Added errors where ports should add stuff.


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


# 44b5d72b5aeb8bba2c348c27022e7cfe1c96f456 20-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

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


# 7f9c6739815508d8473701fc51add7550c816d1d 14-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduced a new debugger message B_DEBUGGER_MESSAGE_HANDED_OVER, which
is sent to a debugger when the debugged team has been successfully handed
over to another debugger.
* Fixed handling of B_DEBUG_MESSAGE_PREPARE_HANDOVER. We don't send a reply.


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


# d2c78559a0585ed5e623e2e7767b4d3ea3e7bdb6 25-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

We now also support partial writes to the debugged team's memory.

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


# 291e414a9e8a07535a7f50ce7de790ac31cd64cc 13-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Somehow this B_DEBUGGER_MESSAGE_THREAD_STOPPED message bothered me.
Most of the debug events had their own message, but some were grouped
into this `stopped' message with a `why' field to describe what kind
of event it actually was. Hence the user had to check two levels until
they could know what event occurred. So I got rid of this message and
provided separate messages for the concerned events.
* Got rid of B_DEBUG_MESSAGE_GET_WHY_STOPPED and introduced
B_DEBUG_MESSAGE_GET_CPU_STATE which is pretty much the same.
* Put B_DEBUG_MESSAGE_RUN_THREAD and B_DEBUG_MESSAGE_STEP_THREAD into
a single B_DEBUG_MESSAGE_CONTINUE_THREAD message with a boolean
`single_step' field.
* get_debug_why_stopped_string() -> get_debug_message_string().


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


# 1619a2e5b4536c5a512e8ade84aaffdd24ab9d33 12-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* The exceptions now have their own debugger message. Added
get_debug_exception_string() to get a user-readable string for an
exception type.
* Added more signal support. Now the debugger can set per thread which
signals it wishes to be notified of. It can also just ignore the next
occurrence of a signal.


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


# 1c7fbde145c1d6cd9248ee64b4fd2b84e1c9f038 10-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added message def for preparing to hand over a debugged team to another
debugger. After successful reply to the message the debugger won't receive
any more messages from the debugged team. The mechanism is completely
transparent to the target debugger. It simply installs itself as debugger
for the team.


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


# a29ecae5f03286c0ca0942e5d50540e24472f57f 09-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

New debug function wait_for_debugger(). Useful when creating teams to be debugged via fork().


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


# 9b92e8c0114295f72aa34b849d700226e5aad509 09-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added missing reply port for message B_DEBUG_MESSAGE_GET_WHY_STOPPED. Removed unnecessary alignment in debug_nub_set_cpu_state.


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


# 7586a0f3d681cc7ccc51b07dadccb6e30739cbe7 08-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Reading memory is more handy, if it allows for partial reads. So now the size is returned with the reply.


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


# 2b3216fc5a6837ecd61e428129adb524a06320f5 01-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Correct terminology.


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


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

Added definitions for supporting single step, break- and watchpoints,
and setting the CPU state.


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


# 540103da09d811dbbe64d65091c99fb6aa11bdd3 25-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* New function get_why_stopped_string() to get a human-readable
translation for the debug_why_stopped codes.
* Added nub_port member to debug_origin structure, so that now all
synchronous messages to the debugger also include the debug nub port.


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


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

Introduced a debug_origin structure consisting of thread and team ID of the concerned thread, and being first member of all messages sent to the debugger. This simplifies handling of messages in the debugger a good deal.


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


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

* Architecture specifics live in arch/<arch>/debugger.h now.
* team debug flags:
- Added flags for team creation, thread events (creation,
deletion), and image events (creation, deletion).
- Got rid of B_TEAM_DEBUG_SYSCALL_FAST_TRACE. We always send the syscall
arguments. The overhead should be neglectable.
- Added B_TEAM_DEBUG_STOP_NEW_THREADS.
* Added debugger notification messages for signals, team, thread and
image events.
* Added debug request B_DEBUG_MESSAGE_GET_WHY_STOPPED.
* When continuing a thread, the debugger can now specify how to deal with
the occurred event (ignore or handle).
* More data in the signal received notification message.


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


# c53b50023aad08138249e884287276f26379431c 09-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Trashed the old header and started a new one from the scratch.
Unless a good reason appears not to, we'll break binary compatibility here.
BDB could be considered one, but we need a replacement for it anyway. We
strive to port GDB and a couple of changes in the debugger API will make
that easier.


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


# eafe61c06bc45ed2217891ec3cae5d48172f1e74 04-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Some formatting cleanup.
* Removed ARM support.
* Removed PEF references.
* Added structure and constants for pre syscall tracing.


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


# 25f83d020299cd361a68a2984b4fab49f9160526 14-Jan-2003 Axel Dörfler <axeld@pinc-software.de>

Added the debugger.h header file (for being able to link it from the web).


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