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

oldstable
Eric Pouech 2012-02-13 21:41:34 +01:00 committed by Alexandre Julliard
parent b3ab012a42
commit 8328606141
3 changed files with 8 additions and 0 deletions

View File

@ -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;

View File

@ -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

View File

@ -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,