Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 May 2004 14:22:06 -0700 (PDT)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 53357 for review
Message-ID:  <200405232122.i4NLM6GX086510@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=53357

Change 53357 by marcel@marcel_nfs on 2004/05/23 14:22:00

	Remove support for GDB in its entirety. The GDB backend
	has its own way for ports to register itself. The dcons(4)
	driver needs to be rewritten to make use of that.

Affected files ...

.. //depot/projects/gdb/sys/dev/dcons/dcons.c#4 edit

Differences ...

==== //depot/projects/gdb/sys/dev/dcons/dcons.c#4 (text+ko) ====

@@ -36,6 +36,7 @@
  */
 
 #include <sys/param.h>
+#include <sys/kdb.h>
 #include <sys/kernel.h>
 #include <sys/systm.h>
 #include <sys/types.h>
@@ -72,10 +73,6 @@
 #define DCONS_FORCE_CONSOLE	0	/* mostly for FreeBSD-4 */
 #endif
 
-#ifndef DCONS_FORCE_GDB
-#define DCONS_FORCE_GDB	1
-#endif
-
 #if __FreeBSD_version >= 500101
 #define CONS_NODEV	1	/* for latest current */
 static struct consdev gdbconsdev;
@@ -133,7 +130,6 @@
 	dev_t dev;
 	struct dcons_ch	o, i;
 	int brk_state;
-#define DC_GDB	1
 	int flags;
 } sc[DCONS_NPORT];
 static void	dcons_tty_start(struct tty *);
@@ -397,26 +393,9 @@
 		ch->pos = 0;
 	}
 
-#if DDB && ALT_BREAK_TO_DEBUGGER
-	switch (dc->brk_state) {
-	case STATE1:
-		if (c == KEY_TILDE)
-			dc->brk_state = STATE2;
-		else
-			dc->brk_state = STATE0;
-		break;
-	case STATE2:
-		dc->brk_state = STATE0;
-		if (c == KEY_CTRLB) {
-#if DCONS_FORCE_GDB
-			if (dc->flags & DC_GDB)
-				boothowto |= RB_GDB;
-#endif
-			breakpoint();
-		}
-	}
-	if (c == KEY_CR)
-		dc->brk_state = STATE1;
+#if KDB && ALT_BREAK_TO_DEBUGGER
+	if (kdb_alt_break(c, &dc->brk_state))
+		breakpoint();
 #endif
 	return (c);
 }
@@ -510,20 +489,6 @@
 	dcons_init_port(1, offset, size - size0);
 	dg.buf->version = htonl(DCONS_VERSION);
 	dg.buf->magic = ntohl(DCONS_MAGIC);
-
-#if DDB && DCONS_FORCE_GDB
-#if CONS_NODEV
-	gdbconsdev.cn_arg = (void *)&sc[DCONS_GDB];
-#if __FreeBSD_version >= 501109
-	sprintf(gdbconsdev.cn_name, "dgdb");
-#endif
-	gdb_arg = &gdbconsdev;
-#else
-	gdbdev = makedev(CDEV_MAJOR, DCONS_GDB);
-#endif
-	gdb_getc = dcons_cngetc;
-	gdb_putc = dcons_cnputc;
-#endif
 	drv_init = 1;
 
 	return 0;
@@ -559,7 +524,6 @@
 	int polltime;
 
 	dcons_attach_port(DCONS_CON, "dcons", 0);
-	dcons_attach_port(DCONS_GDB, "dgdb", DC_GDB);
 #if __FreeBSD_version < 500000
 	callout_init(&dcons_callout);
 #else
@@ -621,18 +585,10 @@
 	case MOD_UNLOAD:
 		printf("dcons: unload\n");
 		callout_stop(&dcons_callout);
-#if DDB && DCONS_FORCE_GDB
-#if CONS_NODEV
-		gdb_arg = NULL;
-#else
-		gdbdev = NODEV;
-#endif
-#endif
 #if __FreeBSD_version >= 500000
 		cnremove(&dcons_consdev);
 #endif
 		dcons_detach(DCONS_CON);
-		dcons_detach(DCONS_GDB);
 		dg.buf->magic = 0;
 
 		contigfree(dg.buf, DCONS_BUF_SIZE, M_DEVBUF);



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