]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Add address_size and segment_size to line number program header version 5.
authorCary Coutant <ccoutant@google.com>
Fri, 23 Jan 2015 21:51:56 +0000 (13:51 -0800)
committerCary Coutant <ccoutant@google.com>
Sat, 24 Jan 2015 00:34:56 +0000 (16:34 -0800)
2015-01-23  Cary Coutant  <ccoutant@google.com>

binutils/
* dwarf.h (struct DWARF2_Internal_LineInfo): Add li_address_size and
li_segment_size.
* dwarf.c (read_debug_line_header): Read li_address_size and
li_segment_size.
(display_debug_lines_raw): Print li_address_size and li_segment_size.

binutils/dwarf.c
binutils/dwarf.h

index 7e1650fcc7a90823fb0b7135e6b5a6baf381e0d5..8d8664bd1f01c0f7465eb20f3dc4824a4362ae05 100644 (file)
@@ -2820,6 +2820,17 @@ read_debug_line_header (struct dwarf_section * section,
       return NULL;
     }
 
+  if (linfo->li_version < 5)
+    {
+      linfo->li_address_size = 0;
+      linfo->li_segment_size = 0;
+    }
+  else
+    {
+      SAFE_BYTE_GET_AND_INC (linfo->li_address_size, hdrptr, 1, end);
+      SAFE_BYTE_GET_AND_INC (linfo->li_segment_size, hdrptr, 1, end);
+    }
+
   SAFE_BYTE_GET_AND_INC (linfo->li_prologue_length, hdrptr, offset_size, end);
 
   if (linfo->li_version != DWARF2_LINE_EXPERIMENTAL_VERSION)
@@ -3381,6 +3392,11 @@ display_debug_lines_raw (struct dwarf_section *section,
          printf (_("  Offset:                      0x%lx\n"), (long)(data - start));
          printf (_("  Length:                      %ld\n"), (long) linfo.li_length);
          printf (_("  DWARF Version:               %d\n"), linfo.li_version);
+         if (linfo.li_version >= 5)
+           {
+             printf (_("  Address Size:                %u\n"), linfo.li_address_size);
+             printf (_("  Segment Size:                %u\n"), linfo.li_segment_size);
+           }
          printf (_("  Prologue Length:             %d\n"), linfo.li_prologue_length);
          if (linfo.li_version == DWARF2_LINE_EXPERIMENTAL_VERSION)
            printf (_("  Actuals Table Offset:        0x%x\n"), linfo.li_actuals_table_offset);
@@ -3393,6 +3409,8 @@ display_debug_lines_raw (struct dwarf_section *section,
          printf (_("  Opcode Base:                 %d\n"), linfo.li_opcode_base);
 
          end_of_header_length = data + initial_length_size + 2 + offset_size;
+         if (linfo.li_version >= 5)
+           end_of_header_length += 2;
          start_of_line_program = end_of_header_length + linfo.li_prologue_length;
          if (linfo.li_version == DWARF2_LINE_EXPERIMENTAL_VERSION
              && linfo.li_actuals_table_offset > 0)
index 9c7c59c384ec97d6157b0ea915da91aac9e1d0a0..55cfbfed373593e9d352a4fbda3df33f5c7a6695 100644 (file)
@@ -40,6 +40,8 @@ typedef struct
 {
   dwarf_vma     li_length;
   unsigned short li_version;
+  unsigned char  li_address_size;
+  unsigned char  li_segment_size;
   unsigned int   li_prologue_length;
   unsigned int   li_actuals_table_offset;
   unsigned char  li_min_insn_length;