<br><br><div class="gmail_quote">On Mon, Sep 24, 2012 at 11:00 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="im"><br>
<br>
----- Original Message -----<br>
<br>
> ><br>
> Do you mean if I want to display out something like:<br>
> int do_vfs_ioctl(struct file * filp, unsigned int fd, unsigned int cmd, long unsigned int arg);<br>
> I need to use the tmpfile to pass "filp, fd, cmd, arg" to "whatis"?<br>
><br>
> But the reality is that I don't know how to let crash extract the four parameter name,<br>
> then how could I pass this info to the tmpfile?<br>
><br>
> Also the interest of me is get the output as:<br>
>  do_vfs_ioctl(filp,  fd,  cmd,  arg);<br>
> The parameter's type may not need to be displayed as the whatis case.<br>
><br>
> Thanks,<br>
> Lei<br>
<br>
<br>
</div>Ah OK, I misunderstood your first question.<br>
<br>
As far as getting the parameter names themselves, there is no helper<br>
function that does that.  There are two ways of accessing gdb<br>
functionality -- either:<br>
<br>
(1) a gdb command string can be issued unmodified via the<br>
    gdb_pass_through() function, or<br>
(2) a specific pre-existing gdb helper function may be accessed<br>
    via gdb_interface(), which ends up in the gdb_command_funnel()<br>
    function in gdb-7.3-1/gdb/symtab.c.<br>
<br>
with respect to (1), ideally there would be some other gdb command<br>
string that you could pass unmodified to gdb to get what you want,<br>
but I don't know of any.<br>
<br>
With respect to (2), the gdb_command_funnel() function has a switch<br>
statement for a list of several pre-existing "req->command" definitions,<br>
but none of them pull out the actual names of text function arguments.<br>
I would guess that the argument name strings could be pulled out with<br>
a new gdb helper function, but you'd have to write it yourself.<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>I find print_frame_args in gdb/stack.c seems to be the function to print out</div><div>the argument's name. Its working mechanism is exacting out all symbols</div>
<div>in the specified function with ALL_BLOCK_SYMBOLS. Then discard</div><div>those symbol not as argument by SYMBOL_IS_ARGUMENT.</div><div>At last it would get the argument name by SYMBOL_PRINT_NAME.</div><div><br></div>
<div>So how could I reach this print_frame_args by crash, need modify gdb side</div><div>to create such helper function?</div><div>I am not familiar with the gdb modification...</div><div>Is there any example to show me how to do this change?</div>
<div>It is better that the example itself contains how to connect the change with crash. :)</div><div><br></div><div>Thanks,</div><div>Lei</div></div>