Dave,<br><br><div class="gmail_quote">On Mon, Sep 24, 2012 at 9:55 PM, Dave Anderson <span dir="ltr"><<a href="mailto:anderson@redhat.com" target="_blank">anderson@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
<br>
----- Original Message -----<br>
<br>
<br>
> You can either use the "whatis" command to get the function<br>
> declaration:<br>
><br>
> crash> help whatis<br>
><br>
> NAME<br>
> whatis - search symbol table for data or type information<br>
><br>
> SYNOPSIS<br>
> whatis [struct | union | typedef | symbol]<br>
><br>
> DESCRIPTION<br>
> This command displays the definition of structures, unions, typedefs<br>
> or<br>
> text/data symbols.<br>
> ...<br>
><br>
> crash> whatis do_vfs_ioctl<br>
> int do_vfs_ioctl(struct file *, unsigned int, unsigned int, long unsigned int);<br>
> crash><br>
><br>
> Or print it with "p", which gives you both the declaration and its<br>
> virtual address:<br>
><br>
> crash> p do_vfs_ioctl<br>
> do_vfs_ioctl = $14 =<br>
> {int (struct file *, unsigned int, unsigned int, long unsigned int)}  0xffffffff811247ec <do_vfs_ioctl><br>
> crash><br>
><br>
> That works. :)<br>
> However could it be possible to show the argument without only display its type?<br>
> The kernel is defining the do_vfs_ioctl as:<br>
><br>
> int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, unsigned long arg);<br>
> Could the "filp, fd, cmd, arg" be showed out?<br>
<br>
</div></div>Anything from the output line could be selectively shown if you parse<br>
the gdb output with open_tmpfile() or open_tmpfile2() if necessary.<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>Do you mean if I want to display out something like:</div><div>int do_vfs_ioctl(struct file * filp, unsigned int fd, unsigned int cmd, long unsigned int arg);</div>
<div>I need to use the tmpfile to pass "filp, fd, cmd, arg" to "whatis"?</div><div><br></div><div>But the reality is that I don't know how to let crash extract the four parameter name,</div><div>then how could I pass this info to the tmpfile?</div>
<div><br></div><div>Also the interest of me is get the output as:</div><div> do_vfs_ioctl(filp,  fd,  cmd,  arg);</div><div>The parameter's type may not need to be displayed as the whatis case.</div><br class="Apple-interchange-newline">
<div>Thanks,</div><div>Lei<br><div class="HOEnZb"><div class="h5"><a href="https://www.redhat.com/mailman/listinfo/crash-utility" target="_blank"></a><br>
</div></div></div></div>