svn commit: r333416 - head/sys/sparc64/sparc64

John Baldwin jhb at FreeBSD.org
Wed May 9 15:25:27 UTC 2018


Author: jhb
Date: Wed May  9 15:25:26 2018
New Revision: 333416
URL: https://svnweb.freebsd.org/changeset/base/333416

Log:
  Report TRAP_BRKPT for breakpoint traps on sparc64.
  
  Reviewed by:	marius
  MFC after:	2 weeks
  Differential Revision:	https://reviews.freebsd.org/D15190

Modified:
  head/sys/sparc64/sparc64/trap.c

Modified: head/sys/sparc64/sparc64/trap.c
==============================================================================
--- head/sys/sparc64/sparc64/trap.c	Wed May  9 15:22:40 2018	(r333415)
+++ head/sys/sparc64/sparc64/trap.c	Wed May  9 15:25:26 2018	(r333416)
@@ -257,7 +257,7 @@ trap(struct trapframe *tf)
 	struct thread *td;
 	struct proc *p;
 	int error;
-	int sig;
+	int sig, ucode;
 	register_t addr;
 	ksiginfo_t ksi;
 
@@ -277,6 +277,7 @@ trap(struct trapframe *tf)
 		td->td_pticks = 0;
 		td->td_frame = tf;
 		addr = tf->tf_tpc;
+		ucode = (int)tf->tf_type; /* XXX not POSIX */
 		if (td->td_cowgen != p->p_cowgen)
 			thread_cow_update(td);
 
@@ -300,6 +301,10 @@ trap(struct trapframe *tf)
 		case T_CORRECTED_ECC_ERROR:
 			sig = trap_cecc();
 			break;
+		case T_BREAKPOINT:
+			sig = SIGTRAP;
+			ucode = TRAP_BRKPT;
+			break;
 		default:
 			if (tf->tf_type > T_MAX)
 				panic("trap: bad trap type %#lx (user)",
@@ -322,7 +327,7 @@ trap(struct trapframe *tf)
 				kdb_enter(KDB_WHY_TRAPSIG, "trapsig");
 			ksiginfo_init_trap(&ksi);
 			ksi.ksi_signo = sig;
-			ksi.ksi_code = (int)tf->tf_type; /* XXX not POSIX */
+			ksi.ksi_code = ucode;
 			ksi.ksi_addr = (void *)addr;
 			ksi.ksi_trapno = (int)tf->tf_type;
 			trapsignal(td, &ksi);


More information about the svn-src-head mailing list