[Crash-utility] whatis: display full parameter name when symbol is function

Dave Anderson anderson at redhat.com
Thu Mar 14 15:46:22 UTC 2013



----- Original Message -----

> 
> I see what you are concerning about...
> Attach the new format patch, which would just error out when it detect
> datatype failed.
> 
> Thanks,
> Lei

I'm going to NAK this patch for three reasons.

First, there are literally hundreds of text symbols that do 
not have any debuginfo data for one reason or another, i.e., 
they may be in .S assembly language files, or perhaps are 
crafted with a macro, etc.

Without your patch, gdb at least informs you that they are
a text symbol:
 
 crash> whatis sk_load_word
 <text variable, no debug info> sk_load_word;
 crash>

But your patch falsely proclaims that gdb failed to recognize it:

 crash> whatis sk_load_word
 whatis: gdb request failed: whatis sk_load_word
 crash>

Secondly, there can be strange/invalid output on certain functions.
For example, without your patch:
 
 crash> whatis alloc_iommu
 int alloc_iommu(struct dmar_drhd_unit *);
 crash>
 
But with your patch applied, it shows this:

 crash> whatis alloc_iommu
 int alloc_iommu(struct dmar_drhd_unit * dev size align_mask);
 crash>
 
And that seems to be because there are two functions with 
the same name:

 crash> sym alloc_iommu
 ffffffff81045950 (t) alloc_iommu /usr/src/debug/kernel-3.7.fc17/linux-3.7.9-104.fc17.x86_64/arch/x86/kernel/amd_gart_64.c: 96
 ffffffff814fe920 (T) alloc_iommu /usr/src/debug/kernel-3.7.fc17/linux-3.7.9-104.fc17.x86_64/drivers/iommu/dmar.c: 644
 crash> 

And your command is mixing the prototype info of the two
functions:

 static unsigned long alloc_iommu(struct device *dev, int size,
                                 unsigned long align_mask)

 int alloc_iommu(struct dmar_drhd_unit *drhd)

And third, there is still the issue with module text symbols
not working all of the time.  I don't know why that happens,
but it's bothersome.

However, I will apply the simple changes that you requested for 
gdb_get_datatype() so that you can keep a private branch with 
your full patch in place. 

Dave





More information about the Crash-utility mailing list