CVS commit: src/usr.sbin/crash

2024-04-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 26 22:07:32 UTC 2024

Modified Files:
src/usr.sbin/crash: Makefile

Log Message:
Add ${TOOL_DATE} (Jan-Benedict Glaw)


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/usr.sbin/crash/Makefile

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

Modified files:

Index: src/usr.sbin/crash/Makefile
diff -u src/usr.sbin/crash/Makefile:1.50 src/usr.sbin/crash/Makefile:1.51
--- src/usr.sbin/crash/Makefile:1.50	Tue Nov 21 21:01:07 2023
+++ src/usr.sbin/crash/Makefile	Fri Apr 26 18:07:32 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.50 2023/11/22 02:01:07 thorpej Exp $
+#	$NetBSD: Makefile,v 1.51 2024/04/26 22:07:32 christos Exp $
 
 PROG=		crash
 MAN=		crash.8
@@ -119,7 +119,7 @@ NVFLAGS+=-R
 # vers.c
 SRCS+=	vers.c
 vers.c:	${S}/conf/newvers.sh ${_NETBSD_VERSION_DEPENDS}
-	${HOST_SH} ${S}/conf/newvers.sh ${NVFLAGS} -n -m ${MACHINE} -i CRASH
+	TOOL_DATE=${TOOL_DATE} ${HOST_SH} ${S}/conf/newvers.sh ${NVFLAGS} -n -m ${MACHINE} -i CRASH
 CLEANFILES+=	vers.c version
 
 .else# } {



CVS commit: src/usr.sbin/crash

2024-04-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 26 22:07:32 UTC 2024

Modified Files:
src/usr.sbin/crash: Makefile

Log Message:
Add ${TOOL_DATE} (Jan-Benedict Glaw)


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/usr.sbin/crash/Makefile

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



CVS commit: src/usr.sbin/crash

2024-01-13 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Sun Jan 14 00:40:21 UTC 2024

Modified Files:
src/usr.sbin/crash: crash.8

Log Message:
crash.8: add xref to savecore(8)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/crash/crash.8

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

Modified files:

Index: src/usr.sbin/crash/crash.8
diff -u src/usr.sbin/crash/crash.8:1.8 src/usr.sbin/crash/crash.8:1.9
--- src/usr.sbin/crash/crash.8:1.8	Sat Mar 23 02:07:32 2019
+++ src/usr.sbin/crash/crash.8	Sun Jan 14 00:40:21 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: crash.8,v 1.8 2019/03/23 02:07:32 mrg Exp $
+.\"	$NetBSD: crash.8,v 1.9 2024/01/14 00:40:21 gutteridge Exp $
 .\"
 .\" Copyright (c) 2009 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd March 22, 2019
+.Dd January 14, 2024
 .Dt CRASH 8
 .Os
 .Sh NAME
@@ -94,7 +94,8 @@ like the following:
 .Xr ps 1 ,
 .Xr vmstat 1 ,
 .Xr ddb 4 ,
-.Xr pstat 8
+.Xr pstat 8 ,
+.Xr savecore 8
 .Sh HISTORY
 The
 .Nm



CVS commit: src/usr.sbin/crash

2024-01-13 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Sun Jan 14 00:40:21 UTC 2024

Modified Files:
src/usr.sbin/crash: crash.8

Log Message:
crash.8: add xref to savecore(8)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/crash/crash.8

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



CVS commit: src/usr.sbin/crash

2023-12-11 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Dec 11 14:00:47 UTC 2023

Modified Files:
src/usr.sbin/crash: crash.c

Log Message:
Implement cngetc, don't abort.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/crash/crash.c

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

Modified files:

