- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: KWDB not recognizing DLKM type names
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2010 01:32 AM
тАО07-22-2010 01:32 AM
While analyzing a crash dump (from HP-UX 11.31 IA), I am passing -m flag to kwdb to enable DLKM debugging. kwdb can recognize symbols from our DLKM module, but it is not recognizing type names. Couple of examples:
1. _fsh_fs_info_tbl is a global. kwdb can find it, but can't recognize its type.
q4> print &_fsh_fs_info_tbl
$1 = ( *) 0x4f12270
2. Directly printing a type doesn't work too.
q4> ptype struct fsh_fstype_info_st
No struct type named fsh_fstype_info_st.
How can I make kwdb recognize type names from our DLKM module?
I wrote a small C file (sym.c) with a few data structures defined in it and then compiled it using the command line: /opt/ansic/bin/cc +DD64 -D_KERNEL -g -c sym.c (_KERNEL is defined to include kernel space declarations). Then I used the 'adddebug' command inside kwdb to load these symbols:
q4> adddebug sym.o
Reading debug info from /var/adm/crash.3/sym.o...
expanding to full symbols...Reading debug info ...done.
Still the symbols defined in sym.c are not visible inside kwdb. I must be missing something. How can I get this to work?
kwdb version is 3.2.1.
Thanks,
Vivek
Solved! Go to Solution.
- Tags:
- kwdb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2010 01:44 AM
тАО07-22-2010 01:44 AM
Re: KWDB not recognizing DLKM type names
What does "ptype &_fsh_fs_info_tbl" show?
Can you toss kwdb out and use a normal C executable with sym.c and see if gdb finds that type?
What aC++ compiler version are you using?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2010 03:49 AM
тАО07-22-2010 03:49 AM
Re: KWDB not recognizing DLKM type names
q4> ptype &_fsh_fs_info_tbl
type = *
> What aC++ compiler version are you using?
B9007AA C.11.31.04.2 HP C/aC++ Developer's Bundle
I think I've figured out the problem. It's got something to do with the Itanium compiler's behaviour. Things are fine on PA-RISC.
I created a simple program foo.c:
typedef struct mytype
{
int a;
long b;
} mytype_t;
main()
{
}
Then compiled it both on IA and PA using the cmd: /opt/ansic/bin/cc +DD64 -g -c foo.c
When I 'adddebug'ed foo.o on kwdb (or gdb) running on a PA machine, kwdb showed 'mytype' in the catalog.
However, on IA machine, kwdb didn't show 'mytype'.
I figured out that if you _use_ a variable of a type then that type will show up in kwdb on IA. So changing main to:
main()
{
mytype_t t1;
t1.a = 10;
}
will cause kwdb to recognize 'mytype'. Note that simply declaring a variable is not enough; you have to actually use that variable. I guess the IA compiler is removing unused code even in the presence of -g flag. I don't know if a flag can be used to change this behaviour. PA compiler doesn't need this extra work.
Regards,
Vivek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2010 01:21 PM
тАО07-22-2010 01:21 PM
SolutionThis is A.06.20. The latest is A.06.25.01.
>I guess the IA compiler is removing unused code even in the presence of -g flag.
Yes. A C++ compiler can't afford to put unused info into the debug info.
>I don't know if a flag can be used to change this behaviour.
I can't duplicate your problem. If you use +kernel and -g, unused types are put into the debug info. I assume you also used +noobjdebug?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2010 02:44 AM
тАО07-23-2010 02:44 AM
Re: KWDB not recognizing DLKM type names
I would think that any optimizations should not be applied when -g flag is specified _and_ none of the optimization flags are specified. PA compiler seems to work differently in this regard, which is along (my) expected lines.
> If you use +kernel and -g, unused types are put into
> the debug info. I assume you also used +noobjdebug?
I didn't use +noobjdebug.
However, using +kernel makes it work. I no longer have to use the types to make them appear in debugger.
What does this option really do? It is not listed at A.06.25's online help page (http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/Online_Help/options.htm ).
Regards,
Vivek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2010 03:20 AM
тАО07-23-2010 03:20 AM
Re: KWDB not recognizing DLKM type names
This isn't really an optimization. Customers don't like it when their object files are massive.
>PA compiler seems to work differently in this regard
That's because it is a C only compiler, not aC++.
>our DLKM module
>using +kernel makes it work.
>What does this option really do?
This is a required option for DLKMs. If you are creating DLKMs, you must follow the info in the DDK guides.
http://www.hp.com/go/hpux_ddk
http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=cb08b3f1eee02110b3f1eee02110275d6e10RCRD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2010 04:04 AM
тАО07-23-2010 04:04 AM
Re: KWDB not recognizing DLKM type names
Hmm, yes. I didn't know this. On Itanium:
# ls -l /opt/ansic
lrwxrwxrwx 1 bin bin 3 Jul 22 04:45 /opt/ansic -> aCC
> +kernel ... This is a required option for DLKMs.
Our DLKM is actually built using this option (along with several others); just that I didn't use it for my test program, more so because PA compiler did not require it. But things are better now.
Thanks a lot, Dennis, for all the help.
Regards,
Vivek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2010 05:12 AM
тАО07-23-2010 05:12 AM
Re: KWDB not recognizing DLKM type names
If you are happy with the answers you were given, please read the following about how to assign points:
http://forums.itrc.hp.com/service/forums/helptips.do?#33
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2010 05:36 AM
тАО07-23-2010 05:36 AM
Re: KWDB not recognizing DLKM type names
Regards,
Vivek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2010 05:40 AM
тАО07-23-2010 05:40 AM
Re: KWDB not recognizing DLKM type names
Vivek