codeview: Call register_file only when producing line numbers
commitc74a70988520bb25d5fbde22881f43c4e2b06603
authorFabian Giesen <fabiang@radgametools.com>
Thu, 28 Apr 2016 20:48:16 +0000 (28 13:48 -0700)
committerCyrill Gorcunov <gorcunov@gmail.com>
Tue, 10 May 2016 09:01:32 +0000 (10 12:01 +0300)
treeb689b88829c30ef79047b3567528b1bf4a848b39
parent142285ddd8e8d2cb08003198d7186db9d3286ac1
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 <fabiang@radgametools.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
output/codeview.c