Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Mar 2004 19:57:10 -0800 (PST)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 49501 for review
Message-ID:  <200403220357.i2M3vARC099933@repoman.freebsd.org>

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

Change 49501 by marcel@marcel_nfs on 2004/03/21 19:56:21

	Make this compile in the new world order. A lot of axing, but
	add db_cpu_trap().

Affected files ...

.. //depot/projects/gdb/sys/ia64/ia64/db_interface.c#4 edit

Differences ...

==== //depot/projects/gdb/sys/ia64/ia64/db_interface.c#4 (text+ko) ====

@@ -64,11 +64,6 @@
 static jmp_buf *db_nofault = 0;
 extern jmp_buf	db_jmpbuf;
 
-extern void	gdb_handle_exception(db_regs_t *, int);
-
-int	db_active;
-db_regs_t ddb_regs;
-
 static int db_get_rse_reg(struct db_variable *vp, db_expr_t *valuep, int op);
 static int db_get_ip_reg(struct db_variable *vp, db_expr_t *valuep, int op);
 
@@ -225,6 +220,11 @@
 };
 struct db_variable *db_eregs = db_regs + sizeof(db_regs)/sizeof(db_regs[0]);
 
+void
+db_cpu_trap(int vector, int dummy, struct trapframe *tf)
+{
+}
+
 static int
 db_get_rse_reg(struct db_variable *vp, db_expr_t *valuep, int op)
 {
@@ -261,141 +261,6 @@
 	return 0;
 }
 
-#if 0
-/*
- * Print trap reason.
- */
-static void
-ddbprinttrap(int vector)
-{
-
-	/* XXX Implement. */
-
-	printf("ddbprinttrap(%d)\n", vector);
-}
-#endif
-
-#define CPUSTOP_ON_DDBBREAK
-#define VERBOSE_CPUSTOP_ON_DDBBREAK
-
-#if 0
-/*
- *  ddb_trap - field a kernel trap
- */
-int
-ddb_trap(int vector, struct trapframe *regs)
-{
-	int ddb_mode = !(boothowto & RB_GDB);
-	register_t s;
-
-	/*
-	 * Don't bother checking for usermode, since a benign entry
-	 * by the kernel (call to Debugger() or a breakpoint) has
-	 * already checked for usermode.  If neither of those
-	 * conditions exist, something Bad has happened.
-	 */
-
-	if (vector != IA64_VEC_BREAK
-	    && vector != IA64_VEC_SINGLE_STEP_TRAP) {
-#if 0
-		if (ddb_mode) {
-			db_printf("ddbprinttrap from 0x%lx\n",	/* XXX */
-				  regs->tf_regs[FRAME_PC]);
-			ddbprinttrap(a0, a1, a2, entry);
-			/*
-			 * Tell caller "We did NOT handle the trap."
-			 * Caller should panic, or whatever.
-			 */
-			return (0);
-		}
-#endif
-		if (db_nofault) {
-			jmp_buf *no_fault = db_nofault;
-			db_nofault = 0;
-			longjmp(*no_fault, 1);
-		}
-	}
-
-	/*
-	 * XXX Should switch to DDB's own stack, here.
-	 */
-
-	s = intr_disable();
-
-#ifdef SMP
-#ifdef CPUSTOP_ON_DDBBREAK
-
-#if defined(VERBOSE_CPUSTOP_ON_DDBBREAK)
-	db_printf("CPU%d stopping CPUs: 0x%08x...", PCPU_GET(cpuid),
-	    PCPU_GET(other_cpus));
-#endif /* VERBOSE_CPUSTOP_ON_DDBBREAK */
-
-	/* We stop all CPUs except ourselves (obviously) */
-	stop_cpus(PCPU_GET(other_cpus));
-
-#if defined(VERBOSE_CPUSTOP_ON_DDBBREAK)
-	db_printf(" stopped.\n");
-#endif /* VERBOSE_CPUSTOP_ON_DDBBREAK */
-
-#endif /* CPUSTOP_ON_DDBBREAK */
-#endif /* SMP */
-
-	ddb_regs = *regs;
-
-	/*
-	 * XXX pretend that registers outside the current frame don't exist.
-	 */
-	db_eregs = db_regs + DB_MISC_REGS + 3 + 27 +
-	    (ddb_regs.tf_special.cfm & 0x7f);
-
-	__asm __volatile("flushrs"); /* so we can look at them */
-
-	db_active++;
-
-	if (ddb_mode) {
-	    cndbctl(TRUE);	/* DDB active, unblank video */
-	    db_trap(vector, 0);	/* Where the work happens */
-	    cndbctl(FALSE);	/* DDB inactive */
-	} else
-	    gdb_handle_exception(&ddb_regs, vector);
-
-	db_active--;
-
-#ifdef SMP
-#ifdef CPUSTOP_ON_DDBBREAK
-
-#if defined(VERBOSE_CPUSTOP_ON_DDBBREAK)
-	db_printf("CPU%d restarting CPUs: 0x%08x...", PCPU_GET(cpuid),
-	    stopped_cpus);
-#endif /* VERBOSE_CPUSTOP_ON_DDBBREAK */
-
-	/* Restart all the CPUs we previously stopped */
-	if (stopped_cpus != PCPU_GET(other_cpus) && smp_started != 0) {
-		db_printf("whoa, other_cpus: 0x%08x, stopped_cpus: 0x%08x\n",
-			  PCPU_GET(other_cpus), stopped_cpus);
-		panic("stop_cpus() failed");
-	}
-	restart_cpus(stopped_cpus);
-
-#if defined(VERBOSE_CPUSTOP_ON_DDBBREAK)
-	db_printf(" restarted.\n");
-#endif /* VERBOSE_CPUSTOP_ON_DDBBREAK */
-
-#endif /* CPUSTOP_ON_DDBBREAK */
-#endif /* SMP */
-
-	*regs = ddb_regs;
-
-	intr_restore(s);
-
-
-	/*
-	 * Tell caller "We HAVE handled the trap."
-	 */
-	return (1);
-}
-#endif
-
 /*
  * Read bytes from kernel address space for debugger.
  */



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