From 2e9e81a8f5f5870900b815b947ad1cbad0a07333 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 20 Dec 2013 13:52:23 +0000 Subject: [PATCH] PR binutils/16218 * dwarf.c (read_and_display_attr_value): Only print a tab character if it preceeds further text. * binutils-all/dw2-1.W: Update expected objdump output. * binutils-all/i386/compressed-1a.d: Likewise. * binutils-all/objdump.W: Likewise. * binutils-all/x86-64/compressed-1a.d: Likewise. * gas/elf/dwarf2-1.d: Update expected objdump output. * gas/elf/dwarf2-2.d: Likewise. * gas/i386/dw2-compress-1.d: Likewise. --- binutils/ChangeLog | 6 ++++ binutils/dwarf.c | 17 +++++++--- binutils/testsuite/ChangeLog | 8 +++++ binutils/testsuite/binutils-all/dw2-1.W | 28 ++++++++--------- .../testsuite/binutils-all/i386/compressed-1a.d | 36 +++++++++++----------- binutils/testsuite/binutils-all/objdump.W | 28 ++++++++--------- .../testsuite/binutils-all/x86-64/compressed-1a.d | 36 +++++++++++----------- gas/testsuite/ChangeLog | 7 +++++ gas/testsuite/gas/elf/dwarf2-1.d | 28 ++++++++--------- gas/testsuite/gas/elf/dwarf2-2.d | 28 ++++++++--------- gas/testsuite/gas/i386/dw2-compress-1.d | 28 ++++++++--------- 11 files changed, 139 insertions(+), 111 deletions(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index b2bc1a7..04ad95c 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2013-12-20 Nick Clifton + + PR binutils/16218 + * dwarf.c (read_and_display_attr_value): Only print a tab + character if it preceeds further text. + 2013-12-19 Tom Tromey * dwarf.c (fetch_indirect_string): Don't bias by section address. diff --git a/binutils/dwarf.c b/binutils/dwarf.c index c0b18ff..1a62d9f 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -1805,11 +1805,10 @@ read_and_display_attr_value (unsigned long attribute, return data; /* For some attributes we can display further information. */ - printf ("\t"); - switch (attribute) { case DW_AT_inline: + printf ("\t"); switch (uvalue) { case DW_INL_not_inlined: @@ -1832,6 +1831,7 @@ read_and_display_attr_value (unsigned long attribute, break; case DW_AT_language: + printf ("\t"); switch (uvalue) { /* Ordered by the numeric value of these constants. */ @@ -1875,6 +1875,7 @@ read_and_display_attr_value (unsigned long attribute, break; case DW_AT_encoding: + printf ("\t"); switch (uvalue) { case DW_ATE_void: printf ("(void)"); break; @@ -1915,6 +1916,7 @@ read_and_display_attr_value (unsigned long attribute, break; case DW_AT_accessibility: + printf ("\t"); switch (uvalue) { case DW_ACCESS_public: printf ("(public)"); break; @@ -1927,6 +1929,7 @@ read_and_display_attr_value (unsigned long attribute, break; case DW_AT_visibility: + printf ("\t"); switch (uvalue) { case DW_VIS_local: printf ("(local)"); break; @@ -1937,6 +1940,7 @@ read_and_display_attr_value (unsigned long attribute, break; case DW_AT_virtuality: + printf ("\t"); switch (uvalue) { case DW_VIRTUALITY_none: printf ("(none)"); break; @@ -1947,6 +1951,7 @@ read_and_display_attr_value (unsigned long attribute, break; case DW_AT_identifier_case: + printf ("\t"); switch (uvalue) { case DW_ID_case_sensitive: printf ("(case_sensitive)"); break; @@ -1958,6 +1963,7 @@ read_and_display_attr_value (unsigned long attribute, break; case DW_AT_calling_convention: + printf ("\t"); switch (uvalue) { case DW_CC_normal: printf ("(normal)"); break; @@ -1973,6 +1979,7 @@ read_and_display_attr_value (unsigned long attribute, break; case DW_AT_ordering: + printf ("\t"); switch (uvalue) { case -1: printf (_("(undefined)")); break; @@ -1998,7 +2005,7 @@ read_and_display_attr_value (unsigned long attribute, if ((dwarf_version < 4 && (form == DW_FORM_data4 || form == DW_FORM_data8)) || form == DW_FORM_sec_offset) - printf (_("(location list)")); + printf (_(" (location list)")); /* Fall through. */ case DW_AT_allocated: case DW_AT_associated: @@ -2010,7 +2017,7 @@ read_and_display_attr_value (unsigned long attribute, { int need_frame_base; - printf ("("); + printf ("\t("); need_frame_base = decode_location_expression (block_start, pointer_size, offset_size, @@ -2046,7 +2053,7 @@ read_and_display_attr_value (unsigned long attribute, abbrev_number = read_uleb128 (section->start + uvalue, NULL, end); - printf (_("[Abbrev Number: %ld"), abbrev_number); + printf (_("\t[Abbrev Number: %ld"), abbrev_number); /* Don't look up abbrev for DW_FORM_ref_addr, as it very often will use different abbrev table, and we don't track .debug_info chunks yet. */ diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog index a1e6724..45defaf 100644 --- a/binutils/testsuite/ChangeLog +++ b/binutils/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2013-12-20 Nick Clifton + + PR binutils/16218 + * binutils-all/dw2-1.W: Update expected objdump output. + * binutils-all/i386/compressed-1a.d: Likewise. + * binutils-all/objdump.W: Likewise. + * binutils-all/x86-64/compressed-1a.d: Likewise. + 2013-12-19 H.J. Lu PR binutils/16317 diff --git a/binutils/testsuite/binutils-all/dw2-1.W b/binutils/testsuite/binutils-all/dw2-1.W index 85ce9dd..3811019 100644 --- a/binutils/testsuite/binutils-all/dw2-1.W +++ b/binutils/testsuite/binutils-all/dw2-1.W @@ -9,24 +9,24 @@ Contents of the .debug_info section: Abbrev Offset: 0x0 Pointer Size: 4 <0>: Abbrev Number: 1 \(DW_TAG_compile_unit\) - DW_AT_stmt_list : 0x0 - <10> DW_AT_high_pc : 0x. - <14> DW_AT_low_pc : 0x. - <18> DW_AT_name : file1.txt - <22> DW_AT_producer : GNU C 3.3.3 + DW_AT_stmt_list : 0x0 + <10> DW_AT_high_pc : 0x. + <14> DW_AT_low_pc : 0x. + <18> DW_AT_name : file1.txt + <22> DW_AT_producer : GNU C 3.3.3 <2e> DW_AT_language : 1 \(ANSI C\) <1><2f>: Abbrev Number: 2 \(DW_TAG_subprogram\) - <30> DW_AT_external : 1 - <31> DW_AT_decl_file : 1 - <32> DW_AT_decl_line : 2 - <33> DW_AT_name : func_cu1 - <3c> DW_AT_type : <0x4a> - <40> DW_AT_low_pc : 0x. - <44> DW_AT_high_pc : 0x. + <30> DW_AT_external : 1 + <31> DW_AT_decl_file : 1 + <32> DW_AT_decl_line : 2 + <33> DW_AT_name : func_cu1 + <3c> DW_AT_type : <0x4a> + <40> DW_AT_low_pc : 0x. + <44> DW_AT_high_pc : 0x. <48> DW_AT_frame_base : 1 byte block: 55 \(DW_OP_reg5 \([^()]*\)\) <1><4a>: Abbrev Number: 3 \(DW_TAG_base_type\) - <4b> DW_AT_name : int - <4f> DW_AT_byte_size : 4 + <4b> DW_AT_name : int + <4f> DW_AT_byte_size : 4 <50> DW_AT_encoding : 5 \(signed\) <1><51>: Abbrev Number: 0 diff --git a/binutils/testsuite/binutils-all/i386/compressed-1a.d b/binutils/testsuite/binutils-all/i386/compressed-1a.d index f1883aa..5f02def 100644 --- a/binutils/testsuite/binutils-all/i386/compressed-1a.d +++ b/binutils/testsuite/binutils-all/i386/compressed-1a.d @@ -35,28 +35,28 @@ Contents of the .[z]?debug_info section: Abbrev Offset: 0x0 Pointer Size: 4 <0>: Abbrev Number: 1 \(DW_TAG_compile_unit\) - DW_AT_producer : \(indirect string, offset: 0x0\): GNU C 4.4.4 + DW_AT_producer : \(indirect string, offset: 0x0\): GNU C 4.4.4 <10> DW_AT_language : 1 \(ANSI C\) - <11> DW_AT_name : \(indirect string, offset: 0x18\): compressed-1.c - <15> DW_AT_comp_dir : \(indirect string, offset: 0x16\): . - <19> DW_AT_low_pc : 0x0 - <1d> DW_AT_high_pc : 0x1b - <21> DW_AT_stmt_list : 0x0 + <11> DW_AT_name : \(indirect string, offset: 0x18\): compressed-1.c + <15> DW_AT_comp_dir : \(indirect string, offset: 0x16\): . + <19> DW_AT_low_pc : 0x0 + <1d> DW_AT_high_pc : 0x1b + <21> DW_AT_stmt_list : 0x0 <1><25>: Abbrev Number: 2 \(DW_TAG_subprogram\) - <26> DW_AT_external : 1 - <27> DW_AT_name : \(indirect string, offset: 0xc\): foo2 - <2b> DW_AT_decl_file : 1 - <2c> DW_AT_decl_line : 10 - <2d> DW_AT_low_pc : 0x0 - <31> DW_AT_high_pc : 0x2 + <26> DW_AT_external : 1 + <27> DW_AT_name : \(indirect string, offset: 0xc\): foo2 + <2b> DW_AT_decl_file : 1 + <2c> DW_AT_decl_line : 10 + <2d> DW_AT_low_pc : 0x0 + <31> DW_AT_high_pc : 0x2 <35> DW_AT_frame_base : 1 byte block: 9c \(DW_OP_call_frame_cfa\) <1><37>: Abbrev Number: 2 \(DW_TAG_subprogram\) - <38> DW_AT_external : 1 - <39> DW_AT_name : \(indirect string, offset: 0x11\): foo1 - <3d> DW_AT_decl_file : 1 - <3e> DW_AT_decl_line : 4 - <3f> DW_AT_low_pc : 0x10 - <43> DW_AT_high_pc : 0x1b + <38> DW_AT_external : 1 + <39> DW_AT_name : \(indirect string, offset: 0x11\): foo1 + <3d> DW_AT_decl_file : 1 + <3e> DW_AT_decl_line : 4 + <3f> DW_AT_low_pc : 0x10 + <43> DW_AT_high_pc : 0x1b <47> DW_AT_frame_base : 1 byte block: 9c \(DW_OP_call_frame_cfa\) <1><49>: Abbrev Number: 0 diff --git a/binutils/testsuite/binutils-all/objdump.W b/binutils/testsuite/binutils-all/objdump.W index f544d82..48dde48 100644 --- a/binutils/testsuite/binutils-all/objdump.W +++ b/binutils/testsuite/binutils-all/objdump.W @@ -9,24 +9,24 @@ Contents of the .debug_info section: Abbrev Offset: 0x0 Pointer Size: 4 <0>: Abbrev Number: 1 \(DW_TAG_compile_unit\) - DW_AT_stmt_list : 0x0 - <10> DW_AT_high_pc : 0x. - <14> DW_AT_low_pc : 0x. - <18> DW_AT_name : file1.txt - <22> DW_AT_producer : GNU C 3.3.3 + DW_AT_stmt_list : 0x0 + <10> DW_AT_high_pc : 0x. + <14> DW_AT_low_pc : 0x. + <18> DW_AT_name : file1.txt + <22> DW_AT_producer : GNU C 3.3.3 <2e> DW_AT_language : 1 \(ANSI C\) <1><2f>: Abbrev Number: 2 \(DW_TAG_subprogram\) - <30> DW_AT_external : 1 - <31> DW_AT_decl_file : 1 - <32> DW_AT_decl_line : 2 - <33> DW_AT_name : func_cu1 - <3c> DW_AT_type : <0x4a> - <40> DW_AT_low_pc : 0x. - <44> DW_AT_high_pc : 0x. + <30> DW_AT_external : 1 + <31> DW_AT_decl_file : 1 + <32> DW_AT_decl_line : 2 + <33> DW_AT_name : func_cu1 + <3c> DW_AT_type : <0x4a> + <40> DW_AT_low_pc : 0x. + <44> DW_AT_high_pc : 0x. <48> DW_AT_frame_base : 1 byte block: 55 \(DW_OP_reg5 \([^()]*\)\) <1><4a>: Abbrev Number: 3 \(DW_TAG_base_type\) - <4b> DW_AT_name : int - <4f> DW_AT_byte_size : 4 + <4b> DW_AT_name : int + <4f> DW_AT_byte_size : 4 <50> DW_AT_encoding : 5 \(signed\) <1><51>: Abbrev Number: 0 diff --git a/binutils/testsuite/binutils-all/x86-64/compressed-1a.d b/binutils/testsuite/binutils-all/x86-64/compressed-1a.d index 19471ab..574b719 100644 --- a/binutils/testsuite/binutils-all/x86-64/compressed-1a.d +++ b/binutils/testsuite/binutils-all/x86-64/compressed-1a.d @@ -35,28 +35,28 @@ Contents of the .[z]?debug_info section: Abbrev Offset: 0x0 Pointer Size: 8 <0>: Abbrev Number: 1 \(DW_TAG_compile_unit\) - DW_AT_producer : \(indirect string, offset: 0x0\): GNU C 4.4.4 + DW_AT_producer : \(indirect string, offset: 0x0\): GNU C 4.4.4 <10> DW_AT_language : 1 \(ANSI C\) - <11> DW_AT_name : \(indirect string, offset: 0x18\): compressed-1.c - <15> DW_AT_comp_dir : \(indirect string, offset: 0x16\): . - <19> DW_AT_low_pc : 0x0 - <21> DW_AT_high_pc : 0x15 - <29> DW_AT_stmt_list : 0x0 + <11> DW_AT_name : \(indirect string, offset: 0x18\): compressed-1.c + <15> DW_AT_comp_dir : \(indirect string, offset: 0x16\): . + <19> DW_AT_low_pc : 0x0 + <21> DW_AT_high_pc : 0x15 + <29> DW_AT_stmt_list : 0x0 <1><2d>: Abbrev Number: 2 \(DW_TAG_subprogram\) - <2e> DW_AT_external : 1 - <2f> DW_AT_name : \(indirect string, offset: 0xc\): foo2 - <33> DW_AT_decl_file : 1 - <34> DW_AT_decl_line : 10 - <35> DW_AT_low_pc : 0x0 - <3d> DW_AT_high_pc : 0x2 + <2e> DW_AT_external : 1 + <2f> DW_AT_name : \(indirect string, offset: 0xc\): foo2 + <33> DW_AT_decl_file : 1 + <34> DW_AT_decl_line : 10 + <35> DW_AT_low_pc : 0x0 + <3d> DW_AT_high_pc : 0x2 <45> DW_AT_frame_base : 1 byte block: 9c \(DW_OP_call_frame_cfa\) <1><47>: Abbrev Number: 2 \(DW_TAG_subprogram\) - <48> DW_AT_external : 1 - <49> DW_AT_name : \(indirect string, offset: 0x11\): foo1 - <4d> DW_AT_decl_file : 1 - <4e> DW_AT_decl_line : 4 - <4f> DW_AT_low_pc : 0x10 - <57> DW_AT_high_pc : 0x15 + <48> DW_AT_external : 1 + <49> DW_AT_name : \(indirect string, offset: 0x11\): foo1 + <4d> DW_AT_decl_file : 1 + <4e> DW_AT_decl_line : 4 + <4f> DW_AT_low_pc : 0x10 + <57> DW_AT_high_pc : 0x15 <5f> DW_AT_frame_base : 1 byte block: 9c \(DW_OP_call_frame_cfa\) <1><61>: Abbrev Number: 0 diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index bbce101..504642e 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2013-12-20 Nick Clifton + + PR binutils/16218 + * gas/elf/dwarf2-1.d: Update expected objdump output. + * gas/elf/dwarf2-2.d: Likewise. + * gas/i386/dw2-compress-1.d: Likewise. + 2013-12-19 H.J. Lu * gas/i386/i386.exp: Don't run x86-64-disassem for mingw targets. diff --git a/gas/testsuite/gas/elf/dwarf2-1.d b/gas/testsuite/gas/elf/dwarf2-1.d index 2b9e5be..bae2f63 100644 --- a/gas/testsuite/gas/elf/dwarf2-1.d +++ b/gas/testsuite/gas/elf/dwarf2-1.d @@ -11,24 +11,24 @@ Contents of the .[z]?debug_info section: Abbrev Offset: 0x0 Pointer Size: 4 <0>: Abbrev Number: 1 \(DW_TAG_compile_unit\) - DW_AT_stmt_list : 0x0 - <10> DW_AT_high_pc : 0x. - <14> DW_AT_low_pc : 0x. - <18> DW_AT_name : file1.txt - <22> DW_AT_producer : GNU C 3.3.3 + DW_AT_stmt_list : 0x0 + <10> DW_AT_high_pc : 0x. + <14> DW_AT_low_pc : 0x. + <18> DW_AT_name : file1.txt + <22> DW_AT_producer : GNU C 3.3.3 <2e> DW_AT_language : 1 \(ANSI C\) <1><2f>: Abbrev Number: 2 \(DW_TAG_subprogram\) - <30> DW_AT_external : 1 - <31> DW_AT_decl_file : 1 - <32> DW_AT_decl_line : 2 - <33> DW_AT_name : func_cu1 - <3c> DW_AT_type : <0x4a> - <40> DW_AT_low_pc : 0x. - <44> DW_AT_high_pc : 0x. + <30> DW_AT_external : 1 + <31> DW_AT_decl_file : 1 + <32> DW_AT_decl_line : 2 + <33> DW_AT_name : func_cu1 + <3c> DW_AT_type : <0x4a> + <40> DW_AT_low_pc : 0x. + <44> DW_AT_high_pc : 0x. <48> DW_AT_frame_base : 1 byte block: 55 \(DW_OP_reg5 \([^()]*\)\) <1><4a>: Abbrev Number: 3 \(DW_TAG_base_type\) - <4b> DW_AT_name : int - <4f> DW_AT_byte_size : 4 + <4b> DW_AT_name : int + <4f> DW_AT_byte_size : 4 <50> DW_AT_encoding : 5 \(signed\) <1><51>: Abbrev Number: 0 diff --git a/gas/testsuite/gas/elf/dwarf2-2.d b/gas/testsuite/gas/elf/dwarf2-2.d index dffcda0..b42a2ec 100644 --- a/gas/testsuite/gas/elf/dwarf2-2.d +++ b/gas/testsuite/gas/elf/dwarf2-2.d @@ -11,24 +11,24 @@ Contents of the .[z]?debug_info section: Abbrev Offset: 0x0 Pointer Size: 4 <0>: Abbrev Number: 1 \(DW_TAG_compile_unit\) - DW_AT_stmt_list : 0x0 - <10> DW_AT_high_pc : 0x. - <14> DW_AT_low_pc : 0x. - <18> DW_AT_name : file1.txt - <22> DW_AT_producer : GNU C 3.3.3 + DW_AT_stmt_list : 0x0 + <10> DW_AT_high_pc : 0x. + <14> DW_AT_low_pc : 0x. + <18> DW_AT_name : file1.txt + <22> DW_AT_producer : GNU C 3.3.3 <2e> DW_AT_language : 1 \(ANSI C\) <1><2f>: Abbrev Number: 2 \(DW_TAG_subprogram\) - <30> DW_AT_external : 1 - <31> DW_AT_decl_file : 1 - <32> DW_AT_decl_line : 2 - <33> DW_AT_name : func_cu1 - <3c> DW_AT_type : <0x4a> - <40> DW_AT_low_pc : 0x. - <44> DW_AT_high_pc : 0x. + <30> DW_AT_external : 1 + <31> DW_AT_decl_file : 1 + <32> DW_AT_decl_line : 2 + <33> DW_AT_name : func_cu1 + <3c> DW_AT_type : <0x4a> + <40> DW_AT_low_pc : 0x. + <44> DW_AT_high_pc : 0x. <48> DW_AT_frame_base : 1 byte block: 55 \(DW_OP_reg5 \([^()]*\)\) <1><4a>: Abbrev Number: 3 \(DW_TAG_base_type\) - <4b> DW_AT_name : int - <4f> DW_AT_byte_size : 4 + <4b> DW_AT_name : int + <4f> DW_AT_byte_size : 4 <50> DW_AT_encoding : 5 \(signed\) <1><51>: Abbrev Number: 0 diff --git a/gas/testsuite/gas/i386/dw2-compress-1.d b/gas/testsuite/gas/i386/dw2-compress-1.d index 76dea43..4d1a393 100644 --- a/gas/testsuite/gas/i386/dw2-compress-1.d +++ b/gas/testsuite/gas/i386/dw2-compress-1.d @@ -10,24 +10,24 @@ Contents of the .zdebug_info section: Abbrev Offset: 0x0 Pointer Size: 4 <0>: Abbrev Number: 1 \(DW_TAG_compile_unit\) - DW_AT_stmt_list : 0x0 - <10> DW_AT_high_pc : 0x4 - <14> DW_AT_low_pc : 0x0 - <18> DW_AT_name : file1.txt - <22> DW_AT_producer : GNU C 3.3.3 + DW_AT_stmt_list : 0x0 + <10> DW_AT_high_pc : 0x4 + <14> DW_AT_low_pc : 0x0 + <18> DW_AT_name : file1.txt + <22> DW_AT_producer : GNU C 3.3.3 <2e> DW_AT_language : 1 \(ANSI C\) <1><2f>: Abbrev Number: 2 \(DW_TAG_subprogram\) - <30> DW_AT_external : 1 - <31> DW_AT_decl_file : 1 - <32> DW_AT_decl_line : 2 - <33> DW_AT_name : func_cu1 - <3c> DW_AT_type : <0x4a> - <40> DW_AT_low_pc : 0x0 - <44> DW_AT_high_pc : 0x4 + <30> DW_AT_external : 1 + <31> DW_AT_decl_file : 1 + <32> DW_AT_decl_line : 2 + <33> DW_AT_name : func_cu1 + <3c> DW_AT_type : <0x4a> + <40> DW_AT_low_pc : 0x0 + <44> DW_AT_high_pc : 0x4 <48> DW_AT_frame_base : 1 byte block: 55 \(DW_OP_reg5 \([^()]*\)\) <1><4a>: Abbrev Number: 3 \(DW_TAG_base_type\) - <4b> DW_AT_name : int - <4f> DW_AT_byte_size : 4 + <4b> DW_AT_name : int + <4f> DW_AT_byte_size : 4 <50> DW_AT_encoding : 5 \(signed\) <1><51>: Abbrev Number: 0 -- 2.7.4