From: nasm-bot f. F. G. <fa...@ra...> - 2016-05-10 09:06:23
|
Commit-ID: c74a70988520bb25d5fbde22881f43c4e2b06603 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=c74a70988520bb25d5fbde22881f43c4e2b06603 Author: Fabian Giesen <fa...@ra...> AuthorDate: Thu, 28 Apr 2016 13:48:16 -0700 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Tue, 10 May 2016 12:01:32 +0300 codeview: Call register_file only when producing line numbers Previously, debug info would refer to the first file seen, even when it did not actually generate line numbers (e.g. segto=-1). Fix it so we only lock in the file name the first time we actually produce a line number record. Not as good as proper support for debug info referencing multiple source files but much more useful than the current behavior. Signed-off-by: Fabian Giesen <fa...@ra...> Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- output/codeview.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/output/codeview.c b/output/codeview.c index 56c46f2..616f574 100644 --- a/output/codeview.c +++ b/output/codeview.c @@ -169,9 +169,6 @@ static void cv8_linenum(const char *filename, int32_t linenumber, struct coff_Section *s; struct linepair *li; - if (cv8_state.source_file.name == NULL) - register_file(filename); - s = find_section(segto); if (s == NULL) return; @@ -179,6 +176,9 @@ static void cv8_linenum(const char *filename, int32_t linenumber, if ((s->flags & IMAGE_SCN_MEM_EXECUTE) == 0) return; + if (cv8_state.source_file.name == NULL) + register_file(filename); + li = saa_wstruct(cv8_state.lines); li->file_offset = cv8_state.text_offset; li->linenumber = linenumber; |