Commit 141db032 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

- fixed ELF modules' size information

- fixed containers' tests
parent f31a3204
...@@ -345,18 +345,12 @@ static enum DbgInfoLoad DEBUG_ProcessElfFile(HANDLE hProcess, ...@@ -345,18 +345,12 @@ static enum DbgInfoLoad DEBUG_ProcessElfFile(HANDLE hProcess,
for (i = 0; i < ehptr->e_phnum; i++) for (i = 0; i < ehptr->e_phnum; i++)
{ {
if (ppnt[i].p_type != PT_LOAD) continue; if (ppnt[i].p_type != PT_LOAD) continue;
if (elf_info->size < ppnt[i].p_vaddr - delta + ppnt[i].p_memsz) elf_info->size += (ppnt[i].p_align <= 1) ? ppnt[i].p_memsz :
elf_info->size = ppnt[i].p_vaddr - delta + ppnt[i].p_memsz; (ppnt[i].p_memsz + ppnt[i].p_align - 1) & ~(ppnt[i].p_align - 1);
} }
for (i = 0; i < ehptr->e_shnum; i++) for (i = 0; i < ehptr->e_shnum; i++)
{ {
if (strcmp(shstrtab + spnt[i].sh_name, ".bss") == 0 &&
spnt[i].sh_type == SHT_NOBITS)
{
if (elf_info->size < spnt[i].sh_addr - delta + spnt[i].sh_size)
elf_info->size = spnt[i].sh_addr - delta + spnt[i].sh_size;
}
if (strcmp(shstrtab + spnt[i].sh_name, ".dynamic") == 0 && if (strcmp(shstrtab + spnt[i].sh_name, ".dynamic") == 0 &&
spnt[i].sh_type == SHT_DYNAMIC) spnt[i].sh_type == SHT_DYNAMIC)
{ {
......
...@@ -361,8 +361,8 @@ static int DEBUG_ModuleCompare(const void* p1, const void* p2) ...@@ -361,8 +361,8 @@ static int DEBUG_ModuleCompare(const void* p1, const void* p2)
static inline BOOL DEBUG_IsContainer(const DBG_MODULE* wmod_cntnr, static inline BOOL DEBUG_IsContainer(const DBG_MODULE* wmod_cntnr,
const DBG_MODULE* wmod_child) const DBG_MODULE* wmod_child)
{ {
return wmod_cntnr->load_addr < wmod_child->load_addr && return wmod_cntnr->load_addr <= wmod_child->load_addr &&
(DWORD)wmod_cntnr->load_addr + wmod_cntnr->size > (DWORD)wmod_cntnr->load_addr + wmod_cntnr->size >=
(DWORD)wmod_child->load_addr + wmod_child->size; (DWORD)wmod_child->load_addr + wmod_child->size;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment