diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-09-29 09:36:05 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-09-29 09:36:05 +0000 |
commit | a9d8f8818f51b039333984dd38e42a3078efc5b0 (patch) | |
tree | 6bb7e1b8aecf5abae7237a84f723a08eabbdb5c3 /sys/ddb | |
parent | eb58ac5b3ac3fb526c35c7455e27e6463949add8 (diff) |
New ddb(4) command: kill.
Send an uncatchable SIGABRT to the process specified by the pid
argument. Useful in case of CPU exhaustion to kill the DoSing
process and generate a core for later inspection.
ok phessler@, visa@, kettenis@, miod@
Diffstat (limited to 'sys/ddb')
-rw-r--r-- | sys/ddb/db_command.c | 3 | ||||
-rw-r--r-- | sys/ddb/db_interface.h | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index 0cf09c4c878..7ab47548594 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_command.c,v 1.77 2017/09/12 08:23:42 mpi Exp $ */ +/* $OpenBSD: db_command.c,v 1.78 2017/09/29 09:36:04 mpi Exp $ */ /* $NetBSD: db_command.c,v 1.20 1996/03/30 22:30:05 christos Exp $ */ /* @@ -612,6 +612,7 @@ struct db_command db_command_table[] = { /* this must be the first entry, if it exists */ { "machine", NULL, 0, NULL}, #endif + { "kill", db_kill_cmd, 0, NULL }, { "print", db_print_cmd, 0, NULL }, { "p", db_print_cmd, 0, NULL }, { "pprint", db_ctf_pprint_cmd, CS_OWN, NULL }, diff --git a/sys/ddb/db_interface.h b/sys/ddb/db_interface.h index 9ae9d20024c..11d0409dd77 100644 --- a/sys/ddb/db_interface.h +++ b/sys/ddb/db_interface.h @@ -1,4 +1,4 @@ -/* $OpenBSD: db_interface.h,v 1.19 2017/01/09 17:58:44 mpi Exp $ */ +/* $OpenBSD: db_interface.h,v 1.20 2017/09/29 09:36:04 mpi Exp $ */ /* $NetBSD: db_interface.h,v 1.1 1996/02/05 01:57:03 christos Exp $ */ /* @@ -40,6 +40,7 @@ void db_stack_trace_print(db_expr_t, int, db_expr_t, char *, db_addr_t db_disasm(db_addr_t, boolean_t); /* kern/kern_proc.c */ +void db_kill_cmd(db_expr_t, int, db_expr_t, char *); void db_show_all_procs(db_expr_t, int, db_expr_t, char *); /* kern/kern_timeout.c */ |