From 5c6692ceeaaf77e554956dd7c4595203dcac9b69 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Wed, 29 May 2013 00:39:32 +0000 Subject: binutils/ * dwarf.c (display_debug_lines_raw): Print section offsets. binutils/testsuite/ * binutils-all/dw2-1.W: Adjust expected output. * binutils-all/objdump.W: Likewise. * binutils-all/i386/compressed-1a.d: Likewise. * binutils-all/x86-64/compressed-1a.d: Likewise. gas/testsuite/ * gas/cris/rd-dw2-1.d: Adjust expected output. * gas/cris/rd-dw2-10.d: Likewise. * gas/cris/rd-dw2-11.d: Likewise. * gas/cris/rd-dw2-12.d: Likewise. * gas/cris/rd-dw2-13.d: Likewise. * gas/cris/rd-dw2-14.d: Likewise. * gas/cris/rd-dw2-15.d: Likewise. * gas/cris/rd-dw2-2.d: Likewise. * gas/cris/rd-dw2-3.d: Likewise. * gas/cris/rd-dw2-4.d: Likewise. * gas/cris/rd-dw2-5.d: Likewise. * gas/cris/rd-dw2-6.d: Likewise. * gas/cris/rd-dw2-7.d: Likewise. * gas/cris/rd-dw2-8.d: Likewise. * gas/cris/rd-dw2-9.d: Likewise. * gas/elf/dwarf2-1.d: Likewise. * gas/elf/dwarf2-2.d: Likewise. * gas/elf/dwarf2-3.d: Likewise. * gas/i386/debug1.d: Likewise. * gas/i386/dw2-compress-1.d: Likewise. * gas/i386/ilp32/lns/lns-common-1.d: Likewise. * gas/i386/ilp32/lns/lns-duplicate.d: Likewise. * gas/ia64/pr13167.d: Likewise. * gas/lns/lns-big-delta.d: Likewise. * gas/lns/lns-common-1-alt.d: Likewise. * gas/lns/lns-common-1.d: Likewise. * gas/lns/lns-duplicate.d: Likewise. * gas/mips/loc-swap-2.d: Likewise. * gas/mips/loc-swap.d: Likewise. * gas/mips/micromips@loc-swap-2.d: Likewise. * gas/mips/micromips@loc-swap.d: Likewise. * gas/mips/mips16-dwarf2-n32.d: Likewise. * gas/mips/mips16-dwarf2.d: Likewise. * gas/mips/mips16@loc-swap-2.d: Likewise. * gas/mips/mips16@loc-swap.d: Likewise. --- binutils/ChangeLog | 4 ++++ binutils/dwarf.c | 13 +++++++++---- binutils/testsuite/ChangeLog | 7 +++++++ binutils/testsuite/binutils-all/dw2-1.W | 14 +++++++------- .../testsuite/binutils-all/i386/compressed-1a.d | 22 +++++++++++----------- binutils/testsuite/binutils-all/objdump.W | 14 +++++++------- .../testsuite/binutils-all/x86-64/compressed-1a.d | 20 ++++++++++---------- 7 files changed, 55 insertions(+), 39 deletions(-) (limited to 'binutils') diff --git a/binutils/ChangeLog b/binutils/ChangeLog index fa6abb5217..1574dd2f4a 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,7 @@ +2013-05-28 Cary Coutant + + * dwarf.c (display_debug_lines_raw): Print section offsets. + 2013-05-15 Cary Coutant * dwarf.c (SAFE_BYTE_GET64): Correct end-of-buffer check; diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 862a060bd9..4063f0a0ca 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -2656,7 +2656,8 @@ display_debug_lines_raw (struct dwarf_section *section, DWARF2_Internal_LineInfo linfo; unsigned char *standard_opcodes; unsigned char *end_of_sequence; - int i; + unsigned int last_dir_entry = 0; + int i; if (const_strneq (section->name, ".debug_line.") /* Note: the following does not apply to .debug_line.dwo sections. @@ -2715,11 +2716,12 @@ display_debug_lines_raw (struct dwarf_section *section, printf (_("\n The Directory Table is empty.\n")); else { - printf (_("\n The Directory Table:\n")); + printf (_("\n The Directory Table (offset 0x%lx):\n"), + (long)(data - start)); while (*data != 0) { - printf (" %s\n", data); + printf (" %d\t%s\n", ++last_dir_entry, data); data += strnlen ((char *) data, end - data) + 1; } @@ -2733,7 +2735,8 @@ display_debug_lines_raw (struct dwarf_section *section, printf (_("\n The File Name Table is empty.\n")); else { - printf (_("\n The File Name Table:\n")); + printf (_("\n The File Name Table (offset 0x%lx):\n"), + (long)(data - start)); printf (_(" Entry\tDir\tTime\tSize\tName\n")); while (*data != 0) @@ -2784,6 +2787,8 @@ display_debug_lines_raw (struct dwarf_section *section, dwarf_vma uladv; unsigned int bytes_read; + printf (" [0x%08lx]", (long)(data - start)); + op_code = *data++; if (op_code >= linfo.li_opcode_base) diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog index 37cb9d675a..47d0ced6f6 100644 --- a/binutils/testsuite/ChangeLog +++ b/binutils/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2013-05-28 Cary Coutant + + * binutils-all/dw2-1.W: Adjust expected output. + * binutils-all/objdump.W: Likewise. + * binutils-all/i386/compressed-1a.d: Likewise. + * binutils-all/x86-64/compressed-1a.d: Likewise. + 2013-05-02 Nick Clifton * readelf.exp: Expect -wi test to fail for the MSP430. diff --git a/binutils/testsuite/binutils-all/dw2-1.W b/binutils/testsuite/binutils-all/dw2-1.W index 002802a990..85ce9dd020 100644 --- a/binutils/testsuite/binutils-all/dw2-1.W +++ b/binutils/testsuite/binutils-all/dw2-1.W @@ -61,17 +61,17 @@ Raw dump of debug contents of section .debug_line: The Directory Table is empty. - The File Name Table: + The File Name Table \(offset 0x.*\): Entry Dir Time Size Name 1 0 0 0 file1.txt Line Number Statements: - Extended opcode 2: set Address to .* - Advance Line by 3 to 4 - Copy - Copy - Extended opcode 2: set Address to .* - Extended opcode 1: End of Sequence + \[0x.*\] Extended opcode 2: set Address to 0x4 + \[0x.*\] Advance Line by 3 to 4 + \[0x.*\] Copy + \[0x.*\] Copy + \[0x.*\] Extended opcode 2: set Address to 0x8 + \[0x.*\] Extended opcode 1: End of Sequence Contents of the .debug_abbrev section: diff --git a/binutils/testsuite/binutils-all/i386/compressed-1a.d b/binutils/testsuite/binutils-all/i386/compressed-1a.d index bb609ddcba..f1883aa2c5 100644 --- a/binutils/testsuite/binutils-all/i386/compressed-1a.d +++ b/binutils/testsuite/binutils-all/i386/compressed-1a.d @@ -88,21 +88,21 @@ Raw dump of debug contents of section .[z]?debug_line: The Directory Table is empty. - The File Name Table: + The File Name Table \(offset 0x.*\): Entry Dir Time Size Name 1 0 0 0 compressed-1.c Line Number Statements: - Extended opcode 2: set Address to 0x0 - Advance Line by 10 to 11 - Copy - Special opcode 6: advance Address by 0 to 0x0 and Line by 1 to 12 - Advance Line by -7 to 5 - Special opcode 229: advance Address by 16 to 0x10 and Line by 0 to 5 - Special opcode 49: advance Address by 3 to 0x13 and Line by 2 to 7 - Special opcode 46: advance Address by 3 to 0x16 and Line by -1 to 6 - Advance PC by 5 to 0x1b - Extended opcode 1: End of Sequence + \[0x.*\] Extended opcode 2: set Address to 0x0 + \[0x.*\] Advance Line by 10 to 11 + \[0x.*\] Copy + \[0x.*\] Special opcode 6: advance Address by 0 to 0x0 and Line by 1 to 12 + \[0x.*\] Advance Line by -7 to 5 + \[0x.*\] Special opcode 229: advance Address by 16 to 0x10 and Line by 0 to 5 + \[0x.*\] Special opcode 49: advance Address by 3 to 0x13 and Line by 2 to 7 + \[0x.*\] Special opcode 46: advance Address by 3 to 0x16 and Line by -1 to 6 + \[0x.*\] Advance PC by 5 to 0x1b + \[0x.*\] Extended opcode 1: End of Sequence Contents of the .[z]?debug_pubnames section: diff --git a/binutils/testsuite/binutils-all/objdump.W b/binutils/testsuite/binutils-all/objdump.W index 43c2451aec..f544d8290c 100644 --- a/binutils/testsuite/binutils-all/objdump.W +++ b/binutils/testsuite/binutils-all/objdump.W @@ -61,17 +61,17 @@ Raw dump of debug contents of section .debug_line: The Directory Table is empty. - The File Name Table: + The File Name Table \(offset 0x.*\): Entry Dir Time Size Name 1 0 0 0 file1.txt Line Number Statements: - Extended opcode 2: set Address to .* - Advance Line by 3 to 4 - Copy - Copy - Extended opcode 2: set Address to .* - Extended opcode 1: End of Sequence + \[0x.*\] Extended opcode 2: set Address to .* + \[0x.*\] Advance Line by 3 to 4 + \[0x.*\] Copy + \[0x.*\] Copy + \[0x.*\] Extended opcode 2: set Address to .* + \[0x.*\] Extended opcode 1: End of Sequence Contents of the .debug_abbrev section: diff --git a/binutils/testsuite/binutils-all/x86-64/compressed-1a.d b/binutils/testsuite/binutils-all/x86-64/compressed-1a.d index 06ab011bf6..45f974dddf 100644 --- a/binutils/testsuite/binutils-all/x86-64/compressed-1a.d +++ b/binutils/testsuite/binutils-all/x86-64/compressed-1a.d @@ -88,20 +88,20 @@ Raw dump of debug contents of section .[z]?debug_line: The Directory Table is empty. - The File Name Table: + The File Name Table \(offset 0x.*\): Entry Dir Time Size Name 1 0 0 0 compressed-1.c Line Number Statements: - Extended opcode 2: set Address to 0x0 - Advance Line by 10 to 11 - Copy - Special opcode 6: advance Address by 0 to 0x0 and Line by 1 to 12 - Advance Line by -7 to 5 - Special opcode 229: advance Address by 16 to 0x10 and Line by 0 to 5 - Special opcode 6: advance Address by 0 to 0x10 and Line by 1 to 6 - Advance PC by 5 to 0x15 - Extended opcode 1: End of Sequence + \[0x.*\] Extended opcode 2: set Address to 0x0 + \[0x.*\] Advance Line by 10 to 11 + \[0x.*\] Copy + \[0x.*\] Special opcode 6: advance Address by 0 to 0x0 and Line by 1 to 12 + \[0x.*\] Advance Line by -7 to 5 + \[0x.*\] Special opcode 229: advance Address by 16 to 0x10 and Line by 0 to 5 + \[0x.*\] Special opcode 6: advance Address by 0 to 0x10 and Line by 1 to 6 + \[0x.*\] Advance PC by 5 to 0x15 + \[0x.*\] Extended opcode 1: End of Sequence Contents of the .[z]?debug_pubnames section: -- cgit v1.2.1