symtab/2035: ptype can't find a struct but 'info types' or -readnow makes it appear

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

symtab/2035: ptype can't find a struct but 'info types' or -readnow makes it appear

Kevin Nomura

>Number:         2035
>Category:       symtab
>Synopsis:       ptype can't find a struct but 'info types' or -readnow makes it appear
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 16 21:28:01 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     [hidden email]
>Release:        6.2 6.3 6.3.90-20051116-cvs
>Organization:
>Environment:
linux
>Description:
gdb reports that a C struct name can not be found.

[nahant]$ gdb/gdb kernel
GNU gdb 6.3.90-20051116-cvs
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
warning: A handler for the OS ABI "FreeBSD ELF" is not built into this configuration
of GDB.  Attempting to continue with the default i386 settings.

Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) ptype struct vnode
No struct type named vnode.

But if we do "info types":

(gdb) i types
All defined types:
...

then the symbol appears.

(gdb) ptype struct vnode
type = struct vnode {
    struct mtx v_interlock;
    u_long v_iflag;
    int v_usecount;
...

Also if gdb is invoked with -readnow, the ptype works right off the bat.

gdb here is a cvs download as of today but the same thing happens with 6.2 or 6.3.  

'kernel' is freebsd 5.3 for i386 compiled with gcc 3.4.2 (the compiler distributed with freebsd 5.3).  The kernel has been modified, and in particular I did add -fno-eliminate-unused-debug_types to the gcc options.

Any suggestions on more investigation I can do to narrow the problem down?  E.g. hints on how psymtabs works, places to put printfs to watch how "struct vnode" gets skipped at first but loaded later?  I'm not sure how to cut the freebsd kernel down to a small testcase.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted: