Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 May 2026 17:27:56 +0000
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 00b96a777845 - main - amd64: Drop segment descriptor details from trap messsages
Message-ID:  <6a15d81c.3ba8b.19c785f8@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=00b96a777845d9b558b2303cbef03ba5197b593a

commit 00b96a777845d9b558b2303cbef03ba5197b593a
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2026-05-26 17:27:40 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-05-26 17:27:40 +0000

    amd64: Drop segment descriptor details from trap messsages
    
    Segment descriptor contents are fixed on amd64 and not very interesting
    compared to the other values that are displayed.
    
    While here, include both the thread and process details of the current
    thread and drop redundant output of the trap number.
    
    Reviewed by:    kib
    Differential Revision:  https://reviews.freebsd.org/D56989
---
 sys/amd64/amd64/trap.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index fb18b7d06f9e..df9cc44bcbb2 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -944,13 +944,9 @@ trap_diag(struct trapframe *frame, vm_offset_t eva, const char *type_str)
 {
 	int code;
 	u_int type;
-	struct soft_segment_descriptor softseg;
-	struct user_segment_descriptor *gdt;
 
 	code = frame->tf_err;
 	type = frame->tf_trapno;
-	gdt = *PCPU_PTR(gdt);
-	sdtossd(&gdt[IDXSEL(frame->tf_cs)], &softseg);
 
 	printf("\n%s trap %d: %s while in %s mode\n", type_str, type,
 	    type < nitems(trap_msg) ? trap_msg[type] : UNKNOWN,
@@ -975,11 +971,6 @@ trap_diag(struct trapframe *frame, vm_offset_t eva, const char *type_str)
 	    frame->tf_rsp);
 	printf("frame pointer	        = %#hx:%#lx\n", frame->tf_ss,
 	    frame->tf_rbp);
-	printf("code segment		= base 0x%lx, limit 0x%lx, type 0x%x\n",
-	       softseg.ssd_base, softseg.ssd_limit, softseg.ssd_type);
-	printf("			= DPL %d, pres %d, long %d, def32 %d, gran %d\n",
-	       softseg.ssd_dpl, softseg.ssd_p, softseg.ssd_long, softseg.ssd_def32,
-	       softseg.ssd_gran);
 	printf("processor eflags	= ");
 	if (frame->tf_rflags & PSL_T)
 		printf("trace trap, ");
@@ -990,8 +981,9 @@ trap_diag(struct trapframe *frame, vm_offset_t eva, const char *type_str)
 	if (frame->tf_rflags & PSL_RF)
 		printf("resume, ");
 	printf("IOPL = %ld\n", (frame->tf_rflags & PSL_IOPL) >> 12);
-	printf("current process		= %d (%s)\n",
-	    curproc->p_pid, curthread->td_name);
+	printf("current thread		= %d/%d (%s/%s)\n",
+	    curproc->p_pid, curthread->td_tid, curproc->p_comm,
+	    curthread->td_name);
 
 	printf("rdi: %016lx rsi: %016lx rdx: %016lx\n", frame->tf_rdi,
 	    frame->tf_rsi, frame->tf_rdx);
@@ -1003,8 +995,6 @@ trap_diag(struct trapframe *frame, vm_offset_t eva, const char *type_str)
 	    frame->tf_r11, frame->tf_r12);
 	printf("r13: %016lx r14: %016lx r15: %016lx\n", frame->tf_r13,
 	    frame->tf_r14, frame->tf_r15);
-
-	printf("trap number		= %d\n", type);
 }
 
 static void


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a15d81c.3ba8b.19c785f8>