[Crash-utility] [RFC]: Feature to display local arguments and variables

Sharyathi Nagesh sharyath at in.ibm.com
Wed Apr 15 19:01:49 UTC 2009


Hi
    We have implemented this piece of code to provide, crash tool, 
capability to display local variables and arguments. We would kindly 
request you to provide your feedback and guidance on this code so that 
we can take it further

How to Build/Requirements
1. Enable compiling extends option in main Makefile
2. create a symbolic link to netdump.h under extensions/
3. This feature makes use of libelf and libdw libraries provided by 
elfutils package.
4, This feature is implemented as an extend, local.so library needs to 
be loaded once crash prompt is available

Features
1. Currently it has feature to display arguments/locals of top most 
stack frame. ex usage: local params or local locals
2. Currently code can analyze only ppc64 dumps
3. It displays the current address of the local variables ( and some 
times direct values when the variables are stored in register and not in 
stack frame)
4. In case of code optimization, variable information is not available 
at that time printing "Failed to fetch information" (This is in 
accordance with gdb out put)

TBD
1. Stack unwinding code is still need to be implemented
2. Support for x86 dumps is still not provided
3. Context switching via -r command still needs to implemented

Note: We were planning to display the variable values instead of 
addresses as we are doing currently, but it adds up to additional 
challenges in terms of typecasting the variables, in case it is array or 
structure, so for the time being we are printing only address and expect 
user to dump contents using rd command. Suggestions here will be very 
helpful.

Attaching the code...but the Code is not extensively tested
please let us know your thoughts

Thanks
Sharyathi Nagesh



-------------- next part --------------
A non-text attachment was scrubbed...
Name: crash_feature_print_locals.patch
Type: text/x-diff
Size: 14265 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20090416/7f1a2ff8/attachment.bin>


More information about the Crash-utility mailing list