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
+3 -2
View File
@@ -258,11 +258,12 @@ bool user_debug_handle_signal(int signal, struct sigaction *handler,
siginfo_t *info, bool deadly);
void user_debug_stop_thread();
void user_debug_team_created(team_id teamID);
void user_debug_team_deleted(team_id teamID, port_id debuggerPort);
void user_debug_team_deleted(team_id teamID, port_id debuggerPort, status_t status,
team_usage_info* usageInfo);
void user_debug_team_exec();
void user_debug_update_new_thread_flags(Thread* thread);
void user_debug_thread_created(thread_id threadID);
void user_debug_thread_deleted(team_id teamID, thread_id threadID);
void user_debug_thread_deleted(team_id teamID, thread_id threadID, status_t status);
void user_debug_thread_exiting(Thread* thread);
void user_debug_image_created(const image_info *imageInfo);
void user_debug_image_deleted(const image_info *imageInfo);