Hi I am working on a feature to provide crash tool an ability to print function arguments. Currently the best way, architecture independent and scalable, to implement the feature is through dwarf routines. I am facing some challenges with the implementation and need your advice and guidance to take it further from here.
I am facing challenges primarily in these 3 areas: 1. Design of the application: Since I was not able to find a good documentation I was not able to validate the code design. If some one can review and provide me guidance it will help me immensely. Challenges are a. Efficient way of accessing the function/subprogram DIE (Debug Information Entry) in an executable that contains multiple Complier Units (CU) b. Is the sequence of dwarf API calls appropriate c. Scalability of the application, especially architecture dependency I am attaching the code that I have developed please review it and let me know if the design is appropriate. The code is not formatted but has been written purely for understanding purpose.
2. Converting the address mentioned in DW_AT_location to actual address of the local variable/arguments. System tap function literal_stmt_for_local() has an implementation for this, I am going thorough this some help in this direction will help me immensly.
3. Converting the address generated from DW_AT_location to actual address in vmcore dump. I am assuming the address we get from the dwarf tag will be a virtual address and that needs to be mapped to a location at vmocre file. crash tool has a routine readmem(), I am currently looking into it for probable solution.
Please let me know your thoughts and ideas on these and in general about the implementation
Thanks Yeehaw