[Crash-utility] How to fire crash command from extension directly

Vivek Satpute vivekonline86 at gmail.com
Tue Feb 19 15:18:57 UTC 2013


Hi Dave,

Thank you so much for responding to the query.

If its printing backtrace then calling back_trace() would suffice. But I
have few global structures that can be printed in crash by just their name.
e.g.  struct xyz  object;  Where its member is "int i"
Above declaration is global so in crash I can simply dump its contents as
below (provided object symbols are loaded in crash)
crash>object   <ENTER>
object = {
i = 0;
}


So I want to achieve same thing via crash extension as I have too many
structures that I want to dump.
Any suggestions how it can be achieved ?


Thanks and Regards,
Vivek Satpute



On Tue, Feb 19, 2013 at 8:20 PM, Dave Anderson <anderson at redhat.com> wrote:

>
>
> ----- Original Message -----
> >
> > Hi,
> >
> > I have written crash extension(shared-object) for dumping few data
> structures from crash. I want to trigger
> > standard crash command e.g. "bt", from crash extension itself. Can
> anyone please help me
> > out, how can it be achieved ? I am using APIs exported by crash  header
> file defs.h
> >
> > Your valuable suggestions would be helpful for me.
> >
> >
> > Thanks in advance.
> > Vivek Satpute
>
> Calling a crash command from within another command is not supported.
>
> You *may* be able to get away with calling a "cmd_xxx()" function,
> depending upon how the global optind and optarg values, and
> the global argcnt and args[] array have been manipulated by your
> extension command.
>
> The better option is to call the worker functions that the cmd_xxx()
> functions utilize -- if that's possible.  In the case of "bt" you
> could call the exported back_trace() function, similar to the
> way that the "foreach" command does it in foreach() function.
>
> Dave
>
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20130219/359d6f32/attachment.htm>


More information about the Crash-utility mailing list