lkml.org 
[lkml]   [2003]   [Jun]   [24]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH][v850] show_stack changes for v850
DateTue, 24 Jun 2003 14:27:17 +0900 (JST)
From(Miles Bader)
diff -ruN -X../cludes linux-2.5.73-moo/arch/v850/kernel/bug.c linux-2.5.73-moo-v850-20030624/arch/v850/kernel/bug.c
--- linux-2.5.73-moo/arch/v850/kernel/bug.c	2003-02-25 10:44:59.000000000 +0900
+++ linux-2.5.73-moo-v850-20030624/arch/v850/kernel/bug.c	2003-06-23 15:16:50.000000000 +0900
@@ -17,6 +17,7 @@
 
 #include <asm/errno.h>
 #include <asm/ptrace.h>
+#include <asm/processor.h>
 #include <asm/current.h>
 
 /* We should use __builtin_return_address, but it doesn't work in gcc-2.90
@@ -100,12 +101,21 @@
 	}
 }
 
-void show_stack (unsigned long *sp)
-{
-	unsigned long end;
-	unsigned long addr = (unsigned long)sp;
-
-	if (! addr)
+/*
+ * TASK is a pointer to the task whose backtrace we want to see (or NULL
+ * for current task), SP is the stack pointer of the first frame that
+ * should be shown in the back trace (or NULL if the entire call-chain of
+ * the task should be shown).
+ */
+void show_stack (struct task_struct *task, unsigned long *sp)
+{
+	unsigned long addr, end;
+
+	if (sp)
+		addr = (unsigned long)sp;
+	else if (task)
+		addr = task_sp (task);
+	else
 		addr = stack_addr ();
 
 	addr = addr & ~3;
@@ -125,5 +135,5 @@
 
 void dump_stack ()
 {
-	show_stack (0);
+	show_stack (0, 0);
 }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 12:36    [from the cache]
©2003-2008