[PATCH 25/31] [DbgHelp]: dwarf debug loc

Eric Pouech eric.pouech at wanadoo.fr
Sun Jun 18 14:32:13 CDT 2006


- now passing .debug_loc section information to dwarf

A+
---

 dlls/dbghelp/dbghelp_private.h |    3 ++-
 dlls/dbghelp/dwarf.c           |    7 +++++--
 dlls/dbghelp/elf_module.c      |    6 +++++-
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h
index 1095843..62ef4a6 100644
--- a/dlls/dbghelp/dbghelp_private.h
+++ b/dlls/dbghelp/dbghelp_private.h
@@ -434,7 +434,8 @@ extern BOOL         stabs_parse(struct m
 extern BOOL         dwarf2_parse(struct module* module, unsigned long load_offset,
 				 const unsigned char* debug, unsigned int debug_size, 
 				 const unsigned char* abbrev, unsigned int abbrev_size, 
-				 const unsigned char* str, unsigned int str_sz);
+				 const unsigned char* str, unsigned int str_size,
+                                 const unsigned char* line, unsigned int line_size);
 
 /* symbol.c */
 extern const char*  symt_get_name(const struct symt* sym);
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c
index edb8aaa..1556300 100644
--- a/dlls/dbghelp/dwarf.c
+++ b/dlls/dbghelp/dwarf.c
@@ -154,7 +154,7 @@ typedef struct dwarf2_section_s
     unsigned                    size;
 } dwarf2_section_t;
 
-enum dwarf2_sections {section_debug, section_string, section_abbrev, section_max};
+enum dwarf2_sections {section_debug, section_string, section_abbrev, section_line, section_max};
 
 typedef struct dwarf2_traverse_context_s
 {
@@ -1456,7 +1456,8 @@ static BOOL dwarf2_parse_compilation_uni
 BOOL dwarf2_parse(struct module* module, unsigned long load_offset,
 		  const unsigned char* debug, unsigned int debug_size,
 		  const unsigned char* abbrev, unsigned int abbrev_size,
-		  const unsigned char* str, unsigned int str_size)
+		  const unsigned char* str, unsigned int str_size,
+		  const unsigned char* line, unsigned int line_size)
 {
     dwarf2_section_t    section[section_max];
     const unsigned char*comp_unit_cursor = debug;
@@ -1468,6 +1469,8 @@ BOOL dwarf2_parse(struct module* module,
     section[section_abbrev].size = abbrev_size;
     section[section_string].address = str;
     section[section_string].size = str_size;
+    section[section_line].address = line;
+    section[section_line].size = line_size;
 
     while (comp_unit_cursor < end_debug)
     {
diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c
index 85561ae..d25ebb4 100644
--- a/dlls/dbghelp/elf_module.c
+++ b/dlls/dbghelp/elf_module.c
@@ -864,23 +864,27 @@ static BOOL elf_load_debug_info_from_map
             const BYTE* dw2_debug;
             const BYTE* dw2_debug_abbrev;
             const BYTE* dw2_debug_str;
+            const BYTE* dw2_debug_line;
 
             FIXME("Alpha-support for Dwarf2 information for %s\n", module->module.ModuleName);
 
             dw2_debug = (const BYTE*) elf_map_section(fmap, debug_sect);
             dw2_debug_abbrev = (const BYTE*) elf_map_section(fmap, debug_abbrev_sect);
             dw2_debug_str = (const BYTE*) elf_map_section(fmap, debug_str_sect);
+            dw2_debug_line = (const BYTE*) elf_map_section(fmap, debug_line_sect);
             if (dw2_debug != NO_MAP && NO_MAP != dw2_debug_abbrev && dw2_debug_str != NO_MAP)
             {
                 /* OK, now just parse dwarf2 debug infos. */
                 ret = dwarf2_parse(module, module->elf_info->elf_addr,
 				   dw2_debug, fmap->sect[debug_sect].shdr.sh_size,
 				   dw2_debug_abbrev, fmap->sect[debug_abbrev_sect].shdr.sh_size,
-				   dw2_debug_str, fmap->sect[debug_str_sect].shdr.sh_size);
+				   dw2_debug_str, fmap->sect[debug_str_sect].shdr.sh_size,
+                                   dw2_debug_line, fmap->sect[debug_line_sect].shdr.sh_size);
             }
             elf_unmap_section(fmap, debug_sect);
             elf_unmap_section(fmap, debug_abbrev_sect);
             elf_unmap_section(fmap, debug_str_sect);
+            elf_unmap_section(fmap, debug_line_sect);
             if (!ret)
             {
                 WARN("Couldn't correctly read stabs\n");



More information about the wine-patches mailing list