summaryrefslogtreecommitdiff
path: root/dwarf_info.c
Commit message (Collapse)AuthorAge
* [PATCH] eppic: Add support to module data structures.Aravinda Prasad2014-03-03
| | | | | | | | | | | | | | | | | | | | | | When trying to refer a module data structure GET_DIE_NFIELDS does not set the dwarf_info to the right module. For instance: struct ap_device { ... struct list_head list; ... }; struct ap_device *dev; As a result, it was able to resolve only dev->list and it was failing to resolve dev->list.next. The patch takes care of handling this by introducing GET_DIE_NFIELDS_ALL which takes care of setting the dwarf_info to the appropriate module. Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com>
* [PATCH] eppic: Properly resolve structure members.Aravinda Prasad2014-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | makedumpfile/eppic was not able to resolve member of the structure in cases such as: struct abc { ... ... struct xyz ... } and eppic script: sample() { struct abc *a; struct xyz *x; x->member; } would fail to resolve "member" of structure xyz. However it works if "struct abc *a;" line is removed from eppic script. This patch fixes this issue. Signed-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
* [PATCH v3 7/7] Use elf_getshdrstrndx() instead of elf_getshstrndx().Daniel Kiper2013-07-23
| | | | | | | Use elf_getshdrstrndx() instead of elf_getshstrndx() because later is marked as deprecated. Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
* [PATCH v3 6/7] Mute some compiler warnings.Daniel Kiper2013-07-23
| | | | | | | | | | | | | | This patch mutes follwing compiler warnings: - warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default], - warning: variable ‘page_offset’ set but not used [-Wunused-but-set-variable]. v2 - suggestions/fixes: - do not discard a const qualifier (suggested by Andrew Cooper). Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
* [PATCH] Warn on vmlinux without dwarf.Cliff Wickman2013-05-21
| | | | | | | | | | | | | If the vmlinux does not have dwarf information makedumpfile fails in a rather obscure way, with a flood of redundant errors, Make it fail with more of a hint of what is wrong. Signed-off-by: Cliff Wickman <cpw@sgi.com> Replace exit(1) with "return DWARF_CB_ABORT". Signed-off-by: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
* [PATCH] Close the dwfl handle before next invocation of init_dwarf_info().Mahesh J Salgaonkar2013-04-18
| | | | | | | | | | | | | | | | | | | | | | | | The init_dwarf_info() function initializes "dwarf_info.dwfl" handle everytime when it is called. The "dwarf_info.dwfl" handle should be freed once we are done with searching of desired debuginfo and before next invocation of init_dwarf_info(). Most of the functions (e.g get_debug_info()) that invokes init_dwarf_info() also invokes clean_dwfl_info() to free dwfl handle. But the function get_die_from_offset() that invokes init_dwarf_info(), does not free the dwfl handle and hence it keeps re-reading debuginfo ELF section into memory every time it is invoked until it starts failing with following errors: init_dwarf_info: Can't get first elf header of /usr/lib/debug/boot/vmlinux-x.x.x get_die_attr_type: Can't find the DIE. init_dwarf_info: Can't get first elf header of /usr/lib/debug/boot/vmlinux-x.x.x init_dwarf_info: Can't get first elf header of /usr/lib/debug/boot/vmlinux-x.x.x File eppic_macro/key.c, line 32, Error: Oops! Var ref1.[keyring_name_hash] This patch makes sure that clean_dwfl_info() is called once we are done with the debuginfo search. Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
* [PATCH v4 7/9] Support fully typed symbol access mode.Aravinda Prasad2013-02-05
| | | | | | | | | | | | | | | | | | | | | Eppic enables access to symbols in two ways. The first, is a more natural mode in that it makes symbols available as fully typed entities. The second, is generic and treats all symbols as an address to data which then needs to be cast to the proper type explicitly. The former obviously enables an easier cut & pasting of target code into eppic code. Currently generic symbol access mode is supported. This patch extends the functionality to include support for fully typed symbol access mode (which will be the default mode) in eppic macros. User can switch to generic symbol access mode by setting the following environmental variable - EPPIC_LEGACY_MODE. libeppic.a will take care of handling EPPIC_LEGACY_MODE. libeppic.a will pass NULL to VALUE_S* argument of apigetval() call back function if EPPIC_LEGACY_MODE is set. Refer to http://code.google.com/p/eppic/ for more information. Signed-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
* [PATCH v4 5/9] Implement apimember and apigetrtype call back functions.Aravinda Prasad2013-02-05
| | | | | | | | | | | | | | | The patch includes functionality for apimember and apigetrtype eppic callback routines along with helper functions to fetch information related to the member of the structure/union Whenever a structure/union member is accessed inside the eppic macro, eppic will query makedumpfile through call back functions requesting more information on the structure or union member. The information includes member name, offset from structure, data type and size. makedumpfile will get all these information using DWARF and pass back to eppic using libeppic API calls. Signed-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
* [PATCH v4 4/9] Implement apigetctype call back function.Aravinda Prasad2013-02-05
| | | | | | | | | | libeppic will call apigetctype call back function whenever it encounters a token in the eppic macro. The call back function will use DWARF to query information related to the requested token and will pass it back to eppic using libeppic API calls. If the token does not exist, then apigetctype call returns 0. Signed-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
* [PATCH v2 02/10] Add debuginfo interface for enum type size.HATAYAMA Daisuke2012-11-22
| | | | | | | | | | | | | This is need to determine if a specified enumeration type is present in a given debug information. In this patch set, I'll use this to check if enum pageflags is present. The newly introduced interface is a simple extension from the existing one for enumeration value. Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
* [PATCH] Change dwarf analyzer to search also into named containers.Atsushi Kumagai2012-11-16
| | | | | | | | | | | | | | | | search_member() has been changed to get the offset of anonymous members by the following commit, but we should treat containers even which are named. ---------------------------------------------------------------------- commit ecff242c59bae6052d758ce6f785931745d5effd Author: Stefan Bader <stefan.bader@canonical.com> Date: Wed Sep 5 16:10:30 2012 +0900 [PATCH] Generic search into anonymous members in search_member(). ---------------------------------------------------------------------- Signed-off-by: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
* [PATCH] Generic search into anonymous members in search_member().Stefan Bader2012-09-06
| | | | | | | | | | | | | | There was a special case to find page.mapping in case it would be inside an anonymous union.struct. But recent kernel versions also moved page._count into the depths of some unnamed elements. Naturally not the same as page.mapping. So this tries to approach the problem by implementing a generic method of descending into anonymous sub-members. If this finds a member and it is the member offset that is the target of the search, that offset has to be adjusted on the way back out. Signed-off-by: Stefan Bader <stefan.bader@canonical.com> Signed-off-by: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
* [PATCH] Fix segmentation fault for makedumpfile -x/--split.Aruna Balakrishnaiah2012-02-21
| | | | | | | | | | | | The patch fixes the segmentation fault issue of makedumpfile when a user specifies an invalid file name with -x/--split option. The patch takes care of such a scenario by setting .find_debuginfo to a function pointer which returns -1 and throws error messages against invalid vmlinux file input. With a valid vmlinux file .find_debuginfo was never invoked since the absolute path of debuginfo was known by the time we call init_dwarf_info. Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com>
* [PATCH] Fix array traversal for array of structure and char type.Mahesh Salgaonkar2011-09-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce new function get_next_list_entry() that returns config entry for each element in the LIST entry. This approach improves the handling of LIST entry. With this change the function get_config_symbol_addr() no longer required to handle LIST entry separately. This patch fixes following BUGs: - If the loop construct is used for array of structures (non-pointer), then the array index value is not incremented resulting in an infinite loop. This patch fixes this BUG. - The loop construct used for array of char* (pointer) silently fails and does not filter the strings. - Corrected 2nd argument while calling get_structure_size(). - Fixed dwarf_info.c:get_data_array_length() to handle array of const data type. e.g. <1><1a49df3>: Abbrev Number: 90 (DW_TAG_variable) <1a49df4> DW_AT_name : policycap_names <1a49df8> DW_AT_decl_file : 1 <1a49df9> DW_AT_decl_line : 43 <1a49dfa> DW_AT_type : <0x1a49e08> <1><1a49e08>: Abbrev Number: 7 (DW_TAG_const_type) <1a49e09> DW_AT_type : <0x1a49de3> <1><1a49de3>: Abbrev Number: 4 (DW_TAG_array_type) <1a49de4> DW_AT_type : <0x1a3b276> <1a49de8> DW_AT_sibling : <0x1a49df3> Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
* [PATCH] Cleanup: Add dwarf_info.c for reducing makedumpfile.cKen'ichi Ohmichi2011-09-07
makedumpfile.c becomes big and the readability is not good. To reduce the code of makedumpfile.c, this patch adds dwarf_info.c. We need some other patches for the same purpose. Signed-off-by: Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>