I've just had a strange experience.  I have some gdb macros which I
use for debugging Vinum.  One, ps, gives me a ps-like listing:

(kgdb) ps
Check your .gdbinit, it contains a y command
  pid    proc    addr   uid  ppid  pgrp   flag stat comm         wchan
 1544 c68a5100 c6df3000    0  1534  1544  004006  2  Vinum        
 1534 c68a57e0 c6ddb000    0  1524  1534  004086  3  bash         wait c68a57e0
 1524 c68a5c00 c6dc9000 1004  1516  1524  004086  3  bash         wait c68a5c00

Another macro helps me load symbols from a kld:

Without:

(kgdb) bt
#0  Debugger (msg=0xc11696a0 "vinum debug") at 
../../i386/i386/db_interface.c:318
#1  0xc1163585 in ?? ()
#2  0xc01826ea in spec_ioctl (ap=0xc6df4e1c) at 
../../miscfs/specfs/spec_vnops.c:440

With:

(kgdb) bt
#0  Debugger (msg=0xc11696a0 "vinum debug") at 
../../i386/i386/db_interface.c:318
#1  0xc1163585 in vinumioctl (dev=0x40001901, cmd=0xc008464b, data=0xc6df4ee0 
"", flag=0x3, p=0xc68a5100)
    at /src/PANIC/src/sys/modules/Vinum/../../dev/Vinum/vinumioctl.c:96
#2  0xc01826ea in spec_ioctl (ap=0xc6df4e1c) at 
../../miscfs/specfs/spec_vnops.c:440

This has worked quite nicely for some time.  Since yesterday, after
building a kernel with newbus support, I get strange messages if I
read in the Vinum symbols before reading in the kernel symbols:

(kgdb) bt
#0  Debugger (msg=0xc11696a0 "vinum debug") at 
../../i386/i386/db_interface.c:318
#1  0xc1163585 in vinumioctl (dev=0x40001901, cmd=0xc008464b, data=0xc6df4ee0 
"", flag=0x3, p=0xc68a5100)
    at /src/PANIC/src/sys/modules/Vinum/../../dev/Vinum/vinumioctl.c:96
During symbol reading, "repeated" header file opt_global.h not previously seen, 
at symtab pos 23.
During symbol reading, Invalid symbol data: type number (2,2) out of range at 
symtab pos 25..
#2  0xc01826ea in spec_ioctl (ap=0xc6df4e1c) at 
../../miscfs/specfs/spec_vnops.c:440

The following stack frames also look strange:

#5  0xc017ccdd in vn_ioctl (fp=<error type>, com=<incomplete type>, 
data=<incomplete type>, p=<error type>)
    at vnode_if.h:395
#6  0xc015c5f7 in ioctl (p=0xc68a5100, uap=0xc6df4f94) at 
../../kern/sys_generic.c:564
#7  0xc021e916 in syscall (frame=<error type>) at ../../i386/i386/trap.c:1071

I debugged gdb and found that it was finding these references
(opt_global.h) in cd9660_rrip.o, which it read after reading the Vinum
kld symbols.  If I can convince it to read the kernel symbols first, I
don't have any trouble.  I don't think that it's anything to do with
that particular file; there must be about 30 files in a typical kernel
build which refer to this symbol.

If I don't get any response on the list, I'll put in a PR, but I
thought there's a good chance that somebody will recognize this
problem and be able to fix it.

Greg
--
See complete headers for address, home page and phone numbers
finger g...@lemis.com for PGP public key


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message

Reply via email to