Commit 83286061 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

dbghelp: Store the 32/64 bitness in the image structure.

parent b3ab012a
......@@ -324,6 +324,7 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map*
#else
if (fmap->u.elf.elfhdr.e_ident[EI_CLASS] != ELFCLASS32) goto done;
#endif
fmap->addr_size = fmap->u.elf.elfhdr.e_ident[EI_CLASS] == ELFCLASS64 ? 64 : 32;
fmap->u.elf.sect = HeapAlloc(GetProcessHeap(), 0,
fmap->u.elf.elfhdr.e_shnum * sizeof(fmap->u.elf.sect[0]));
if (!fmap->u.elf.sect) goto done;
......
......@@ -74,6 +74,7 @@
struct image_file_map
{
enum module_type modtype;
unsigned addr_size; /* either 16 (not used), 32 or 64 */
union
{
struct elf_file_map
......
......@@ -224,6 +224,12 @@ static BOOL pe_map_file(HANDLE file, struct image_file_map* fmap, enum module_ty
if (!(nthdr = RtlImageNtHeader(mapping))) goto error;
memcpy(&fmap->u.pe.ntheader, nthdr, sizeof(fmap->u.pe.ntheader));
switch (nthdr->OptionalHeader.Magic)
{
case 0x10b: fmap->addr_size = 32; break;
case 0x20b: fmap->addr_size = 64; break;
default: return FALSE;
}
section = (IMAGE_SECTION_HEADER*)
((char*)&nthdr->OptionalHeader + nthdr->FileHeader.SizeOfOptionalHeader);
fmap->u.pe.sect = HeapAlloc(GetProcessHeap(), 0,
......
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