commit a2d2b955690c33d07142bcf0a1f1d8f73a338e48
parent 709c5f44f7d828d549387d944186309923fcf6ff
Author: Brian Swetland <swetland@frotz.net>
Date:   Thu,  9 Jul 2015 16:34:13 -0700
debugger: threads command to dump lk threads
Diffstat:
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/tools/debugger-commands.c b/tools/debugger-commands.c
@@ -760,6 +760,18 @@ int do_maskints(int argc, param *argv) {
 	return 0;
 }
 
+typedef struct lkthread lkthread_t;
+lkthread_t *find_lk_threads(int verbose);
+void dump_lk_threads(lkthread_t *t);
+void free_lk_threads(lkthread_t *t);
+
+int do_threads(int argc, param *argv) {
+	lkthread_t *t = find_lk_threads(1);
+	dump_lk_threads(t);
+	free_lk_threads(t);
+	return 0;
+}
+
 struct debugger_command debugger_commands[] = {
 	{ "exit",	"", do_exit,		"" },
 	{ "attach",	"", do_attach,		"attach/reattach to sw-dp" },
@@ -788,6 +800,7 @@ struct debugger_command debugger_commands[] = {
 	{ "bootloader", "", do_bootloader,	"reboot into bootloader" },
 	{ "setclock",	"", do_setclock,	"set clock rate (khz)" },
 	{ "arch",	"", do_setarch,		"set architecture for flash agent" },
+	{ "threads",	"", do_threads,		"thread dump" },
 	{ "text",	"", do_text,		"dump text" },
 	{ "help",	"", do_help,		"help" },
 	{ 0, 0, 0, 0 },