tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Finding the syscall number in a crash dump for a given process?

        hello. I'm in the midst of debugging some ufs_rename patches I'm
trying to get working under NetBSD-5, and I'm now trying to assertain what
the miscrient lwp's were doing before they caused the panic.
A typical trace looks something like:

(gdb) bt
#0  0xc0448bdf in mi_switch (l=0xcbf6e820)
    at /usr/local/netbsd/src/sys/kern/kern_synch.c:765
#1  0xc0435351 in lwp_userret (l=0xcbf6e820)
    at /usr/local/netbsd/src/sys/kern/kern_lwp.c:1294
#2  0xc05120fe in syscall (frame=0xcbf87d48)
    at /usr/local/netbsd/src/sys/sys/userret.h:90
#3  0xc0100505 in syscall1 ()

        I thought I could get the syscall from l->l_sysent, but no such luck.
(gdb) print l->l_sysent
$33 = (const struct sysent * volatile) 0x0

I then thought I might be able to get the syscall which was originally
called from the trapframe, but it's not obvious to me if it's there and if
it is, what it is.
I'm doing this under NetBSD-5.1/i386
A typical trap frame looks like:

(gdb) print *frame
$34 = {tf_gs = -1078001485, tf_fs = 171, tf_es = -1078001633,
  tf_ds = -1145241569, tf_edi = -1077942116, tf_esi = 6651,
  tf_ebp = -1077942072, tf_ebx = 134516340, tf_edx = -1145145120, tf_ecx =
  tf_eax = 2, tf_trapno = 3, tf_err = 2, tf_eip = -1145744729, tf_cs = 23,
  tf_eflags = 663, tf_esp = -1077942148, tf_ss = 31, tf_vm86_es = 0,
  tf_vm86_ds = 0, tf_vm86_fs = 0, tf_vm86_gs = 0}

        Can anyone provide any light on this topic?  If there's some
documentation I should read, let me know.  If I'm missing something
obvious, let me know that as well.  I feel like I'm close to the answer,
but I'm just not getting it.


Home | Main Index | Thread Index | Old Index