Eric Pouech wrote:
> this is wrong: dwarf_parse family set makes the pointer in the cxt
> advance by the size of the object which is being parse
You're right. I had, in fact, checked this very question, but doing
so just again I see where I missed the += in the code. Thanks for
catching this, Eric!
> and actually, the correct fix would be to make use of those variables
> (like checking if the version is a known one), instead of throwing
> things away
Are you planning to go into that direction? If not, I'd suggest the
patch below. (I'm not sure whether checking for the DWARF version is
going to help -- do we want to abort for newer versions when these
actually should be compatible?)
Gerald
From: Gerald Pfeifer <gerald(a)pfeifer.com>
Date: Sun, 2 May 2010 22:05:20
Subject: dbghelp: Remove two variables which are not really used in dwarf2_parse_line_numbers.
---
dlls/dbghelp/dwarf.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c
index 4be0f6a..99960d8 100644
--- a/dlls/dbghelp/dwarf.c
+++ b/dlls/dbghelp/dwarf.c
@@ -1920,7 +1920,7 @@ static BOOL dwarf2_parse_line_numbers(const dwarf2_section_t* sections,
{
dwarf2_traverse_context_t traverse;
unsigned long length;
- unsigned version, header_len, insn_size, default_stmt;
+ unsigned insn_size, default_stmt;
unsigned line_range, opcode_base;
int line_base;
const unsigned char* opcode_len;
@@ -1939,8 +1939,8 @@ static BOOL dwarf2_parse_line_numbers(const dwarf2_section_t* sections,
length = dwarf2_parse_u4(&traverse);
traverse.end_data = sections[section_line].address + offset + length;
- version = dwarf2_parse_u2(&traverse);
- header_len = dwarf2_parse_u4(&traverse);
+ dwarf2_parse_u2(&traverse);
+ dwarf2_parse_u4(&traverse);
insn_size = dwarf2_parse_byte(&traverse);
default_stmt = dwarf2_parse_byte(&traverse);
line_base = (signed char)dwarf2_parse_byte(&traverse);
--
1.6.6.2