Module Name:    src
Committed By:   skrll
Date:           Thu Jun  9 16:45:38 UTC 2022

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

Log Message:
Only report the SSBREAKPOINT break instruction as SIGTRAP/TRAP_TRACE. All
other break instructions will be reported as SIGTRAP/TRAP_BRKPT

This fixes a mistake I made back in 2008.

PR/56866: hppa: kernel gets confused between actual breakpoints and single-step 
breakpoints


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/hppa/hppa/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/hppa/hppa/trap.c
diff -u src/sys/arch/hppa/hppa/trap.c:1.119 src/sys/arch/hppa/hppa/trap.c:1.120
--- src/sys/arch/hppa/hppa/trap.c:1.119	Thu Jun  9 16:38:23 2022
+++ src/sys/arch/hppa/hppa/trap.c	Thu Jun  9 16:45:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.119 2022/06/09 16:38:23 skrll Exp $	*/
+/*	$NetBSD: trap.c,v 1.120 2022/06/09 16:45:38 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.119 2022/06/09 16:38:23 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.120 2022/06/09 16:45:38 skrll Exp $");
 
 /* #define INTRDEBUG */
 /* #define TRAPDEBUG */
@@ -773,13 +773,13 @@ do_onfault:
 	case T_DBREAK | T_USER:
 		KSI_INIT_TRAP(&ksi);
 		ksi.ksi_signo = SIGTRAP;
-		ksi.ksi_code = TRAP_TRACE;
+		ksi.ksi_code = TRAP_BRKPT;
 		ksi.ksi_trap = trapnum;
 		ksi.ksi_addr = (void *)(frame->tf_iioq_head & ~HPPA_PC_PRIV_MASK);
 #ifdef PTRACE
 		ss_clear_breakpoints(l);
 		if (opcode == SSBREAKPOINT)
-			ksi.ksi_code = TRAP_BRKPT;
+			ksi.ksi_code = TRAP_TRACE;
 #endif
 		/* pass to user debugger */
 		trapsignal(l, &ksi);

Reply via email to