Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Aug 2018 20:38:01 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r337061 - stable/11/sys/sparc64/sparc64
Message-ID:  <201808012038.w71Kc14u079965@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Aug  1 20:38:01 2018
New Revision: 337061
URL: https://svnweb.freebsd.org/changeset/base/337061

Log:
  MFC 333416: Report TRAP_BRKPT for breakpoint traps on sparc64.

Modified:
  stable/11/sys/sparc64/sparc64/trap.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/sparc64/sparc64/trap.c
==============================================================================
--- stable/11/sys/sparc64/sparc64/trap.c	Wed Aug  1 20:08:20 2018	(r337060)
+++ stable/11/sys/sparc64/sparc64/trap.c	Wed Aug  1 20:38:01 2018	(r337061)
@@ -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);



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