From owner-svn-src-head@freebsd.org Tue Nov 28 12:53:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAABBE55B6B; Tue, 28 Nov 2017 12:53:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 977C163A46; Tue, 28 Nov 2017 12:53:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vASCrtn2071491; Tue, 28 Nov 2017 12:53:55 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vASCrtlB071488; Tue, 28 Nov 2017 12:53:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201711281253.vASCrtlB071488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 28 Nov 2017 12:53:55 +0000 (UTC) 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 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: ddb kern sys X-SVN-Commit-Revision: 326314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Nov 2017 12:53:56 -0000 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);