dbghelp: [2/3] make dwarf2 parser only report file numbers when at least one compilation unit really has numbers

Peter Oberndorfer kumbayo84 at arcor.de
Mon Nov 6 13:05:34 CST 2006


this one is separated from the first patch, because i don't know if i should modify the flag from within
dwarf2_parse_line_numbers, or if i should add a return value(which i did in this patch)

Changelog:
dbghelp: make dwarf2 parser only report file numbers when at least one compilation unit really has numbers
-------------- next part --------------
From 287e61077a033dd0807eb0762ab84a96131fd94f Mon Sep 17 00:00:00 2001
From: Peter Oberndorfer <kumbayo84 at arcor.de>
Date: Mon, 6 Nov 2006 19:45:46 +0100
Subject: [PATCH] dbghelp: make dwarf2 parser only report file numbers when at least one compilation unit really has numbers
---
 dlls/dbghelp/dwarf.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c
index b68824b..4253413 100644
--- a/dlls/dbghelp/dwarf.c
+++ b/dlls/dbghelp/dwarf.c
@@ -1581,7 +1581,7 @@ static void dwarf2_set_line_number(struc
     symt_add_func_line(module, func, *psrc, line, address - func->address);
 }
 
-static void dwarf2_parse_line_numbers(const dwarf2_section_t* sections,        
+static BOOL dwarf2_parse_line_numbers(const dwarf2_section_t* sections,
                                       dwarf2_parse_context_t* ctx,
                                       const char* compile_dir,
                                       unsigned long offset)
@@ -1598,7 +1598,7 @@ static void dwarf2_parse_line_numbers(co
 
     /* section with line numbers stripped */
     if (sections[section_line].address == NO_MAP)
-        return;
+        return FALSE;
 
     traverse.data = sections[section_line].address + offset;
     traverse.start_data = traverse.data;
@@ -1754,6 +1754,7 @@ static void dwarf2_parse_line_numbers(co
             }
         }
     }
+    return TRUE;
 }
 
 static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections,
@@ -1828,7 +1829,8 @@ static BOOL dwarf2_parse_compilation_uni
         }
         if (dwarf2_find_attribute(&ctx, di, DW_AT_stmt_list, &stmt_list))
         {
-            dwarf2_parse_line_numbers(sections, &ctx, comp_dir.u.string, stmt_list.u.uvalue);
+            if (dwarf2_parse_line_numbers(sections, &ctx, comp_dir.u.string, stmt_list.u.uvalue))
+                module->module.LineNumbers = TRUE;
         }
         ret = TRUE;
     }
@@ -1875,7 +1877,6 @@ BOOL dwarf2_parse(struct module* module,
     module->module.SymType = SymDia;
     module->module.CVSig = 'D' | ('W' << 8) | ('A' << 16) | ('R' << 24);
     /* FIXME: we could have a finer grain here */
-    module->module.LineNumbers = TRUE;
     module->module.GlobalSymbols = TRUE;
     module->module.TypeInfo = TRUE;
     module->module.SourceIndexed = TRUE;
-- 
1.4.3.3



More information about the wine-patches mailing list