kernel/debug: Report killing signals

Adds a `signal` field to the `team_deleted` event. Since killing
signals like `SIGKILL` and `SIGKILLTHR` do not generate a
`signal_received` event, debuggers would only see a `team_deleted`
message with the `status` field set to 0. This makes debuggers like
GDB think that the debuggee has exited with a status code of 0.

To correctly report these signals, when a killing signal is sent
to a team, this signal is relayed to the main thread instead of
defaulting to just a `SIGKILLTHR` for both cases.

Change-Id: If69c9e2e4d87bfbd31f654f5cb6f696ac69ef777
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7756
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Trung Nguyen
2024-06-20 17:11:58 +00:00
committed by waddlesplash
parent 9e2c51c22f
commit f3cb51a85a
5 changed files with 17 additions and 5 deletions
+1
View File
@@ -561,6 +561,7 @@ typedef struct {
debug_origin origin; // thread is < 0, team is the deleted team
// (asynchronous message)
status_t status; // the exit code of the team
int signal; // the signal causing the exit, < 0 if none
team_usage_info usage; // the usage info of the team
} debug_team_deleted;