Date: Mon, 08 Oct 2001 14:23:12 +0100 From: Ian Dowse <iedowse@maths.tcd.ie> To: Bruce Evans <bde@zeta.org.au> Cc: current@FreeBSD.ORG Subject: Re: Missing stack frames in kgdb/ddb traces Message-ID: <200110081423.aa55254@salmon.maths.tcd.ie> In-Reply-To: Your message of "Mon, 08 Oct 2001 22:23:32 %2B1000." <20011008214808.S17093-100000@delplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <20011008214808.S17093-100000@delplex.bde.org>, Bruce Evans writes:
>
>BTW, I think parts of the keyboard interrupt handler need to be fast
>interrupts again so that the keyboard can be used to debug infinite
>loops in the kernel like it used to be able to. Now the debugger
>hotkey always takes you to an uninteresting place in the keyboard
>ithread even if it is not blocked.
Yeah, this was an annoying side-effect of the ithread changes. I
was delighted to discover that the serial console case still gives
a useful trace.
>I think debuggers should be taught about the main entry points Xintr*
>and Xfastintr* instead. The current Xresume* labels are not used
>except by debuggers. These labels are only used by debuggers because
>they hide the labels for the main entry points of the interrupt handlers.
>Note that Xsyscall is already handled like this. I think support for
>it was broken in gdb by the evil syscall_with_err_pushed changes.
Ah, I missed why the Xresume labels were there originally. Below
is a patch that removes the Xresume labels, and makes gdb and ddb
check for the Xintr/Xfastintr labels instead.
Ian
Index: sys/i386/i386/db_trace.c
===================================================================
RCS file: /dump/FreeBSD-CVS/src/sys/i386/i386/db_trace.c,v
retrieving revision 1.43
diff -u -r1.43 db_trace.c
--- sys/i386/i386/db_trace.c 12 Sep 2001 08:37:29 -0000 1.43
+++ sys/i386/i386/db_trace.c 8 Oct 2001 12:34:32 -0000
@@ -223,7 +223,8 @@
if (name != NULL) {
if (!strcmp(name, "calltrap")) {
frame_type = TRAP;
- } else if (!strncmp(name, "Xresume", 7)) {
+ } else if (!strncmp(name, "Xintr", 5) ||
+ !strncmp(name, "Xfastintr", 9)) {
frame_type = INTERRUPT;
} else if (!strcmp(name, "syscall_with_err_pushed")) {
frame_type = SYSCALL;
Index: gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c
===================================================================
RCS file: /dump/FreeBSD-CVS/src/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c,v
retrieving revision 1.27
diff -u -r1.27 kvm-fbsd.c
--- gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c 19 Sep 2001 18:42:19 -0000 1.27
+++ gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c 8 Oct 2001 13:08:58 -0000
@@ -125,7 +125,8 @@
* Symbol names of kernel entry points. Use special frames.
*/
#define KSYM_TRAP "calltrap"
-#define KSYM_INTERRUPT "Xresume"
+#define KSYM_INTR "Xintr"
+#define KSYM_FASTINTR "Xfastintr"
#define KSYM_SYSCALL "Xsyscall"
/*
@@ -160,7 +161,9 @@
if (sym != NULL) {
if (strcmp (SYMBOL_NAME(sym), KSYM_TRAP) == 0)
frametype = tf_trap;
- else if (strncmp (SYMBOL_NAME(sym), KSYM_INTERRUPT, 7) == 0)
+ else if (strncmp (SYMBOL_NAME(sym), KSYM_INTR,
+ strlen(KSYM_INTR)) == 0 || strncmp (SYMBOL_NAME(sym),
+ KSYM_FASTINTR, strlen(KSYM_FASTINTR)) == 0)
frametype = tf_interrupt;
else if (strcmp (SYMBOL_NAME(sym), KSYM_SYSCALL) == 0)
frametype = tf_syscall;
Index: sys/i386/isa/apic_vector.s
===================================================================
RCS file: /dump/FreeBSD-CVS/src/sys/i386/isa/apic_vector.s,v
retrieving revision 1.72
diff -u -r1.72 apic_vector.s
--- sys/i386/isa/apic_vector.s 12 Sep 2001 08:37:33 -0000 1.72
+++ sys/i386/isa/apic_vector.s 8 Oct 2001 12:35:12 -0000
@@ -155,8 +155,6 @@
movl PCPU(CURTHREAD),%ebx ; \
incl TD_INTR_NESTING_LEVEL(%ebx) ; \
; \
- /* entry point used by doreti_unpend for HWIs. */ \
-__CONCAT(Xresume,irq_num): ; \
FAKE_MCOUNT(13*4(%esp)) ; /* XXX avoid dbl cnt */ \
pushl $irq_num; /* pass the IRQ */ \
call sched_ithd ; \
Index: sys/i386/isa/icu_vector.s
===================================================================
RCS file: /dump/FreeBSD-CVS/src/sys/i386/isa/icu_vector.s,v
retrieving revision 1.29
diff -u -r1.29 icu_vector.s
--- sys/i386/isa/icu_vector.s 12 Sep 2001 08:37:34 -0000 1.29
+++ sys/i386/isa/icu_vector.s 8 Oct 2001 12:35:22 -0000
@@ -106,7 +106,6 @@
enable_icus ; \
movl PCPU(CURTHREAD),%ebx ; \
incl TD_INTR_NESTING_LEVEL(%ebx) ; \
-__CONCAT(Xresume,irq_num): ; \
FAKE_MCOUNT(13*4(%esp)) ; /* XXX late to avoid double count */ \
pushl $irq_num; /* pass the IRQ */ \
call sched_ithd ; \
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110081423.aa55254>
