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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to