Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jul 2009 18:10:27 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r195410 - head/sys/amd64/amd64
Message-ID:  <200907061810.n66IARQJ088646@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Mon Jul  6 18:10:27 2009
New Revision: 195410
URL: http://svn.freebsd.org/changeset/base/195410

Log:
  MFi386: Add a 'show idt' command to DDB to display the non-default function
  pointers in the interrupt descriptor table.
  
  Approved by:	re (kensmith)

Modified:
  head/sys/amd64/amd64/machdep.c

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Mon Jul  6 17:23:48 2009	(r195409)
+++ head/sys/amd64/amd64/machdep.c	Mon Jul  6 18:10:27 2009	(r195410)
@@ -100,8 +100,9 @@ __FBSDID("$FreeBSD$");
 #ifndef KDB
 #error KDB must be enabled in order for DDB to work!
 #endif
-#endif
 #include <ddb/ddb.h>
+#include <ddb/db_sym.h>
+#endif
 
 #include <net/netisr.h>
 
@@ -1083,6 +1084,30 @@ extern inthand_t
 	IDTVEC(xmm), IDTVEC(dblfault),
 	IDTVEC(fast_syscall), IDTVEC(fast_syscall32);
 
+#ifdef DDB
+/*
+ * Display the index and function name of any IDT entries that don't use
+ * the default 'rsvd' entry point.
+ */
+DB_SHOW_COMMAND(idt, db_show_idt)
+{
+	struct gate_descriptor *ip;
+	int idx;
+	uintptr_t func;
+
+	ip = idt;
+	for (idx = 0; idx < NIDT && !db_pager_quit; idx++) {
+		func = ((long)ip->gd_hioffset << 16 | ip->gd_looffset);
+		if (func != (uintptr_t)&IDTVEC(rsvd)) {
+			db_printf("%3d\t", idx);
+			db_printsym(func, DB_STGY_PROC);
+			db_printf("\n");
+		}
+		ip++;
+	}
+}
+#endif
+
 void
 sdtossd(sd, ssd)
 	struct user_segment_descriptor *sd;



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