Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Nov 2017 12:53:55 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326314 - in head/sys: ddb kern sys
Message-ID:  <201711281253.vASCrtlB071488@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Tue Nov 28 12:53:55 2017
New Revision: 326314
URL: https://svnweb.freebsd.org/changeset/base/326314

Log:
  Make kdb_reenter() silent when explicitly called from db_error().
  This removes the useless backtrace on various ddb(4) user errors.
  
  Reviewed by:	jhb@
  Obtained from:	CheriBSD
  MFC after:	2 weeks
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D13212

Modified:
  head/sys/ddb/db_command.c
  head/sys/kern/subr_kdb.c
  head/sys/sys/kdb.h

Modified: head/sys/ddb/db_command.c
==============================================================================
--- head/sys/ddb/db_command.c	Tue Nov 28 11:06:17 2017	(r326313)
+++ head/sys/ddb/db_command.c	Tue Nov 28 12:53:55 2017	(r326314)
@@ -556,7 +556,7 @@ db_error(const char *s)
 	if (s)
 	    db_printf("%s", s);
 	db_flush_lex();
-	kdb_reenter();
+	kdb_reenter_silent();
 }
 
 static void

Modified: head/sys/kern/subr_kdb.c
==============================================================================
--- head/sys/kern/subr_kdb.c	Tue Nov 28 11:06:17 2017	(r326313)
+++ head/sys/kern/subr_kdb.c	Tue Nov 28 12:53:55 2017	(r326314)
@@ -509,6 +509,17 @@ kdb_reenter(void)
 	/* NOTREACHED */
 }
 
+void
+kdb_reenter_silent(void)
+{
+
+	if (!kdb_active || kdb_jmpbufp == NULL)
+		return;
+
+	longjmp(kdb_jmpbufp, 1);
+	/* NOTREACHED */
+}
+
 /*
  * Thread related support functions.
  */

Modified: head/sys/sys/kdb.h
==============================================================================
--- head/sys/sys/kdb.h	Tue Nov 28 11:06:17 2017	(r326313)
+++ head/sys/sys/kdb.h	Tue Nov 28 12:53:55 2017	(r326314)
@@ -80,6 +80,7 @@ void *	kdb_jmpbuf(jmp_buf);
 void	kdb_panic(const char *);
 void	kdb_reboot(void);
 void	kdb_reenter(void);
+void	kdb_reenter_silent(void);
 struct pcb *kdb_thr_ctx(struct thread *);
 struct thread *kdb_thr_first(void);
 struct thread *kdb_thr_from_pid(pid_t);



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