Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Apr 2012 21:34:58 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r234196 - in head/sys: ddb gdb
Message-ID:  <201204122134.q3CLYwrN046736@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu Apr 12 21:34:58 2012
New Revision: 234196
URL: http://svn.freebsd.org/changeset/base/234196

Log:
  Update the ddb and gdb backends for the new 'trace_thread' hook.
  It is implemented via db_trace_thread() for DDB and not implemented
  for GDB.  This should have been part of r234190.
  
  Pointy hat to:	jhb
  Reported by:	jkim
  MFC after:	1 week

Modified:
  head/sys/ddb/db_main.c
  head/sys/gdb/gdb_main.c

Modified: head/sys/ddb/db_main.c
==============================================================================
--- head/sys/ddb/db_main.c	Thu Apr 12 20:22:17 2012	(r234195)
+++ head/sys/ddb/db_main.c	Thu Apr 12 21:34:58 2012	(r234196)
@@ -51,8 +51,10 @@ SYSCTL_NODE(_debug, OID_AUTO, ddb, CTLFL
 static dbbe_init_f db_init;
 static dbbe_trap_f db_trap;
 static dbbe_trace_f db_trace_self_wrapper;
+static dbbe_trace_thread_f db_trace_thread_wrapper;
 
-KDB_BACKEND(ddb, db_init, db_trace_self_wrapper, db_trap);
+KDB_BACKEND(ddb, db_init, db_trace_self_wrapper, db_trace_thread_wrapper,
+    db_trap);
 
 vm_offset_t ksym_start, ksym_end;
 
@@ -246,3 +248,15 @@ db_trace_self_wrapper(void)
 		db_trace_self();
 	(void)kdb_jmpbuf(prev_jb);
 }
+
+static void
+db_trace_thread_wrapper(struct thread *td)
+{
+	jmp_buf jb;
+	void *prev_jb;
+
+	prev_jb = kdb_jmpbuf(jb);
+	if (setjmp(jb) == 0)
+		db_trace_thread(td, -1);
+	(void)kdb_jmpbuf(prev_jb);
+}

Modified: head/sys/gdb/gdb_main.c
==============================================================================
--- head/sys/gdb/gdb_main.c	Thu Apr 12 20:22:17 2012	(r234195)
+++ head/sys/gdb/gdb_main.c	Thu Apr 12 21:34:58 2012	(r234196)
@@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$");
 static dbbe_init_f gdb_init;
 static dbbe_trap_f gdb_trap;
 
-KDB_BACKEND(gdb, gdb_init, NULL, gdb_trap);
+KDB_BACKEND(gdb, gdb_init, NULL, NULL, gdb_trap);
 
 static struct gdb_dbgport null_gdb_dbgport;
 DATA_SET(gdb_dbgport_set, null_gdb_dbgport);



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