Fixed tools/winedump and dlls/dbghelp to use that information (instead of trying to guess it, with an erroneous result)
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/dbghelp/msc.c | 7 ++++--- include/wine/mscvpdb.h | 4 ++-- tools/winedump/pdb.c | 24 ++++++++++++------------ 3 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index a1f009cf678..4aaee196370 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -2424,6 +2424,7 @@ static void pdb_convert_symbol_file(const PDB_SYMBOLS* symbols, sfile->range.index = sym_file->range.index; sfile->symbol_size = sym_file->symbol_size; sfile->lineno_size = sym_file->lineno_size; + sfile->lineno2_size = sym_file->lineno2_size; *size = sizeof(PDB_SYMBOL_FILE) - 1; } else @@ -2818,14 +2819,14 @@ static BOOL pdb_process_internal(const struct process* pcs, codeview_snarf(msc_dbg, modimage, sizeof(DWORD), sfile.symbol_size, TRUE);
+ if (sfile.lineno_size && sfile.lineno2_size) FIXME("Both line info present... only supporting first\n"); if (sfile.lineno_size) codeview_snarf_linetab(msc_dbg, modimage + sfile.symbol_size, sfile.lineno_size, pdb_file->kind == PDB_JG); - if (files_image) - codeview_snarf_linetab2(msc_dbg, modimage + sfile.symbol_size + sfile.lineno_size, - pdb_get_file_size(pdb_file, sfile.file) - sfile.symbol_size - sfile.lineno_size, + else if (sfile.lineno2_size && files_image) + codeview_snarf_linetab2(msc_dbg, modimage + sfile.symbol_size, sfile.lineno2_size, files_image + 12, files_size);
pdb_free(modimage); diff --git a/include/wine/mscvpdb.h b/include/wine/mscvpdb.h index 1ede937abc4..53eeec96916 100644 --- a/include/wine/mscvpdb.h +++ b/include/wine/mscvpdb.h @@ -2343,7 +2343,7 @@ typedef struct _PDB_SYMBOL_FILE WORD file; DWORD symbol_size; DWORD lineno_size; - DWORD unknown2; + DWORD lineno2_size; DWORD nSrcFiles; DWORD attribute; CHAR filename[1]; @@ -2357,7 +2357,7 @@ typedef struct _PDB_SYMBOL_FILE_EX WORD file; DWORD symbol_size; DWORD lineno_size; - DWORD unknown2; + DWORD lineno2_size; DWORD nSrcFiles; DWORD attribute; DWORD reserved[2]; diff --git a/tools/winedump/pdb.c b/tools/winedump/pdb.c index 71a2bc49cc8..bbaf1cb94e8 100644 --- a/tools/winedump/pdb.c +++ b/tools/winedump/pdb.c @@ -466,7 +466,7 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx file = (const char*)symbols + sizeof(PDB_SYMBOLS); while (file - (const char*)symbols < sizeof(PDB_SYMBOLS) + symbols->module_size) { - int file_nr, symbol_size, lineno_size; + int file_nr, symbol_size, lineno_size, lineno2_size; const char* file_name;
if (symbols->version < 19970000) @@ -476,6 +476,7 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx file_name = sym_file->filename; symbol_size = sym_file->symbol_size; lineno_size = sym_file->lineno_size; + lineno2_size = sym_file->lineno2_size; printf("\t--------symbol file----------- %s\n", file_name); printf("\tgot symbol_file\n" "\t\tunknown1: %08x\n" @@ -491,7 +492,7 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx "\t\tfile: %04x\n" "\t\tsymb size: %08x\n" "\t\tline size: %08x\n" - "\t\tunknown2: %08x\n" + "\t\tline2 size: %08x\n" "\t\tnSrcFiles: %08x\n" "\t\tattribute: %08x\n", sym_file->unknown1, @@ -506,7 +507,7 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx sym_file->file, sym_file->symbol_size, sym_file->lineno_size, - sym_file->unknown2, + sym_file->lineno2_size, sym_file->nSrcFiles, sym_file->attribute); } @@ -517,6 +518,7 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx file_name = sym_file->filename; symbol_size = sym_file->symbol_size; lineno_size = sym_file->lineno_size; + lineno2_size = sym_file->lineno2_size; printf("\t--------symbol file----------- %s\n", file_name); printf("\t\tunknown1: %08x\n" "\t\trange\n" @@ -533,7 +535,7 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx "\t\tfile: %04x\n" "\t\tsymb size: %08x\n" "\t\tline size: %08x\n" - "\t\tunknown2: %08x\n" + "\t\tline2 size: %08x\n" "\t\tnSrcFiles: %08x\n" "\t\tattribute: %08x\n" "\t\treserved/0: %08x\n" @@ -552,7 +554,7 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx sym_file->file, sym_file->symbol_size, sym_file->lineno_size, - sym_file->unknown2, + sym_file->lineno2_size, sym_file->nSrcFiles, sym_file->attribute, sym_file->reserved[0], @@ -569,15 +571,13 @@ static void pdb_dump_symbols(struct pdb_reader* reader, PDB_STREAM_INDEXES* sidx /* line number info */ if (lineno_size) codeview_dump_linetab((const char*)modimage + symbol_size, TRUE, " "); - /* anyway, lineno_size doesn't see to really be the size of the line number information, and - * it's not clear yet when to call for linetab2... - */ - codeview_dump_linetab2((const char*)modimage + symbol_size + lineno_size, - total_size - (symbol_size + lineno_size), - filesimage ? filesimage + 12 : NULL, filessize, " "); + else if (lineno2_size) /* actually, only one of the 2 lineno should be present */ + codeview_dump_linetab2((const char*)modimage + symbol_size, lineno2_size, + filesimage ? filesimage + 12 : NULL, filessize, " "); /* what's that part ??? */ if (0) - dump_data(modimage + symbol_size + lineno_size, total_size - (symbol_size + lineno_size), " "); + dump_data(modimage + symbol_size + lineno_size + lineno2_size, + total_size - (symbol_size + lineno_size + lineno2_size), " "); free(modimage); }