DWARF-5 basic functionality

binutils/
2017-02-23  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* dwarf.c (fetch_indirect_line_string): New function.
	(abbrev_attr): New field implicit_const.
	(add_abbrev_attr): New parameter implicit_const.
	(process_abbrev_section): Support DW_FORM_implicit_const.
	(decode_location_expression): Support DW_OP_entry_value.
	(read_and_display_attr_value): Add parameter implicit_const.  Support
	DW_FORM_line_strp and DW_FORM_implicit_const.
	(read_and_display_attr): Add parameter implicit_const.
	(process_debug_info): Support line_str and DWARF-5.
	(read_debug_line_header): Support DWARF-5.
	(display_formatted_table): New function.
	(display_debug_lines_raw): New parameter file.  Support DWARF-5.
	(display_debug_lines_decoded): New parameter fileptr.  Support DWARF-5.
	(display_debug_lines): Pass file parameter.
	(display_debug_macro): Update read_and_display_attr_value caller.
	(display_debug_abbrev): Support DW_FORM_implicit_const.
	(display_loclists_list): New function.
	(display_loc_list): Support .debug_loclists.
	(display_debug_ranges_list): New function from display_debug_ranges.
	(display_debug_rnglists_list): New function.
	(display_debug_ranges): Support .debug_rnglists.
	(debug_displays): Add .debug_line_str, .debug_loclists and
	.debug_rnglists.
	* dwarf.h: Include dwarf2.h
	(DWARF2_Internal_LineInfo): Add li_offset_size.
	(DWARF2_Internal_CompUnit): Add cu_unit_type.
	(enum dwarf_section_display_enum): Add line_str.
	* readelf.c (process_section_headers): Add rnglists and loclists.
This commit is contained in:
Jan Kratochvil 2017-02-23 22:54:01 +01:00
parent ef0b5f1c69
commit 77145576fa
4 changed files with 1005 additions and 215 deletions

View File

@ -1,3 +1,34 @@
2017-02-23 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf.c (fetch_indirect_line_string): New function.
(abbrev_attr): New field implicit_const.
(add_abbrev_attr): New parameter implicit_const.
(process_abbrev_section): Support DW_FORM_implicit_const.
(decode_location_expression): Support DW_OP_entry_value.
(read_and_display_attr_value): Add parameter implicit_const. Support
DW_FORM_line_strp and DW_FORM_implicit_const.
(read_and_display_attr): Add parameter implicit_const.
(process_debug_info): Support line_str and DWARF-5.
(read_debug_line_header): Support DWARF-5.
(display_formatted_table): New function.
(display_debug_lines_raw): New parameter file. Support DWARF-5.
(display_debug_lines_decoded): New parameter fileptr. Support DWARF-5.
(display_debug_lines): Pass file parameter.
(display_debug_macro): Update read_and_display_attr_value caller.
(display_debug_abbrev): Support DW_FORM_implicit_const.
(display_loclists_list): New function.
(display_loc_list): Support .debug_loclists.
(display_debug_ranges_list): New function from display_debug_ranges.
(display_debug_rnglists_list): New function.
(display_debug_ranges): Support .debug_rnglists.
(debug_displays): Add .debug_line_str, .debug_loclists and
.debug_rnglists.
* dwarf.h: Include dwarf2.h
(DWARF2_Internal_LineInfo): Add li_offset_size.
(DWARF2_Internal_CompUnit): Add cu_unit_type.
(enum dwarf_section_display_enum): Add line_str.
* readelf.c (process_section_headers): Add rnglists and loclists.
2017-02-23 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf.c (display_block): Add parameter delimiter.

File diff suppressed because it is too large Load Diff

View File

@ -18,6 +18,8 @@
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#include "dwarf2.h" /* for enum dwarf_unit_type */
typedef unsigned HOST_WIDEST_INT dwarf_vma;
typedef HOST_WIDEST_INT dwarf_signed_vma;
typedef unsigned HOST_WIDEST_INT dwarf_size_type;
@ -34,6 +36,7 @@ typedef struct
int li_line_base;
unsigned char li_line_range;
unsigned char li_opcode_base;
unsigned int li_offset_size;
}
DWARF2_Internal_LineInfo;
@ -54,6 +57,7 @@ typedef struct
unsigned short cu_version;
dwarf_vma cu_abbrev_offset;
unsigned char cu_pointer_size;
enum dwarf_unit_type cu_unit_type;
}
DWARF2_Internal_CompUnit;
@ -83,6 +87,7 @@ enum dwarf_section_display_enum
macinfo,
macro,
str,
line_str,
loc,
pubtypes,
gnu_pubtypes,

View File

@ -5962,11 +5962,13 @@ process_section_headers (FILE * file)
|| (do_debug_pubtypes && const_strneq (name, "gnu_pubtypes"))
|| (do_debug_aranges && const_strneq (name, "aranges"))
|| (do_debug_ranges && const_strneq (name, "ranges"))
|| (do_debug_ranges && const_strneq (name, "rnglists"))
|| (do_debug_frames && const_strneq (name, "frame"))
|| (do_debug_macinfo && const_strneq (name, "macinfo"))
|| (do_debug_macinfo && const_strneq (name, "macro"))
|| (do_debug_str && const_strneq (name, "str"))
|| (do_debug_loc && const_strneq (name, "loc"))
|| (do_debug_loc && const_strneq (name, "loclists"))
|| (do_debug_addr && const_strneq (name, "addr"))
|| (do_debug_cu_index && const_strneq (name, "cu_index"))
|| (do_debug_cu_index && const_strneq (name, "tu_index"))