[Crash-utility] display function parameters for call stack

Dave Anderson anderson at redhat.com
Mon Sep 24 13:30:55 UTC 2012



----- Original Message -----
> 
> Dave,
> 
> 
> On Fri, Sep 21, 2012 at 9:44 PM, Dave Anderson < anderson at redhat.com
> > wrote:
> 
> 
> 
> 
> 
> ----- Original Message -----
> > 
> > Hi Dave,
> > 
> > 
> > I notice there was some discussion around on enabling
> > the display function parameters feature for crash tool.
> > Like this one:
> > http://www.redhat.com/archives/crash-utility/2009-May/msg00016.html
> 
> Yes, it seems to come up every few years. People have tried, but it
> has never come to fruition.
> 
> 
> > 
> > Although the answer seems to be quite clear, it should be hard to
> > support such feature. But does this feature cannot be done anyway?
> > I think this feature would be great in assisting kernel debug.
> > 
> > The main feature I require, first should be know each param's value in the call stack.
> > Then it is better to know each call stack's param's name.
> > 
> > Like for do_vfs_ioctl function, it is better to display as:
> > do_vfs_ioctl(filp=xxx, fd=xxx, cmd=xxx, arg=xxx)
> > 
> > Do you have any idea on how this could be implemented?
> 
> No I don't.
> 
> 
> 
> Sorry for asking the stupid question, but I notice that we could
> get the structure member in crash by "struct" command:
> 
> crash> struct stackframe
> struct stackframe {
> long unsigned int fp;
> long unsigned int sp;
> long unsigned int lr;
> long unsigned int pc;
> }
> SIZE: 16
> 
> 
> I check the crash code, and find cmd_struct use gdb interface to
> parse it out.
> 
> 
> And the gdb itself seems already could parse out function argument[1], so could
> we still use similar mechanism as the "struct" command to implement a "func"
> command, which could shows the function declaration?

You can either use the "whatis" command to get the function declaration:

 crash> help whatis

 NAME
   whatis - search symbol table for data or type information

 SYNOPSIS
   whatis [struct | union | typedef | symbol] 

 DESCRIPTION
   This command displays the definition of structures, unions, typedefs or
   text/data symbols.
 ...


 crash> whatis do_vfs_ioctl
 int do_vfs_ioctl(struct file *, unsigned int, unsigned int, long unsigned int);
 crash>

Or print it with "p", which gives you both the declaration and its virtual address:

 crash> p do_vfs_ioctl
 do_vfs_ioctl = $14 = 
  {int (struct file *, unsigned int, unsigned int, long unsigned int)} 0xffffffff811247ec <do_vfs_ioctl>
 crash> 

Dave








More information about the Crash-utility mailing list