summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-09-13 01:36:34 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-09-13 01:36:34 +0200
commit729cea1e1e45c0c9eb546b32edc4ad005f50a8b4 (patch)
treebf85952cdbcd58c574eb45d5d7643deff0614486 /debian
parent21d2ab2e91dbff3db188f5c380069efe9c502cde (diff)
add patch series
Diffstat (limited to 'debian')
-rw-r--r--debian/patches/0001-ddb-add-show-all-tasks-command.patch81
-rw-r--r--debian/patches/0002-ddb-add-db_check_task_address_valid.patch52
-rw-r--r--debian/patches/0003-ddb-add-kill-command.patch73
-rw-r--r--debian/patches/series3
4 files changed, 209 insertions, 0 deletions
diff --git a/debian/patches/0001-ddb-add-show-all-tasks-command.patch b/debian/patches/0001-ddb-add-show-all-tasks-command.patch
new file mode 100644
index 0000000..664650f
--- /dev/null
+++ b/debian/patches/0001-ddb-add-show-all-tasks-command.patch
@@ -0,0 +1,81 @@
+From 3e88c845b57c03e0cc115b6fd6624e0b66ad4c4c Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Sat, 13 Sep 2014 00:41:11 +0200
+Subject: [PATCH 1/3] ddb: add `show all tasks' command
+
+* ddb/db_command.c (db_show_all_cmds): Add `tasks'.
+* ddb/db_print.c (db_show_all_tasks): New function.
+* ddb/db_print.h (db_show_all_tasks): New prototype.
+---
+ ddb/db_command.c | 1 +
+ ddb/db_print.c | 24 ++++++++++++++++++++++++
+ ddb/db_print.h | 6 ++++++
+ 3 files changed, 31 insertions(+)
+
+diff --git a/ddb/db_command.c b/ddb/db_command.c
+index 8171119..5651667 100644
+--- a/ddb/db_command.c
++++ b/ddb/db_command.c
+@@ -304,6 +304,7 @@ db_command_list(
+ }
+
+ struct db_command db_show_all_cmds[] = {
++ { "tasks", db_show_all_tasks, 0, 0 },
+ { "threads", db_show_all_threads, 0, 0 },
+ { "slocks", db_show_all_slocks, 0, 0 },
+ { (char *)0 }
+diff --git a/ddb/db_print.c b/ddb/db_print.c
+index e711ab6..24a3e33 100644
+--- a/ddb/db_print.c
++++ b/ddb/db_print.c
+@@ -276,6 +276,30 @@ db_print_task(
+ }
+ }
+
++void
++db_show_all_tasks(db_expr_t addr,
++ boolean_t have_addr,
++ db_expr_t count,
++ const char *modif)
++{
++ task_t task;
++ int task_id = 0;
++ processor_set_t pset;
++
++ db_printf(" ID %-*s NAME [THREADS]\n", 2*sizeof(vm_offset_t), "TASK");
++
++ queue_iterate(&all_psets, pset, processor_set_t, all_psets)
++ queue_iterate(&pset->tasks, task, task_t, pset_tasks) {
++ db_printf("%3d %0*X %s [%d]\n",
++ task_id,
++ 2*sizeof(vm_offset_t),
++ task,
++ task->name,
++ task->thread_count);
++ task_id++;
++ }
++}
++
+ /*ARGSUSED*/
+ void
+ db_show_all_threads(addr, have_addr, count, modif)
+diff --git a/ddb/db_print.h b/ddb/db_print.h
+index dacb47b..87db97b 100644
+--- a/ddb/db_print.h
++++ b/ddb/db_print.h
+@@ -38,6 +38,12 @@ void db_show_one_thread(
+ db_expr_t count,
+ const char * modif);
+
++void db_show_all_tasks(
++ db_expr_t addr,
++ int have_addr,
++ db_expr_t count,
++ const char * modif);
++
+ void db_show_all_threads(
+ db_expr_t addr,
+ int have_addr,
+--
+2.1.0
+
diff --git a/debian/patches/0002-ddb-add-db_check_task_address_valid.patch b/debian/patches/0002-ddb-add-db_check_task_address_valid.patch
new file mode 100644
index 0000000..af9fcc2
--- /dev/null
+++ b/debian/patches/0002-ddb-add-db_check_task_address_valid.patch
@@ -0,0 +1,52 @@
+From b13ae86ed0df158d2d4fed826ced5472bf104543 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Sat, 13 Sep 2014 01:27:46 +0200
+Subject: [PATCH 2/3] ddb: add db_check_task_address_valid
+
+* ddb/db_task_thread.c (db_check_task_address_valid): New function.
+* ddb/db_task_thread.h (db_check_task_address_valid): New declaration.
+---
+ ddb/db_task_thread.c | 14 ++++++++++++++
+ ddb/db_task_thread.h | 1 +
+ 2 files changed, 15 insertions(+)
+
+diff --git a/ddb/db_task_thread.c b/ddb/db_task_thread.c
+index edab17e..97c81c8 100644
+--- a/ddb/db_task_thread.c
++++ b/ddb/db_task_thread.c
+@@ -135,6 +135,20 @@ db_lookup_thread(target_thread)
+ }
+
+ /*
++ * check the address is a valid task address
++ */
++boolean_t
++db_check_task_address_valid(const task_t task)
++{
++ if (db_lookup_task(task) < 0) {
++ db_printf("Bad task address 0x%x\n", task);
++ db_flush_lex();
++ return(FALSE);
++ } else
++ return(TRUE);
++}
++
++/*
+ * check the address is a valid thread address
+ */
+ boolean_t
+diff --git a/ddb/db_task_thread.h b/ddb/db_task_thread.h
+index cbb3680..18f1957 100644
+--- a/ddb/db_task_thread.h
++++ b/ddb/db_task_thread.h
+@@ -46,6 +46,7 @@ extern thread_t db_default_thread; /* default target thread */
+ extern int db_lookup_task(const task_t);
+ extern int db_lookup_thread(const thread_t);
+ extern int db_lookup_task_thread(const task_t, const thread_t);
++extern boolean_t db_check_task_address_valid(const task_t);
+ extern boolean_t db_check_thread_address_valid(const thread_t);
+ extern boolean_t db_get_next_thread(thread_t *, int);
+ extern void db_init_default_thread(void);
+--
+2.1.0
+
diff --git a/debian/patches/0003-ddb-add-kill-command.patch b/debian/patches/0003-ddb-add-kill-command.patch
new file mode 100644
index 0000000..93a9813
--- /dev/null
+++ b/debian/patches/0003-ddb-add-kill-command.patch
@@ -0,0 +1,73 @@
+From 29fa60bd23ed84a470c7ebc7e0b031c136f3cf33 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Sat, 13 Sep 2014 01:32:13 +0200
+Subject: [PATCH 3/3] ddb: add `kill' command
+
+* ddb/db_command.c (db_command_table): Add a `kill' command to
+terminate tasks.
+* ddb/db_task_thread.c (db_task_terminate): New function.
+* ddb/db_task_thread.h (db_task_terminate): New declaration.
+---
+ ddb/db_command.c | 1 +
+ ddb/db_task_thread.c | 18 ++++++++++++++++++
+ ddb/db_task_thread.h | 7 +++++++
+ 3 files changed, 26 insertions(+)
+
+diff --git a/ddb/db_command.c b/ddb/db_command.c
+index 5651667..74f191b 100644
+--- a/ddb/db_command.c
++++ b/ddb/db_command.c
+@@ -362,6 +362,7 @@ struct db_command db_command_table[] = {
+ { "macro", db_def_macro_cmd, CS_OWN, 0 },
+ { "dmacro", db_del_macro_cmd, CS_OWN, 0 },
+ { "show", 0, 0, db_show_cmds },
++ { "kill", db_task_terminate, 0, 0 },
+ { "reset", db_reset_cpu, 0, 0 },
+ { "reboot", db_reset_cpu, 0, 0 },
+ { "halt", db_halt_cpu, 0, 0 },
+diff --git a/ddb/db_task_thread.c b/ddb/db_task_thread.c
+index 97c81c8..5309d73 100644
+--- a/ddb/db_task_thread.c
++++ b/ddb/db_task_thread.c
+@@ -317,4 +317,22 @@ db_get_task_thread(
+ return;
+ }
+
++/* ARGSUSED */
++void
++db_task_terminate(db_expr_t addr,
++ boolean_t have_addr,
++ db_expr_t count,
++ const char *modif)
++{
++ task_t task = (task_t) addr;
++
++ if (! have_addr)
++ db_error("No task\n");
++
++ if (! db_check_task_address_valid(task))
++ db_error(0);
++
++ task_terminate(task);
++}
++
+ #endif /* MACH_KDB */
+diff --git a/ddb/db_task_thread.h b/ddb/db_task_thread.h
+index 18f1957..c095aac 100644
+--- a/ddb/db_task_thread.h
++++ b/ddb/db_task_thread.h
+@@ -65,4 +65,11 @@ db_get_task_thread(
+ int flag,
+ db_var_aux_param_t ap);
+
++extern void
++db_task_terminate(
++ db_expr_t addr,
++ boolean_t have_addr,
++ db_expr_t count,
++ const char *modif);
++
+ #endif /* _DDB_DB_TASK_THREAD_H_ */
+--
+2.1.0
+
diff --git a/debian/patches/series b/debian/patches/series
index 14fccb4..35ec82b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,6 @@
protected_payload.patch
Add-some-padding-to-make-objects-fit-a-single-cache-.patch
+0001-ddb-add-show-all-tasks-command.patch
+0002-ddb-add-db_check_task_address_valid.patch
+0003-ddb-add-kill-command.patch