diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 1ecb01024d1b0f17a97ea1c4440e7d55d1a3d8e7..5f149e88b94ed5b000ef9a38e43b10a6c25c15e5 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -3270,7 +3270,7 @@ static void pdb_convert_symbols_header(PDB_SYMBOLS* symbols, const PDB_SYMBOLS_OLD* old = (const PDB_SYMBOLS_OLD*)image; symbols->version = 0; symbols->module_size = old->module_size; - symbols->offset_size = old->offset_size; + symbols->sectcontrib_size = old->sectcontrib_size; symbols->hash_size = old->hash_size; symbols->srcmodule_size = old->srcmodule_size; symbols->pdbimport_size = 0; @@ -3633,8 +3633,8 @@ static void pdb_process_symbol_imports(const struct process* pcs, int i = 0; struct pdb_file_info sf0 = pdb_module_info->pdb_files[0]; - imp = (const PDB_SYMBOL_IMPORT*)((const char*)symbols_image + sizeof(PDB_SYMBOLS) + - symbols->module_size + symbols->offset_size + + imp = (const PDB_SYMBOL_IMPORT*)((const char*)symbols_image + sizeof(PDB_SYMBOLS) + + symbols->module_size + symbols->sectcontrib_size + symbols->hash_size + symbols->srcmodule_size); first = imp; last = (const char*)imp + symbols->pdbimport_size; @@ -3745,7 +3745,7 @@ static BOOL pdb_process_internal(const struct process* pcs, break; case sizeof(PDB_STREAM_INDEXES): psi = (PDB_STREAM_INDEXES*)((const char*)symbols_image + sizeof(PDB_SYMBOLS) + - symbols.module_size + symbols.offset_size + + symbols.module_size + symbols.sectcontrib_size + symbols.hash_size + symbols.srcmodule_size + symbols.pdbimport_size + symbols.unknown2_size); pdb_file->fpoext_stream = psi->FPO_EXT; diff --git a/include/wine/mscvpdb.h b/include/wine/mscvpdb.h index 9563a70e1ce186b79eb359215c91101ecc1a2d33..efd88608a7f85d9fccfebaeb049d7545f0ff2878 100644 --- a/include/wine/mscvpdb.h +++ b/include/wine/mscvpdb.h @@ -2539,7 +2539,7 @@ typedef struct _PDB_SYMBOLS_OLD unsigned short gsym_stream; unsigned short pad; unsigned int module_size; - unsigned int offset_size; + unsigned int sectcontrib_size; unsigned int hash_size; unsigned int srcmodule_size; } PDB_SYMBOLS_OLD, *PPDB_SYMBOLS_OLD; @@ -2556,7 +2556,7 @@ typedef struct _PDB_SYMBOLS unsigned short gsym_stream; unsigned short rbldVer; unsigned int module_size; - unsigned int offset_size; + unsigned int sectcontrib_size; unsigned int hash_size; unsigned int srcmodule_size; unsigned int pdbimport_size; diff --git a/tools/winedump/pdb.c b/tools/winedump/pdb.c index 5ab1b515691b6da70c4a9df8e1c5a9ec6200116b..5dacb948bdf3c737e7087491510dbc4661d076a6 100644 --- a/tools/winedump/pdb.c +++ b/tools/winedump/pdb.c @@ -370,7 +370,7 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx "\tgsym_stream: %u\n" "\trbldVer: %u\n" "\tmodule_size: %08x\n" - "\toffset_size: %08x\n" + "\tsectcontrib_size: %08x\n" "\thash_size: %08x\n" "\tsrc_module_size: %08x\n" "\tpdbimport_size: %08x\n" @@ -390,7 +390,7 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx symbols->gsym_stream, symbols->rbldVer, symbols->module_size, - symbols->offset_size, + symbols->sectcontrib_size, symbols->hash_size, symbols->srcmodule_size, symbols->pdbimport_size, @@ -401,13 +401,64 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx get_machine_str( symbols->machine ), symbols->resvd4); - if (symbols->offset_size) + if (symbols->sectcontrib_size) { - const BYTE* src; - - printf("\t----------offsets------------\n"); - src = (const BYTE*)((const char*)symbols + sizeof(PDB_SYMBOLS) + symbols->module_size); - dump_data(src, symbols->offset_size, " "); + const BYTE* src = (const BYTE*)symbols + sizeof(PDB_SYMBOLS) + symbols->module_size; + const BYTE* last = src + symbols->sectcontrib_size; + unsigned version, size; + + printf("\t----------section contrib------------\n"); + version = *(unsigned*)src; + printf("\tVersion: %#x (%d)\n", version, version - 0xeffe0000); + switch (version) + { + case 0xeffe0000 + 19970605: size = sizeof(PDB_SYMBOL_RANGE_EX); break; + case 0xeffe0000 + 20140516: size = sizeof(PDB_SYMBOL_RANGE_EX) + sizeof(unsigned); break; + default: printf("\t\tUnsupported version number\n"); size = 0; + } + if (size) + { + const PDB_SYMBOL_RANGE_EX* range; + + if ((symbols->sectcontrib_size - sizeof(unsigned)) % size) + printf("Incoherent size: %zu = %zu * %u + %zu\n", + symbols->sectcontrib_size - sizeof(unsigned), + (symbols->sectcontrib_size - sizeof(unsigned)) / size, + size, + (symbols->sectcontrib_size - sizeof(unsigned)) % size); + if ((symbols->sectcontrib_size - sizeof(unsigned)) % size) + if ((symbols->sectcontrib_size - sizeof(unsigned)) % size) + src += sizeof(unsigned); + while (src + size <= last) + { + range = (const PDB_SYMBOL_RANGE_EX*)(src + sizeof(unsigned)); + printf("\tRange #%tu\n", + ((const BYTE*)range - ((const BYTE*)symbols + sizeof(PDB_SYMBOLS) + symbols->module_size)) / size); + printf("\t\tsegment: %04x\n" + "\t\tpad1: %04x\n" + "\t\toffset: %08x\n" + "\t\tsize: %08x\n" + "\t\tcharacteristics: %08x", + range->segment, + range->pad1, + range->offset, + range->size, + range->characteristics); + dump_section_characteristics(range->characteristics, " "); + printf("\n" + "\t\tindex: %04x\n" + "\t\tpad2: %04x\n" + "\t\ttimestamp: %08x\n" + "\t\tunknown: %08x\n", + range->index, + range->pad2, + range->timestamp, + range->unknown); + if (version == 0xeffe0000 + 20140516) + printf("\t\tcoff_section: %08x\n", *(unsigned*)(range + 1)); + src += size; + } + } } if (!(filesimage = read_string_table(reader))) printf("string table not found\n"); @@ -422,8 +473,8 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx const char* cstr; printf("\t----------src module------------\n"); - src = (const PDB_SYMBOL_SOURCE*)((const char*)symbols + sizeof(PDB_SYMBOLS) + - symbols->module_size + symbols->offset_size + symbols->hash_size); + src = (const PDB_SYMBOL_SOURCE*)((const char*)symbols + sizeof(PDB_SYMBOLS) + + symbols->module_size + symbols->sectcontrib_size + symbols->hash_size); printf("\tSource Modules\n" "\t\tnModules: %u\n" "\t\tnSrcFiles: %u\n", @@ -468,8 +519,8 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx const char* ptr; printf("\t------------import--------------\n"); - imp = (const PDB_SYMBOL_IMPORT*)((const char*)symbols + sizeof(PDB_SYMBOLS) + - symbols->module_size + symbols->offset_size + + imp = (const PDB_SYMBOL_IMPORT*)((const char*)symbols + sizeof(PDB_SYMBOLS) + + symbols->module_size + symbols->sectcontrib_size + symbols->hash_size + symbols->srcmodule_size); first = (const char*)imp; last = (const char*)imp + symbols->pdbimport_size; @@ -504,7 +555,7 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx */ memcpy(sidx, (const char*)symbols + sizeof(PDB_SYMBOLS) + symbols->module_size + - symbols->offset_size + symbols->hash_size + symbols->srcmodule_size + + symbols->sectcontrib_size + symbols->hash_size + symbols->srcmodule_size + symbols->pdbimport_size + symbols->unknown2_size, sizeof(PDB_STREAM_INDEXES_OLD)); printf("\tFPO: %04x\n" @@ -519,7 +570,7 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx case sizeof(PDB_STREAM_INDEXES): memcpy(sidx, (const char*)symbols + sizeof(PDB_SYMBOLS) + symbols->module_size + - symbols->offset_size + symbols->hash_size + symbols->srcmodule_size + + symbols->sectcontrib_size + symbols->hash_size + symbols->srcmodule_size + symbols->pdbimport_size + symbols->unknown2_size, sizeof(*sidx)); printf("\tFPO: %04x\n" @@ -578,7 +629,15 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx "\t\t\tpad1: %04x\n" "\t\t\toffset: %08x\n" "\t\t\tsize: %08x\n" - "\t\t\tcharacteristics: %08x\n" + "\t\t\tcharacteristics: %08x", + sym_file->unknown1, + sym_file->range.segment, + sym_file->range.pad1, + sym_file->range.offset, + sym_file->range.size, + sym_file->range.characteristics); + dump_section_characteristics(sym_file->range.characteristics, " "); + printf("\n" "\t\t\tindex: %04x\n" "\t\t\tpad2: %04x\n" "\t\tflag: %04x\n" @@ -588,12 +647,6 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx "\t\tline2 size: %08x\n" "\t\tnSrcFiles: %08x\n" "\t\tattribute: %08x\n", - sym_file->unknown1, - sym_file->range.segment, - sym_file->range.pad1, - sym_file->range.offset, - sym_file->range.size, - sym_file->range.characteristics, sym_file->range.index, sym_file->range.pad2, sym_file->flag, @@ -623,7 +676,15 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx "\t\t\tpad1: %04x\n" "\t\t\toffset: %08x\n" "\t\t\tsize: %08x\n" - "\t\t\tcharacteristics: %08x\n" + "\t\t\tcharacteristics: %08x", + sym_file->unknown1, + sym_file->range.segment, + sym_file->range.pad1, + sym_file->range.offset, + sym_file->range.size, + sym_file->range.characteristics); + dump_section_characteristics(sym_file->range.characteristics, " "); + printf("\n" "\t\t\tindex: %04x\n" "\t\t\tpad2: %04x\n" "\t\t\ttimestamp: %08x\n" @@ -637,12 +698,6 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx "\t\tattribute: %08x\n" "\t\treserved/0: %08x\n" "\t\treserved/1: %08x\n", - sym_file->unknown1, - sym_file->range.segment, - sym_file->range.pad1, - sym_file->range.offset, - sym_file->range.size, - sym_file->range.characteristics, sym_file->range.index, sym_file->range.pad2, sym_file->range.timestamp,