Module Name:    src
Committed By:   rin
Date:           Thu Sep 14 03:24:07 UTC 2023

Modified Files:
        src/sys/arch/mips/mips: trap.c

Log Message:
mips/trap: Fix reversed ksi_code for SIGTRAP cases

It should be TRAP_TRACE and TRAP_BRKPT for software single stepping
and ``real'' break insn, respectively.


To generate a diff of this commit:
cvs rdiff -u -r1.262 -r1.263 src/sys/arch/mips/mips/trap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/mips/trap.c
diff -u src/sys/arch/mips/mips/trap.c:1.262 src/sys/arch/mips/mips/trap.c:1.263
--- src/sys/arch/mips/mips/trap.c:1.262	Sun Mar 13 17:50:55 2022
+++ src/sys/arch/mips/mips/trap.c	Thu Sep 14 03:24:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.262 2022/03/13 17:50:55 andvar Exp $	*/
+/*	$NetBSD: trap.c,v 1.263 2023/09/14 03:24:07 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.262 2022/03/13 17:50:55 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.263 2023/09/14 03:24:07 rin Exp $");
 
 #include "opt_cputype.h"	/* which mips CPU levels do we support? */
 #include "opt_ddb.h"
@@ -604,7 +604,7 @@ trap(uint32_t status, uint32_t cause, va
 			ksi.ksi_trap = type & ~T_USER;
 			ksi.ksi_signo = SIGTRAP;
 			ksi.ksi_addr = (void *)va;
-			ksi.ksi_code = TRAP_TRACE;
+			ksi.ksi_code = TRAP_BRKPT;
 
 			if ((insn.JType.op == OP_SPECIAL) &&
 			    (insn.RType.func == OP_BREAK)) {
@@ -662,7 +662,7 @@ trap(uint32_t status, uint32_t cause, va
 		ksi.ksi_trap = type & ~T_USER;
 		ksi.ksi_signo = SIGTRAP;
 		ksi.ksi_addr = (void *)va;
-		ksi.ksi_code = TRAP_BRKPT;
+		ksi.ksi_code = TRAP_TRACE;
 		break; /* SIGNAL */
 	}
 	case T_DSP+T_USER:

Reply via email to