PERFORCE change 63150 for review

Robert Watson rwatson at FreeBSD.org
Wed Oct 13 11:19:43 GMT 2004


http://perforce.freebsd.org/chv.cgi?CH=63150

Change 63150 by rwatson at 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");
 	}
 }
 
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list