Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 May 2012 13:33:27 +0000 (UTC)
From:      Grzegorz Bernacki <gber@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r236308 - head/sys/arm/arm
Message-ID:  <201205301333.q4UDXR4e054145@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gber
Date: Wed May 30 13:33:27 2012
New Revision: 236308
URL: http://svn.freebsd.org/changeset/base/236308

Log:
  Print userspace backtrace for current thread.
  
  Reviewed by:	imp
  Obtained from:	Semihalf

Modified:
  head/sys/arm/arm/db_trace.c

Modified: head/sys/arm/arm/db_trace.c
==============================================================================
--- head/sys/arm/arm/db_trace.c	Wed May 30 13:31:08 2012	(r236307)
+++ head/sys/arm/arm/db_trace.c	Wed May 30 13:33:27 2012	(r236308)
@@ -79,14 +79,13 @@ __FBSDID("$FreeBSD$");
  */
 
 static void
-db_stack_trace_cmd(db_expr_t addr, db_expr_t count)
+db_stack_trace_cmd(db_expr_t addr, db_expr_t count, boolean_t kernel_only)
 {
 	u_int32_t	*frame, *lastframe;
 	c_db_sym_t sym;
 	const char *name;
 	db_expr_t value;
 	db_expr_t offset;
-	boolean_t	kernel_only = TRUE;
 	int	scp_offset;
 
 	frame = (u_int32_t *)addr;
@@ -196,8 +195,11 @@ db_trace_thread(struct thread *thr, int 
 {
 	struct pcb *ctx;
 
-	ctx = kdb_thr_ctx(thr);
-	db_stack_trace_cmd(ctx->un_32.pcb32_r11, -1);
+	if (thr != curthread) {
+		ctx = kdb_thr_ctx(thr);
+		db_stack_trace_cmd(ctx->un_32.pcb32_r11, -1, TRUE);
+	} else
+		db_trace_self();
 	return (0);
 }
 
@@ -207,5 +209,5 @@ db_trace_self(void)
 	db_addr_t addr;
 
 	addr = (db_addr_t)__builtin_frame_address(0);
-	db_stack_trace_cmd(addr, -1);
+	db_stack_trace_cmd(addr, -1, FALSE);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205301333.q4UDXR4e054145>