From a655b143401f1c8d5d0d6097028b52221a3367b3 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Sun, 18 Jun 2006 21:32:13 +0200 Subject: [PATCH] dbghelp: Pass .debug_loc section information to dwarf. --- 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 1095843c320..62ef4a612b0 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -434,7 +434,8 @@ extern BOOL stabs_parse(struct module* module, unsigned long load_offset 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 426bf280559..12d0226311d 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_unit(const dwarf2_section_t* sections, 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, unsigned long load_offset, 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 cb56e231a71..33e78bdd881 100644 --- a/dlls/dbghelp/elf_module.c +++ b/dlls/dbghelp/elf_module.c @@ -867,23 +867,27 @@ static BOOL elf_load_debug_info_from_map(struct module* module, 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"); -- 2.11.4.GIT