diff options
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | assemble.c | 13 |
2 files changed, 12 insertions, 2 deletions
@@ -7,6 +7,7 @@ * Fix the STR instruction. * Fix the ELF output format, which was broken under certain circumstances due to the addition of stabs support. +* Quick-fix Borland format debug-info for -f obj 0.98.37 ------- @@ -105,8 +105,8 @@ static int chsize (operand *, int); static void out (long offset, long segto, const void *data, unsigned long type, long segment, long wrt) { - long lineno; - char *lnfname = NULL; + static long lineno = 0; /* static!!! */ + static char *lnfname = NULL; if ((type & OUT_TYPMASK) == OUT_ADDRESS) { if (segment != NO_SEG || wrt != NO_SEG) { @@ -143,6 +143,15 @@ static void out (long offset, long segto, const void *data, unsigned long type, list->output (offset, data, type); } + /* + * this call to src_get determines when we call the + * debug-format-specific "linenum" function + * it updates lineno and lnfname to the current values + * returning 0 if "same as last time", -2 if lnfname + * changed, and the amount by which lineno changed, + * if it did. thus, these variables must be static + */ + if (src_get(&lineno,&lnfname)) { outfmt->current_dfmt->linenum(lnfname,lineno,segto); |