From owner-p4-projects@FreeBSD.ORG Wed Oct 13 11:19:44 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3C0D016A4D1; Wed, 13 Oct 2004 11:19:44 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EEC1716A4CE for ; Wed, 13 Oct 2004 11:19:43 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CFFC543D39 for ; Wed, 13 Oct 2004 11:19:43 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i9DBJhAl098495 for ; Wed, 13 Oct 2004 11:19:43 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i9DBJhKY098492 for perforce@freebsd.org; Wed, 13 Oct 2004 11:19:43 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Wed, 13 Oct 2004 11:19:43 GMT Message-Id: <200410131119.i9DBJhKY098492@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Subject: PERFORCE change 63150 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2004 11:19:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=63150 Change 63150 by rwatson@rwatson_tislabs on 2004/10/13 11:19:18 When forcing entry to the debugger, use a DEBUGGER() macro to get there; if KDB is compiled into the kernel, use kdb_enter(), otherwise an advisory printf(). Eliminate some stragglin calls to Debugger() that pre-date the new kernel debugger infrastructure. Affected files ... .. //depot/projects/trustedbsd/mac/sys/security/mac_test/mac_test.c#135 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/security/mac_test/mac_test.c#135 (text+ko) ==== @@ -271,6 +271,12 @@ SYSCTL_INT(_security_mac_test, OID_AUTO, internalize_count, CTLFLAG_RD, &internalize_count, 0, "Subject/object internalize calls"); +#ifdef KDB +#define DEBUGGER(x) kdb_enter(x) +#else +#define DEBUGGER(x) printf("mac_test: %s\n", (x)) +#endif + /* * Policy module operations. */ @@ -482,9 +488,9 @@ atomic_add_int(&destroy_count_bpfdesc, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - kdb_enter("mac_test_destroy_bpfdesc: dup destroy"); + DEBUGGER("mac_test_destroy_bpfdesc: dup destroy"); } else { - kdb_enter("mac_test_destroy_bpfdesc: corrupted label"); + DEBUGGER("mac_test_destroy_bpfdesc: corrupted label"); } } @@ -496,9 +502,9 @@ atomic_add_int(&destroy_count_cred, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - kdb_enter("mac_test_destroy_cred: dup destroy"); + DEBUGGER("mac_test_destroy_cred: dup destroy"); } else { - kdb_enter("mac_test_destroy_cred: corrupted label"); + DEBUGGER("mac_test_destroy_cred: corrupted label"); } } @@ -510,9 +516,9 @@ atomic_add_int(&destroy_count_devfsdirent, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - kdb_enter("mac_test_destroy_devfsdirent: dup destroy"); + DEBUGGER("mac_test_destroy_devfsdirent: dup destroy"); } else { - kdb_enter("mac_test_destroy_devfsdirent: corrupted label"); + DEBUGGER("mac_test_destroy_devfsdirent: corrupted label"); } } @@ -524,9 +530,9 @@ atomic_add_int(&destroy_count_ifnet, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - kdb_enter("mac_test_destroy_ifnet: dup destroy"); + DEBUGGER("mac_test_destroy_ifnet: dup destroy"); } else { - kdb_enter("mac_test_destroy_ifnet: corrupted label"); + DEBUGGER("mac_test_destroy_ifnet: corrupted label"); } } @@ -538,9 +544,9 @@ atomic_add_int(&destroy_count_inpcb, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - kdb_enter("mac_test_destroy_inpcb: dup destroy"); + DEBUGGER("mac_test_destroy_inpcb: dup destroy"); } else { - kdb_enter("mac_test_destroy_inpcb: corrupted label"); + DEBUGGER("mac_test_destroy_inpcb: corrupted label"); } } @@ -552,9 +558,9 @@ atomic_add_int(&destroy_count_ipc_msg, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - Debugger("mac_test_destroy_ipc_msgmsg_label: dup destroy"); + DEBUGGER("mac_test_destroy_ipc_msgmsg_label: dup destroy"); } else { - Debugger("mac_test_destroy_ipc_msgmsg_label: corrupted label"); + DEBUGGER("mac_test_destroy_ipc_msgmsg_label: corrupted label"); } } @@ -566,9 +572,9 @@ atomic_add_int(&destroy_count_ipc_msq, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - Debugger("mac_test_destroy_ipc_msgqueue_label: dup destroy"); + DEBUGGER("mac_test_destroy_ipc_msgqueue_label: dup destroy"); } else { - Debugger("mac_test_destroy_ipc_msgqueue_label: corrupted label"); + DEBUGGER("mac_test_destroy_ipc_msgqueue_label: corrupted label"); } } @@ -580,9 +586,9 @@ atomic_add_int(&destroy_count_ipc_sema, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - Debugger("mac_test_destroy_ipc_sema_label: dup destroy"); + DEBUGGER("mac_test_destroy_ipc_sema_label: dup destroy"); } else { - Debugger("mac_test_destroy_ipc_sema_label: corrupted label"); + DEBUGGER("mac_test_destroy_ipc_sema_label: corrupted label"); } } @@ -594,9 +600,9 @@ atomic_add_int(&destroy_count_ipc_shm, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - Debugger("mac_test_destroy_ipc_shm_label: dup destroy"); + DEBUGGER("mac_test_destroy_ipc_shm_label: dup destroy"); } else { - Debugger("mac_test_destroy_ipc_shm_label: corrupted label"); + DEBUGGER("mac_test_destroy_ipc_shm_label: corrupted label"); } } @@ -608,9 +614,9 @@ atomic_add_int(&destroy_count_ipq, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - kdb_enter("mac_test_destroy_ipq: dup destroy"); + DEBUGGER("mac_test_destroy_ipq: dup destroy"); } else { - kdb_enter("mac_test_destroy_ipq: corrupted label"); + DEBUGGER("mac_test_destroy_ipq: corrupted label"); } } @@ -630,9 +636,9 @@ atomic_add_int(&destroy_count_mbuf, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - kdb_enter("mac_test_destroy_mbuf: dup destroy"); + DEBUGGER("mac_test_destroy_mbuf: dup destroy"); } else { - kdb_enter("mac_test_destroy_mbuf: corrupted label"); + DEBUGGER("mac_test_destroy_mbuf: corrupted label"); } } @@ -644,9 +650,9 @@ atomic_add_int(&destroy_count_mount, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - kdb_enter("mac_test_destroy_mount: dup destroy"); + DEBUGGER("mac_test_destroy_mount: dup destroy"); } else { - kdb_enter("mac_test_destroy_mount: corrupted label"); + DEBUGGER("mac_test_destroy_mount: corrupted label"); } } @@ -658,9 +664,9 @@ atomic_add_int(&destroy_count_mount_fslabel, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - kdb_enter("mac_test_destroy_mount_fslabel: dup destroy"); + DEBUGGER("mac_test_destroy_mount_fslabel: dup destroy"); } else { - kdb_enter("mac_test_destroy_mount_fslabel: corrupted label"); + DEBUGGER("mac_test_destroy_mount_fslabel: corrupted label"); } } @@ -672,9 +678,9 @@ atomic_add_int(&destroy_count_socket, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - kdb_enter("mac_test_destroy_socket: dup destroy"); + DEBUGGER("mac_test_destroy_socket: dup destroy"); } else { - kdb_enter("mac_test_destroy_socket: corrupted label"); + DEBUGGER("mac_test_destroy_socket: corrupted label"); } } @@ -686,9 +692,9 @@ atomic_add_int(&destroy_count_socket_peerlabel, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - kdb_enter("mac_test_destroy_socket_peerlabel: dup destroy"); + DEBUGGER("mac_test_destroy_socket_peerlabel: dup destroy"); } else { - kdb_enter("mac_test_destroy_socket_peerlabel: corrupted label"); + DEBUGGER("mac_test_destroy_socket_peerlabel: corrupted label"); } } @@ -700,9 +706,9 @@ atomic_add_int(&destroy_count_pipe, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - kdb_enter("mac_test_destroy_pipe: dup destroy"); + DEBUGGER("mac_test_destroy_pipe: dup destroy"); } else { - kdb_enter("mac_test_destroy_pipe: corrupted label"); + DEBUGGER("mac_test_destroy_pipe: corrupted label"); } } @@ -714,9 +720,9 @@ atomic_add_int(&destroy_count_posixsems, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - Debugger("mac_test_destroy_posix_ksem: dup destroy"); + DEBUGGER("mac_test_destroy_posix_ksem: dup destroy"); } else { - Debugger("mac_test_destroy_posix_ksem: corrupted label"); + DEBUGGER("mac_test_destroy_posix_ksem: corrupted label"); } } @@ -728,9 +734,9 @@ atomic_add_int(&destroy_count_proc, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - kdb_enter("mac_test_destroy_proc: dup destroy"); + DEBUGGER("mac_test_destroy_proc: dup destroy"); } else { - kdb_enter("mac_test_destroy_proc: corrupted label"); + DEBUGGER("mac_test_destroy_proc: corrupted label"); } } @@ -742,9 +748,9 @@ atomic_add_int(&destroy_count_vnode, 1); SLOT(label) = EXMAGIC; } else if (SLOT(label) == EXMAGIC) { - kdb_enter("mac_test_destroy_vnode: dup destroy"); + DEBUGGER("mac_test_destroy_vnode: dup destroy"); } else { - kdb_enter("mac_test_destroy_vnode: corrupted label"); + DEBUGGER("mac_test_destroy_vnode: corrupted label"); } }