Index: src/usr.sbin/crash/crash.c
diff -u src/usr.sbin/crash/crash.c:1.15 src/usr.sbin/crash/crash.c:1.16
--- src/usr.sbin/crash/crash.c:1.15	Wed Apr 12 17:53:32 2023
+++ src/usr.sbin/crash/crash.c	Mon Dec 11 14:00:47 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: crash.c,v 1.15 2023/04/12 17:53:32 riastradh Exp $	*/
+/*	$NetBSD: crash.c,v 1.16 2023/12/11 14:00:47 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: crash.c,v 1.15 2023/04/12 17:53:32 riastradh Exp $");
+__RCSID("$NetBSD: crash.c,v 1.16 2023/12/11 14:00:47 mlelstv Exp $");
 #endif /* not lint */
 
 #include 
@@ -94,7 +94,6 @@ void lockdebug_lock_print(void) {
 }
 #endif
 
-
 static void
 cleanup(void)
 {
@@ -309,9 +308,11 @@ db_check_interrupt(void)
 int
 cngetc(void)
 {
+	char ch;
 
-	fprintf(stderr, "cngetc\n");
-	abort();
+	if (el_getc(elptr, ) <= 0)
+		return 0;
+	return (unsigned char)ch;
 }
 
 void



CVS commit: src/usr.sbin/crash

2023-12-11 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Dec 11 14:00:47 UTC 2023

Modified Files:
src/usr.sbin/crash: crash.c

Log Message:
Implement cngetc, don't abort.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/crash/crash.c

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



CVS commit: src/usr.sbin/crash

2023-11-21 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Nov 22 02:01:07 UTC 2023

Modified Files:
src/usr.sbin/crash: Makefile
Added Files:
src/usr.sbin/crash/arch: alpha.c

Log Message:
Add Alpha glue for crash(8).


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.sbin/crash/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/crash/arch/alpha.c

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

Modified files:

Index: src/usr.sbin/crash/Makefile
diff -u src/usr.sbin/crash/Makefile:1.49 src/usr.sbin/crash/Makefile:1.50
--- src/usr.sbin/crash/Makefile:1.49	Sun Jul  9 17:10:47 2023
+++ src/usr.sbin/crash/Makefile	Wed Nov 22 02:01:07 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.49 2023/07/09 17:10:47 riastradh Exp $
+#	$NetBSD: Makefile,v 1.50 2023/11/22 02:01:07 thorpej Exp $
 
 PROG=		crash
 MAN=		crash.8
@@ -21,11 +21,14 @@ DPADD+=	${LIBUTIL} ${LIBKVM} ${LIBEDIT} 
 || ${MACHINE_CPU} == "arm" \
 || ${MACHINE_CPU} == "aarch64" \
 || ${MACHINE_CPU} == "mips" \
+|| ${MACHINE_ARCH} == "alpha" \
 || ${MACHINE_ARCH} == "m68k" \
 || ${MACHINE_ARCH} == "powerpc" \
 || ${MACHINE_ARCH} == "powerpc64"
 SRCS+=	db_trace.c
-.if ${MACHINE_CPU} == "mips"
+.if ${MACHINE_ARCH} == "alpha"
+SRCS+=	db_interface.c
+.elif ${MACHINE_CPU} == "mips"
 SRCS+=	db_interface.c mips_stacktrace.c
 CPPFLAGS+=	-DDDB
 .elif ${MACHINE_ARCH} != "m68k" \

Added files:

Index: src/usr.sbin/crash/arch/alpha.c
diff -u /dev/null src/usr.sbin/crash/arch/alpha.c:1.1
--- /dev/null	Wed Nov 22 02:01:07 2023
+++ src/usr.sbin/crash/arch/alpha.c	Wed Nov 22 02:01:07 2023
@@ -0,0 +1,72 @@
+/*	$NetBSD: alpha.c,v 1.1 2023/11/22 02:01:07 thorpej Exp $	*/
+
+/*-
+ * Copyright (c) 2023 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+#ifndef lint
+__RCSID("$NetBSD: alpha.c,v 1.1 2023/11/22 02:01:07 thorpej Exp $");
+#endif /* not lint */
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+
+#include "extern.h"
+
+struct pcb	pcb;
+struct trapframe ddb_regs;
+
+extern db_alpha_nlist db_alpha_nl[];
+
+void
+db_mach_init(kvm_t *kd)
+{
+
+	if (kvm_nlist(kd, db_alpha_nl) == -1) {
+		errx(EXIT_FAILURE, "kvm_nlist: %s", kvm_geterr(kd));
+	}
+	if ((size_t)kvm_read(kd, db_alpha_nl[SYM_dumppcb].n_value,
+			 , sizeof(pcb)) != sizeof(pcb)) {
+		warnx("cannot read dumppcb: %s", kvm_geterr(kd));
+	}
+
+	memcpy(_regs.tf_regs[FRAME_S0],
+	_context[0], 7 * sizeof(unsigned long));
+	ddb_regs.tf_regs[FRAME_RA] = pcb.pcb_context[7];
+	ddb_regs.tf_regs[FRAME_SP] = pcb.pcb_hw.apcb_ksp;
+	ddb_regp = _regs;
+}



CVS commit: src/usr.sbin/crash

2023-11-21 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Nov 22 02:01:07 UTC 2023

Modified Files:
src/usr.sbin/crash: Makefile
Added Files:
src/usr.sbin/crash/arch: alpha.c

Log Message:
Add Alpha glue for crash(8).


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.sbin/crash/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/crash/arch/alpha.c

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



Re: CVS commit: src/usr.sbin/crash

2012-02-18 Thread Izumi Tsutsui
 In article 20120217122414.7254417...@cvs.netbsd.org,
 Martin Husemann source-changes-d@NetBSD.org wrote:
 -=-=-=-=-=-
 
 Module Name: src
 Committed By:martin
 Date:Fri Feb 17 12:24:14 UTC 2012
 
 Modified Files:
  src/usr.sbin/crash: Makefile
 
 Log Message:
 Fix build for sparc64
 
 I'd rather re-organize the contents of the files so that sparc64 is not
 different than everyone else.

m68k and arm didn't have db_machdep.c in old Makefile and
they are also broken, so sparc64 is not alone ;-p
http://releng.netbsd.org/builds/HEAD/201202171310Z/

What checks did you do before committing your refactoring?
---
Izumi Tsutsui


Re: CVS commit: src/usr.sbin/crash

2012-02-18 Thread Izumi Tsutsui
 http://releng.netbsd.org/builds/HEAD/201202171310Z/
 
 What checks did you do before committing your refactoring?
 
 None, this is why I waited after the branch. I am fixing sparc64 now.

Can you also fix arm and m68k? Or should I put kludge?
On m68k only sun3 (which has different pmap) has db_machdep.c.

---
Izumi Tsutsui


Re: CVS commit: src/usr.sbin/crash

2012-02-18 Thread Christos Zoulas
On Feb 19,  1:08am, tsut...@ceres.dti.ne.jp (Izumi Tsutsui) wrote:
-- Subject: Re: CVS commit: src/usr.sbin/crash

|  http://releng.netbsd.org/builds/HEAD/201202171310Z/
|  
|  What checks did you do before committing your refactoring?
|  
|  None, this is why I waited after the branch. I am fixing sparc64 now.
| 
| Can you also fix arm and m68k? Or should I put kludge?
| On m68k only sun3 (which has different pmap) has db_machdep.c.

I thought arm works. I am fixing mvme68k now. I am trying to make things
work without the kludge that is why I left it broken.

christos


Re: CVS commit: src/usr.sbin/crash

2012-02-17 Thread Martin Husemann
On Fri, Feb 17, 2012 at 02:15:33PM +, Christos Zoulas wrote:
 I'd rather re-organize the contents of the files so that sparc64 is not
 different than everyone else.

I just needed a quick build fix - feel free to rename/move...

Martin