kernel/debug: Report team/thread exit status

Add a field to `debug_[team/thread]_deleted` to report the exit status
on the corresponding events.

This is useful for debuggers like GDB expecting a return value when one
of their inferiors quit.

Also add a `usage` field to `debug_team_deleted` since this is another
potentially useful piece of information exposed by the `waitpid` family
of syscalls.

Change-Id: Ieff7c31f56b1b9f8f709725d19050273b21f2504
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7736
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Trung Nguyen
2024-06-10 16:31:38 +00:00
committed by waddlesplash
parent 7a5148b345
commit 9631ca7349
5 changed files with 26 additions and 6 deletions
+3
View File
@@ -560,6 +560,8 @@ typedef struct {
typedef struct {
debug_origin origin; // thread is < 0, team is the deleted team
// (asynchronous message)
status_t status; // the exit code of the team
team_usage_info usage; // the usage info of the team
} debug_team_deleted;
// B_DEBUGGER_MESSAGE_TEAM_EXEC
@@ -580,6 +582,7 @@ typedef struct {
typedef struct {
debug_origin origin; // the deleted thread (asynchronous message)
status_t status; // the exit code of the thread
} debug_thread_deleted;
// B_DEBUGGER_MESSAGE_IMAGE_CREATED