]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix bugs displaying DW_LNS_set_context and DW_LNS_pop_context.
authorCary Coutant <ccoutant@google.com>
Thu, 15 Jan 2015 21:51:18 +0000 (13:51 -0800)
committerCary Coutant <ccoutant@google.com>
Thu, 15 Jan 2015 21:58:58 +0000 (13:58 -0800)
2015-01-15  Cary Coutant  <ccoutant@google.com>

binutils/
* dwarf.c (append_logical): Print summary for each logical row.
(display_line_program): Remove incorrect consumption of an LEB128
when reading DW_LNS_set_context and DW_LNS_pop_context.

binutils/dwarf.c

index a86492961bc2d0a7eaad6b08360ad5460fd97d06..abbb18ae25bf28263d1382f377ccbf1795bf42ec 100644 (file)
@@ -441,6 +441,16 @@ append_logical (void)
          xrealloc (logicals_table, logicals_allocated * sizeof (SMR));
     }
   logicals_table[logicals_count++] = state_machine_regs;
+  printf (_("\t\tLogical %d: 0x%s[%d] file %d line %d discrim %d context %d subprog %d is_stmt %d\n"),
+         logicals_count,
+         dwarf_vmatoa ("x", state_machine_regs.address),
+         state_machine_regs.op_index,
+         state_machine_regs.file,
+         state_machine_regs.line,
+         state_machine_regs.discriminator,
+         state_machine_regs.context,
+         state_machine_regs.subprogram,
+         state_machine_regs.is_stmt);
 }
 
 /* Handled an extend line op.
@@ -3227,8 +3237,6 @@ display_line_program (unsigned char *start, unsigned char *end,
                   /* DW_LNS_set_context */
                   state_machine_regs.context = read_uleb128 (data, & bytes_read, end);
                   data += bytes_read;
-                  state_machine_regs.subprogram = read_uleb128 (data, & bytes_read, end);
-                  data += bytes_read;
                   printf (_("  Set context to %d\n"), state_machine_regs.context);
                 }
               else
@@ -3260,8 +3268,6 @@ display_line_program (unsigned char *start, unsigned char *end,
               break;
 
             case DW_LNS_pop_context:
-              uladv = read_uleb128 (data, & bytes_read, end);
-              data += bytes_read;
               logical = state_machine_regs.context;
               printf (_("  Pop context to logical %d\n"), logical);
               if (logical - 1 < logicals_count)