[Crash-utility] display function parameters for call stack

Dave Anderson anderson at redhat.com
Mon Sep 24 15:00:33 UTC 2012



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

> >
> Do you mean if I want to display out something like:
> int do_vfs_ioctl(struct file * filp, unsigned int fd, unsigned int cmd, long unsigned int arg);
> I need to use the tmpfile to pass "filp, fd, cmd, arg" to "whatis"?
> 
> But the reality is that I don't know how to let crash extract the four parameter name,
> then how could I pass this info to the tmpfile?
> 
> Also the interest of me is get the output as:
>  do_vfs_ioctl(filp,  fd,  cmd,  arg);
> The parameter's type may not need to be displayed as the whatis case.
> 
> Thanks,
> Lei


Ah OK, I misunderstood your first question.

As far as getting the parameter names themselves, there is no helper
function that does that.  There are two ways of accessing gdb
functionality -- either:

(1) a gdb command string can be issued unmodified via the 
    gdb_pass_through() function, or
(2) a specific pre-existing gdb helper function may be accessed 
    via gdb_interface(), which ends up in the gdb_command_funnel()
    function in gdb-7.3-1/gdb/symtab.c.

with respect to (1), ideally there would be some other gdb command
string that you could pass unmodified to gdb to get what you want, 
but I don't know of any. 

With respect to (2), the gdb_command_funnel() function has a switch
statement for a list of several pre-existing "req->command" definitions,
but none of them pull out the actual names of text function arguments.  
I would guess that the argument name strings could be pulled out with
a new gdb helper function, but you'd have to write it yourself.  

Dave




More information about the Crash-utility mailing list