Main target of this serie is to support properly the SYMOPT_LOAD_LINES option flag to dbghelp (turning it off can save some memory). Adding support for 128bit integers in PDB base types, and silencing some more types.
From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/msc.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index c01a8fd9c69..58c416eeed8 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -180,6 +180,9 @@ static void codeview_init_basic_types(struct module* module) cv_basic_types[T_UINT4] = &symt_get_basic(btUInt, 4)->symt; /* UINT4 */ cv_basic_types[T_INT8] = &symt_get_basic(btInt, 8)->symt; /* INT8 */ cv_basic_types[T_UINT8] = &symt_get_basic(btUInt, 8)->symt; /* UINT8 */ + cv_basic_types[T_OCT] = &symt_get_basic(btInt, 8)->symt; /* INT8 */ + cv_basic_types[T_UOCT] = &symt_get_basic(btUInt, 8)->symt; /* UINT8 */ + cv_basic_types[T_HRESULT]= &symt_get_basic(btUInt, 4)->symt; /* HRESULT */
cv_basic_types[T_32PVOID] = &symt_new_pointer(module, cv_basic_types[T_VOID], 4)->symt; @@ -187,10 +190,12 @@ static void codeview_init_basic_types(struct module* module) cv_basic_types[T_32PSHORT] = &symt_new_pointer(module, cv_basic_types[T_SHORT], 4)->symt; cv_basic_types[T_32PLONG] = &symt_new_pointer(module, cv_basic_types[T_LONG], 4)->symt; cv_basic_types[T_32PQUAD] = &symt_new_pointer(module, cv_basic_types[T_QUAD], 4)->symt; + cv_basic_types[T_32POCT] = &symt_new_pointer(module, cv_basic_types[T_OCT], 4)->symt; cv_basic_types[T_32PUCHAR] = &symt_new_pointer(module, cv_basic_types[T_UCHAR], 4)->symt; cv_basic_types[T_32PUSHORT] = &symt_new_pointer(module, cv_basic_types[T_USHORT], 4)->symt; cv_basic_types[T_32PULONG] = &symt_new_pointer(module, cv_basic_types[T_ULONG], 4)->symt; cv_basic_types[T_32PUQUAD] = &symt_new_pointer(module, cv_basic_types[T_UQUAD], 4)->symt; + cv_basic_types[T_32PUOCT] = &symt_new_pointer(module, cv_basic_types[T_UOCT], 4)->symt; cv_basic_types[T_32PBOOL08] = &symt_new_pointer(module, cv_basic_types[T_BOOL08], 4)->symt; cv_basic_types[T_32PBOOL16] = &symt_new_pointer(module, cv_basic_types[T_BOOL16], 4)->symt; cv_basic_types[T_32PBOOL32] = &symt_new_pointer(module, cv_basic_types[T_BOOL32], 4)->symt; @@ -216,10 +221,12 @@ static void codeview_init_basic_types(struct module* module) cv_basic_types[T_64PSHORT] = &symt_new_pointer(module, cv_basic_types[T_SHORT], 8)->symt; cv_basic_types[T_64PLONG] = &symt_new_pointer(module, cv_basic_types[T_LONG], 8)->symt; cv_basic_types[T_64PQUAD] = &symt_new_pointer(module, cv_basic_types[T_QUAD], 8)->symt; + cv_basic_types[T_64POCT] = &symt_new_pointer(module, cv_basic_types[T_OCT], 8)->symt; cv_basic_types[T_64PUCHAR] = &symt_new_pointer(module, cv_basic_types[T_UCHAR], 8)->symt; cv_basic_types[T_64PUSHORT] = &symt_new_pointer(module, cv_basic_types[T_USHORT], 8)->symt; cv_basic_types[T_64PULONG] = &symt_new_pointer(module, cv_basic_types[T_ULONG], 8)->symt; cv_basic_types[T_64PUQUAD] = &symt_new_pointer(module, cv_basic_types[T_UQUAD], 8)->symt; + cv_basic_types[T_64PUOCT] = &symt_new_pointer(module, cv_basic_types[T_UOCT], 8)->symt; cv_basic_types[T_64PBOOL08] = &symt_new_pointer(module, cv_basic_types[T_BOOL08], 8)->symt; cv_basic_types[T_64PBOOL16] = &symt_new_pointer(module, cv_basic_types[T_BOOL16], 8)->symt; cv_basic_types[T_64PBOOL32] = &symt_new_pointer(module, cv_basic_types[T_BOOL32], 8)->symt; @@ -245,10 +252,12 @@ static void codeview_init_basic_types(struct module* module) cv_basic_types[T_PSHORT] = &symt_new_pointer(module, cv_basic_types[T_SHORT], ptrsz)->symt; cv_basic_types[T_PLONG] = &symt_new_pointer(module, cv_basic_types[T_LONG], ptrsz)->symt; cv_basic_types[T_PQUAD] = &symt_new_pointer(module, cv_basic_types[T_QUAD], ptrsz)->symt; + cv_basic_types[T_POCT] = &symt_new_pointer(module, cv_basic_types[T_OCT], ptrsz)->symt; cv_basic_types[T_PUCHAR] = &symt_new_pointer(module, cv_basic_types[T_UCHAR], ptrsz)->symt; cv_basic_types[T_PUSHORT] = &symt_new_pointer(module, cv_basic_types[T_USHORT], ptrsz)->symt; cv_basic_types[T_PULONG] = &symt_new_pointer(module, cv_basic_types[T_ULONG], ptrsz)->symt; cv_basic_types[T_PUQUAD] = &symt_new_pointer(module, cv_basic_types[T_UQUAD], ptrsz)->symt; + cv_basic_types[T_PUOCT] = &symt_new_pointer(module, cv_basic_types[T_UOCT], ptrsz)->symt; cv_basic_types[T_PBOOL08] = &symt_new_pointer(module, cv_basic_types[T_BOOL08], ptrsz)->symt; cv_basic_types[T_PBOOL16] = &symt_new_pointer(module, cv_basic_types[T_BOOL16], ptrsz)->symt; cv_basic_types[T_PBOOL32] = &symt_new_pointer(module, cv_basic_types[T_BOOL32], ptrsz)->symt;
From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/msc.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 58c416eeed8..33b7158bcee 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -1407,6 +1407,10 @@ static struct symt* codeview_parse_one_type(struct codeview_type_parse* ctp, symt = &symt_new_udt(ctp->module, buf, 0, UdtStruct)->symt; } break; + /* types we can simply silence for now */ + case LF_LABEL_V1: + case LF_VFTABLE_V3: + break; default: FIXME("Unsupported type-id leaf %x\n", type->generic.id); dump(type, 2 + type->generic.len); @@ -2800,12 +2804,14 @@ static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, break;
/* the symbols we can safely ignore for now */ + case S_SKIP: case S_TRAMPOLINE: case S_FRAMECOOKIE: case S_SECTION: case S_COFFGROUP: case S_EXPORT: case S_CALLSITEINFO: + case S_ARMSWITCHTABLE: /* even if S_LOCAL groks all the S_DEFRANGE* records following itself, * those kinds of records can also be present after a S_FILESTATIC record * so silence them until (at least) S_FILESTATIC is supported
From: Eric Pouech epouech@codeweavers.com
Basically, - calling one or the other from the same point, - exposing if line number information has been read.
This refactorization will be used in next patch.
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/msc.c | 66 +++++++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 24 deletions(-)
diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 33b7158bcee..1352fe145f4 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -1585,7 +1585,7 @@ static BOOL codeview_parse_type_table(struct codeview_type_parse* ctp) static ULONG_PTR codeview_get_address(const struct msc_debug_info* msc_dbg, unsigned seg, unsigned offset);
-static void codeview_snarf_linetab(const struct msc_debug_info* msc_dbg, const BYTE* linetab, +static BOOL codeview_snarf_linetab(const struct msc_debug_info* msc_dbg, const BYTE* linetab, int size, BOOL pascal_str) { const BYTE* ptr = linetab; @@ -1603,6 +1603,7 @@ static void codeview_snarf_linetab(const struct msc_debug_info* msc_dbg, const B const struct codeview_linetab_block* ltb;
nfile = *(const short*)linetab; + if (!nfile) return FALSE; filetab = (const unsigned int*)(linetab + 2 * sizeof(short));
for (i = 0; i < nfile; i++) @@ -1650,11 +1651,12 @@ static void codeview_snarf_linetab(const struct msc_debug_info* msc_dbg, const B } } } + return TRUE; }
static const char* pdb_get_string_table_entry(const PDB_STRING_TABLE* table, unsigned offset);
-static void codeview_snarf_linetab2(const struct msc_debug_info* msc_dbg, const struct cv_module_snarf* cvmod) +static BOOL codeview_snarf_linetab2(const struct msc_debug_info* msc_dbg, const struct cv_module_snarf* cvmod) { unsigned i; const void* hdr_last = (const char*)cvmod->dbgsubsect + cvmod->dbgsubsect_size; @@ -1680,7 +1682,7 @@ static void codeview_snarf_linetab2(const struct msc_debug_info* msc_dbg, const if (!hdr_files) { TRACE("No DEBUG_S_FILECHKSMS found\n"); - return; + return FALSE; }
for (hdr = cvmod->dbgsubsect; CV_IS_INSIDE(hdr, hdr_last); hdr = hdr_next) @@ -1730,6 +1732,7 @@ static void codeview_snarf_linetab2(const struct msc_debug_info* msc_dbg, const } hdr = hdr_next; } + return TRUE; }
/*======================================================================== @@ -2837,7 +2840,6 @@ static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, break; } } - if (cvmod) codeview_snarf_linetab2(msc_dbg, cvmod); return TRUE; }
@@ -3595,7 +3597,8 @@ static BOOL pdb_process_internal(const struct process *pcs, const struct msc_debug_info *msc_dbg, const WCHAR *filename, struct pdb_module_info *pdb_module_info, - unsigned module_index); + unsigned module_index, + BOOL *has_linenumber_info);
DWORD pdb_get_file_indexinfo(void* image, DWORD size, SYMSRV_INDEX_INFOW* info) { @@ -3730,6 +3733,7 @@ static void pdb_process_symbol_imports(const struct process *pcs, while (imp < (const PDB_SYMBOL_IMPORT*)last) { SYMSRV_INDEX_INFOW info; + BOOL line_info;
ptr = (const char*)imp + sizeof(*imp) + strlen(imp->filename); if (i >= CV_MAX_MODULES) FIXME("Out of bounds!!!\n"); @@ -3737,7 +3741,7 @@ static void pdb_process_symbol_imports(const struct process *pcs, debugstr_a(imp->filename), imp->Age, imp->TimeDateStamp); if (path_find_symbol_file(pcs, msc_dbg->module, imp->filename, TRUE, NULL, imp->TimeDateStamp, imp->Age, &info, &msc_dbg->module->module.PdbUnmatched)) - pdb_process_internal(pcs, msc_dbg, info.pdbfile, pdb_module_info, i); + pdb_process_internal(pcs, msc_dbg, info.pdbfile, pdb_module_info, i, &line_info); i++; imp = (const PDB_SYMBOL_IMPORT*)((const char*)first + ((ptr - (const char*)first + strlen(ptr) + 1 + 3) & ~3)); } @@ -3757,7 +3761,8 @@ static BOOL pdb_process_internal(const struct process *pcs, const struct msc_debug_info *msc_dbg, const WCHAR *filename, struct pdb_module_info *pdb_module_info, - unsigned module_index) + unsigned module_index, + BOOL *has_linenumber_info) { HANDLE hFile = NULL, hMap = NULL; char* image = NULL; @@ -3767,6 +3772,8 @@ static BOOL pdb_process_internal(const struct process *pcs,
TRACE("Processing PDB file %ls\n", filename);
+ *has_linenumber_info = FALSE; + pdb_file = &pdb_module_info->pdb_files[module_index == -1 ? 0 : module_index]; /* Open and map() .PDB file */ if ((hFile = CreateFileW(filename, GENERIC_READ, FILE_SHARE_READ, NULL, @@ -3845,9 +3852,10 @@ static BOOL pdb_process_internal(const struct process *pcs, data = pdb_read_stream(pdb_file, symbols.global_hash_stream); if (data) { - codeview_snarf_sym_hashtable(msc_dbg, globalimage, global_size, - data, pdb_get_stream_size(pdb_file, symbols.global_hash_stream), - pdb_global_feed_types); + if (codeview_snarf_sym_hashtable(msc_dbg, globalimage, global_size, + data, pdb_get_stream_size(pdb_file, symbols.global_hash_stream), + pdb_global_feed_types)) + *has_linenumber_info = TRUE; pdb_free((void*)data); } } @@ -3874,11 +3882,18 @@ static BOOL pdb_process_internal(const struct process *pcs, if (sfile.lineno_size && sfile.lineno2_size) FIXME("Both line info present... only supporting second\n"); else if (sfile.lineno_size) - codeview_snarf_linetab(msc_dbg, - modimage + sfile.symbol_size, - sfile.lineno_size, - pdb_file->kind == PDB_JG); - + { + if (codeview_snarf_linetab(msc_dbg, + modimage + sfile.symbol_size, + sfile.lineno_size, + pdb_file->kind == PDB_JG)) + *has_linenumber_info = TRUE; + } + else if (sfile.lineno2_size) + { + if (codeview_snarf_linetab2(msc_dbg, &cvmod)) + *has_linenumber_info = TRUE; + } pdb_free(modimage); } file_name += strlen(file_name) + 1; @@ -3935,7 +3950,7 @@ static BOOL pdb_process_file(const struct process *pcs, (modfmt = HeapAlloc(GetProcessHeap(), 0, sizeof(struct module_format) + sizeof(struct pdb_module_info)))) { - BOOL ret; + BOOL ret, has_linenumber_info;
pdb_module_info = (void*)(modfmt + 1); msc_dbg->module->format_info[DFI_PDB] = modfmt; @@ -3947,7 +3962,7 @@ static BOOL pdb_process_file(const struct process *pcs, memset(cv_zmodules, 0, sizeof(cv_zmodules)); codeview_init_basic_types(msc_dbg->module); ret = pdb_process_internal(pcs, msc_dbg, info.pdbfile, - msc_dbg->module->format_info[DFI_PDB]->u.pdb_info, -1); + msc_dbg->module->format_info[DFI_PDB]->u.pdb_info, -1, &has_linenumber_info); codeview_clear_type_table(); if (ret) { @@ -3959,7 +3974,7 @@ static BOOL pdb_process_file(const struct process *pcs, wcscpy(msc_dbg->module->module.LoadedPdbName, info.pdbfile);
/* FIXME: we could have a finer grain here */ - msc_dbg->module->module.LineNumbers = TRUE; + msc_dbg->module->module.LineNumbers = has_linenumber_info; msc_dbg->module->module.GlobalSymbols = TRUE; msc_dbg->module->module.TypeInfo = TRUE; msc_dbg->module->module.SourceIndexed = TRUE; @@ -4358,7 +4373,8 @@ static BOOL codeview_process_info(const struct process *pcs, const OMFDirEntry* ent; const OMFDirEntry* prev; const OMFDirEntry* next; - unsigned int i; + unsigned int i; + BOOL has_linenumber_info = FALSE;
codeview_init_basic_types(msc_dbg->module);
@@ -4407,19 +4423,21 @@ static BOOL codeview_process_info(const struct process *pcs, * FIXME: This is not a general solution! */ if (next && next->iMod == ent->iMod && next->SubSection == sstSrcModule) - codeview_snarf_linetab(msc_dbg, msc_dbg->root + next->lfo, - next->cb, TRUE); + if (codeview_snarf_linetab(msc_dbg, msc_dbg->root + next->lfo, + next->cb, TRUE)) + has_linenumber_info = TRUE;
if (prev && prev->iMod == ent->iMod && prev->SubSection == sstSrcModule) - codeview_snarf_linetab(msc_dbg, msc_dbg->root + prev->lfo, - prev->cb, TRUE); + if (codeview_snarf_linetab(msc_dbg, msc_dbg->root + prev->lfo, + prev->cb, TRUE)) + has_linenumber_info = TRUE;
} }
msc_dbg->module->module.SymType = SymCv; + msc_dbg->module->module.LineNumbers = has_linenumber_info; /* FIXME: we could have a finer grain here */ - msc_dbg->module->module.LineNumbers = TRUE; msc_dbg->module->module.GlobalSymbols = TRUE; msc_dbg->module->module.TypeInfo = TRUE; msc_dbg->module->module.SourceIndexed = TRUE;
From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/coff.c | 22 ++++++------- dlls/dbghelp/dwarf.c | 2 +- dlls/dbghelp/msc.c | 75 ++++++++++++++++++++++++-------------------- dlls/dbghelp/stabs.c | 29 +++++++++-------- 4 files changed, 68 insertions(+), 60 deletions(-)
diff --git a/dlls/dbghelp/coff.c b/dlls/dbghelp/coff.c index 21b4f726dd3..29c75c375e1 100644 --- a/dlls/dbghelp/coff.c +++ b/dlls/dbghelp/coff.c @@ -161,7 +161,6 @@ BOOL coff_process_info(const struct msc_debug_info* msc_dbg) int linetab_indx; const char* nampnt; int naux; - BOOL ret = FALSE; ULONG64 addr;
TRACE("Processing COFF symbols...\n"); @@ -378,7 +377,8 @@ BOOL coff_process_info(const struct msc_debug_info* msc_dbg) i += naux; }
- if (coff_files.files != NULL) + if (coff_files.files == NULL) return FALSE; + if (SymGetOptions() & SYMOPT_LOAD_LINES) { /* * OK, we now should have a list of files, and we should have a list @@ -436,15 +436,13 @@ BOOL coff_process_info(const struct msc_debug_info* msc_dbg) HeapFree(GetProcessHeap(), 0, coff_files.files[j].entries); } HeapFree(GetProcessHeap(), 0, coff_files.files); - msc_dbg->module->module.SymType = SymCoff; - /* FIXME: we could have a finer grain here */ - msc_dbg->module->module.LineNumbers = TRUE; - msc_dbg->module->module.GlobalSymbols = TRUE; - msc_dbg->module->module.TypeInfo = FALSE; - msc_dbg->module->module.SourceIndexed = TRUE; - msc_dbg->module->module.Publics = TRUE; - ret = TRUE; } - - return ret; + msc_dbg->module->module.SymType = SymCoff; + + msc_dbg->module->module.LineNumbers = !!(SymGetOptions() & SYMOPT_LOAD_LINES); + msc_dbg->module->module.GlobalSymbols = TRUE; + msc_dbg->module->module.TypeInfo = FALSE; + msc_dbg->module->module.SourceIndexed = TRUE; + msc_dbg->module->module.Publics = TRUE; + return TRUE; } diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 883b04dd6a1..3971ff64988 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -3074,7 +3074,7 @@ static BOOL dwarf2_parse_compilation_unit(dwarf2_parse_context_t* ctx) child = *(dwarf2_debug_info_t**)vector_at(children, i); dwarf2_load_one_entry(child); } - if (dwarf2_find_attribute(di, DW_AT_stmt_list, &stmt_list)) + if ((SymGetOptions() & SYMOPT_LOAD_LINES) && dwarf2_find_attribute(di, DW_AT_stmt_list, &stmt_list)) { if (dwarf2_parse_line_numbers(ctx, comp_dir.u.string, stmt_list.u.uvalue)) ctx->module_ctx->module->module.LineNumbers = TRUE; diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 1352fe145f4..0b28abf200d 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -3773,7 +3773,6 @@ static BOOL pdb_process_internal(const struct process *pcs, TRACE("Processing PDB file %ls\n", filename);
*has_linenumber_info = FALSE; - pdb_file = &pdb_module_info->pdb_files[module_index == -1 ? 0 : module_index]; /* Open and map() .PDB file */ if ((hFile = CreateFileW(filename, GENERIC_READ, FILE_SHARE_READ, NULL, @@ -3879,21 +3878,25 @@ static BOOL pdb_process_internal(const struct process *pcs, files_image}; codeview_snarf(msc_dbg, modimage, sizeof(DWORD), sfile.symbol_size, &cvmod, file_name);
- if (sfile.lineno_size && sfile.lineno2_size) - FIXME("Both line info present... only supporting second\n"); - else if (sfile.lineno_size) - { - if (codeview_snarf_linetab(msc_dbg, - modimage + sfile.symbol_size, - sfile.lineno_size, - pdb_file->kind == PDB_JG)) - *has_linenumber_info = TRUE; - } - else if (sfile.lineno2_size) + if (SymGetOptions() & SYMOPT_LOAD_LINES) { - if (codeview_snarf_linetab2(msc_dbg, &cvmod)) - *has_linenumber_info = TRUE; + if (sfile.lineno_size && sfile.lineno2_size) + FIXME("Both line info present... only supporting second\n"); + else if (sfile.lineno_size) + { + if (codeview_snarf_linetab(msc_dbg, + modimage + sfile.symbol_size, + sfile.lineno_size, + pdb_file->kind == PDB_JG)) + *has_linenumber_info = TRUE; + } + else if (sfile.lineno2_size) + { + if (codeview_snarf_linetab2(msc_dbg, &cvmod)) + *has_linenumber_info = TRUE; + } } + pdb_free(modimage); } file_name += strlen(file_name) + 1; @@ -3909,9 +3912,11 @@ static BOOL pdb_process_internal(const struct process *pcs, data = pdb_read_stream(pdb_file, symbols.global_hash_stream); if (data) { - codeview_snarf_sym_hashtable(msc_dbg, globalimage, global_size, - data, pdb_get_stream_size(pdb_file, symbols.global_hash_stream), - pdb_global_feed_variables); + if (codeview_snarf_sym_hashtable(msc_dbg, globalimage, global_size, + data, pdb_get_stream_size(pdb_file, + symbols.global_hash_stream), + pdb_global_feed_variables)) + *has_linenumber_info = TRUE; pdb_free((void*)data); } if (!(dbghelp_options & SYMOPT_NO_PUBLICS) && (data = pdb_read_stream(pdb_file, symbols.public_stream))) @@ -4415,23 +4420,25 @@ static BOOL codeview_process_info(const struct process *pcs, { codeview_snarf(msc_dbg, msc_dbg->root + ent->lfo, sizeof(DWORD), ent->cb, NULL, NULL);
- /* - * Check the next and previous entry. If either is a - * sstSrcModule, it contains the line number info for - * this file. - * - * FIXME: This is not a general solution! - */ - if (next && next->iMod == ent->iMod && next->SubSection == sstSrcModule) - if (codeview_snarf_linetab(msc_dbg, msc_dbg->root + next->lfo, - next->cb, TRUE)) - has_linenumber_info = TRUE; - - if (prev && prev->iMod == ent->iMod && prev->SubSection == sstSrcModule) - if (codeview_snarf_linetab(msc_dbg, msc_dbg->root + prev->lfo, - prev->cb, TRUE)) - has_linenumber_info = TRUE; - + if (SymGetOptions() & SYMOPT_LOAD_LINES) + { + /* + * Check the next and previous entry. If either is a + * sstSrcModule, it contains the line number info for + * this file. + * + * FIXME: This is not a general solution! + */ + if (next && next->iMod == ent->iMod && next->SubSection == sstSrcModule) + if (codeview_snarf_linetab(msc_dbg, msc_dbg->root + next->lfo, + next->cb, TRUE)) + has_linenumber_info = TRUE; + + if (prev && prev->iMod == ent->iMod && prev->SubSection == sstSrcModule) + if (codeview_snarf_linetab(msc_dbg, msc_dbg->root + prev->lfo, + prev->cb, TRUE)) + has_linenumber_info = TRUE; + } } }
diff --git a/dlls/dbghelp/stabs.c b/dlls/dbghelp/stabs.c index d02f320e281..8d9b91eeb4f 100644 --- a/dlls/dbghelp/stabs.c +++ b/dlls/dbghelp/stabs.c @@ -1493,21 +1493,24 @@ BOOL stabs_parse(struct module* module, ULONG_PTR load_offset, if (curr_func != NULL) pending_add_var(&pending_block, ptr, DataIsLocal, &loc); break; case N_SLINE: - /* - * This is a line number. These are always relative to the start - * of the function (N_FUN), and this makes the lookup easier. - */ - assert(source_idx >= 0); - if (curr_func != NULL) + if (SymGetOptions() & SYMOPT_LOAD_LINES) { - ULONG_PTR offset = n_value; - if (module->type == DMT_MACHO) - offset -= curr_func->ranges[0].low - load_offset; - symt_add_func_line(module, curr_func, source_idx, - stab_ptr->n_desc, curr_func->ranges[0].low + offset); + /* + * This is a line number. These are always relative to the start + * of the function (N_FUN), and this makes the lookup easier. + */ + assert(source_idx >= 0); + if (curr_func != NULL) + { + ULONG_PTR offset = n_value; + if (module->type == DMT_MACHO) + offset -= curr_func->ranges[0].low - load_offset; + symt_add_func_line(module, curr_func, source_idx, + stab_ptr->n_desc, curr_func->ranges[0].low + offset); + } + else pending_add_line(&pending_func, source_idx, stab_ptr->n_desc, + n_value, load_offset); } - else pending_add_line(&pending_func, source_idx, stab_ptr->n_desc, - n_value, load_offset); break; case N_FUN: /*