Subject: port-i386/34852: KGDB stack trace is useless
To: None <port-i386-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: Andreas Gustafsson <gson@gson.org>
List: netbsd-bugs
Date: 10/18/2006 15:45:00
>Number:         34852
>Category:       port-i386
>Synopsis:       KGDB stack trace is useless
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 18 15:45:00 +0000 2006
>Originator:     Andreas Gustafsson
>Release:        NetBSD 4.99.3
>Organization:
>Environment:
System: NetBSD guava.gson.org 4.99.3 NetBSD 4.99.3 (GENERIC) #0: Mon Sep 25 00:54:38 EEST 2006 root@guru.araneus.fi:/usr/build/1007/obj/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:

I figured I'd try to track down the cause of PR 34659 using KGDB.  

I set up a target machine with "options KGDB" and a serial connection,
attached the remote GDB, made the target lock up per 34659, hit
control-C in the the remote GDB, and typed "where".  Unfortunately,
this showed a stack trace containing only two stack frames, ending at
"comint", thus failing to show what was being executed at the time of
the interrupt:

  (gdb) where
  #0  breakpoint () at ./machine/cpufunc.h:300
  #1  0xc053a522 in kgdb_connect (verbose=1) at ../../../../arch/i386/i386/kgdb_machdep.c:252
  #2  0xc02d04c9 in comintr (arg=0xc1299800) at ../../../../dev/ic/com.c:2077
  (gdb)

This used to work in prior versions of NetBSD.  Also, as DDB does display
a complete stack trace.

>How-To-Repeat:

See above.

>Fix:

None provided.