From e7baaab3ae94cb2413c5369173f4fa0fb8588aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 21 Oct 2009 17:08:52 +0000 Subject: [PATCH] * "sc" and "call" will no longer ignore if they couldn't find the thread you asked them for. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33709 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/arch/x86/arch_debug.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/system/kernel/arch/x86/arch_debug.cpp b/src/system/kernel/arch/x86/arch_debug.cpp index b26373d047..5cde4e7b42 100644 --- a/src/system/kernel/arch/x86/arch_debug.cpp +++ b/src/system/kernel/arch/x86/arch_debug.cpp @@ -330,7 +330,7 @@ print_iframe(struct iframe *frame) } -static void +static bool setup_for_thread(char *arg, struct thread **_thread, uint32 *_ebp, uint32 *_oldPageDirectory) { @@ -341,7 +341,7 @@ setup_for_thread(char *arg, struct thread **_thread, uint32 *_ebp, thread = thread_get_thread_struct_locked(id); if (thread == NULL) { kprintf("could not find thread %ld\n", id); - return; + return false; } if (id != thread_get_current_thread_id()) { @@ -368,6 +368,7 @@ setup_for_thread(char *arg, struct thread **_thread, uint32 *_ebp, } *_thread = thread; + return true; } @@ -541,8 +542,9 @@ stack_trace(int argc, char **argv) uint32 ebp = x86_read_ebp(); int32 num = 0, last = 0; - setup_for_thread(argc == threadIndex + 1 ? argv[threadIndex] : NULL, - &thread, &ebp, &oldPageDirectory); + if (!setup_for_thread(argc == threadIndex + 1 ? argv[threadIndex] : NULL, + &thread, &ebp, &oldPageDirectory)) + return 0; if (thread != NULL) { kprintf("stack trace for thread %ld \"%s\"\n", thread->id, @@ -712,8 +714,9 @@ show_call(int argc, char **argv) return 0; } - setup_for_thread(argc == 3 ? argv[1] : NULL, &thread, &ebp, - &oldPageDirectory); + if (!setup_for_thread(argc == 3 ? argv[1] : NULL, &thread, &ebp, + &oldPageDirectory)) + return 0; int32 callIndex = strtoul(argv[argc == 3 ? 2 : 1], NULL, 0);