This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb/users/ccoutant/two-level-line-tables] Fix bugs displaying DW_LNS_set_context and DW_LNS_pop_context.
- From: Cary Coutant <ccoutant at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 15 Jan 2015 21:59:36 -0000
- Subject: [binutils-gdb/users/ccoutant/two-level-line-tables] Fix bugs displaying DW_LNS_set_context and DW_LNS_pop_context.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6a8cf4ce11ee17a4dadbc2bd64e32f20b2c5c2bb
commit 6a8cf4ce11ee17a4dadbc2bd64e32f20b2c5c2bb
Author: Cary Coutant <ccoutant@google.com>
Date: Thu Jan 15 13:51:18 2015 -0800
Fix bugs displaying DW_LNS_set_context and DW_LNS_pop_context.
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.
Diff:
---
binutils/dwarf.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index a864929..abbb18a 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -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)