From owner-svn-src-all@FreeBSD.ORG Wed May 30 13:33:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E2A4106567C; Wed, 30 May 2012 13:33:27 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8973B8FC1B; Wed, 30 May 2012 13:33:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4UDXR8W054147; Wed, 30 May 2012 13:33:27 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4UDXR4e054145; Wed, 30 May 2012 13:33:27 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201205301333.q4UDXR4e054145@svn.freebsd.org> From: Grzegorz Bernacki Date: Wed, 30 May 2012 13:33:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236308 - head/sys/arm/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 May 2012 13:33:27 -0000 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); }