Improve the DWARF decoder's ability to describe the DW_AT_discr_list attribute.

PR 24510
	* dwarf.c (MAX_CU_NESTING): New constant.
	(level_type_signed): New static array.
	(skip_attr_bytes): New function.
	(get_type_signedness): New function.
	(read_and_print_leb128): New function.
	(display_discr_list): New function.
	(read_and_display_attr_value): Add start parameter.
	Use new functions when handling DW_AT_type and DW_AT_discr_list.
	(read_and_display_attr): Add start parameter.  Pass to
	read_and_display_attr_value.
	(process_debug_info): Update call to read_and_display_attr.
	(display_formatted_table): Likewise.
	(display_debug_lines_decoded): Likewise.  Also add start
	parameter.
	(display_debug_lines): Likewise.
	* testsuite/binutils-all/dwarf-attributes.S: Update discrimination
	lists.
	* testsuite/binutils-all/dwarf-attributes.W: Update expected
	output.
This commit is contained in:
Nick Clifton
2019-08-27 16:28:55 +01:00
parent 4acfdd20c9
commit ec1b0fbb8d
4 changed files with 443 additions and 74 deletions

View File

@ -38,7 +38,7 @@
.byte 1 /* Inline: inlined. */
.byte 1 /* Accessibility: public. */
.byte 1 /* Calling convention: normal. */
.byte 1 /* Discriminate list: range. */
.byte 3,1,1,2 /* Discriminate list: range. */
.byte 1 /* Encoding: address. */
.byte 1 /* Identifier case: up. */
.byte 1 /* Virtuality: virtual. */
@ -53,7 +53,7 @@
.byte 0 /* Inline: not. */
.byte 2 /* Accessibility: protected. */
.byte 5 /* Calling convention: pass by value. */
.byte 0 /* Discriminate list: label. */
.byte 2,0,1 /* Discriminate list: label. */
.byte 0x12 /* Encoding: ASCII. */
.byte 0 /* Identifier case: sensitive. */
.byte 0 /* Virtuality: none. */
@ -68,7 +68,7 @@
.byte 3 /* Inline: declared. */
.byte 3 /* Accessibility: private. */
.byte 0x40 /* Calling convention: Renesas SH. */
.byte 1 /* Discriminate list: range. */
.byte 5,1,2,3,0,4 /* Discriminate list: range and label. */
.byte 0x81 /* Encoding: user specified. */
.byte 3 /* Identifier case: insensitive. */
.byte 2 /* Virtuality: pure. */
@ -107,7 +107,7 @@
.uleb128 0x0b /* (DW_FORM_data1) */
.uleb128 0x3d /* (DW_AT_discr_lists) */
.uleb128 0x0b /* (DW_FORM_data1) */
.uleb128 0x0a /* (DW_FORM_block1) */
.uleb128 0x3e /* (DW_AT_encoding) */
.uleb128 0x0b /* (DW_FORM_data1) */