From 902d9742888bdea50dde52d1355dcd85f6b42589 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 24 Sep 2001 21:44:28 +0000 Subject: [PATCH] Save filename as well as line number for each symbol. svn path=/trunk/yasm/; revision=224 --- libyasm/symrec.c | 1 + libyasm/symrec.h | 3 ++- src/symrec.c | 1 + src/symrec.h | 3 ++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libyasm/symrec.c b/libyasm/symrec.c index 779e03a1..2196638e 100644 --- a/libyasm/symrec.c +++ b/libyasm/symrec.c @@ -67,6 +67,7 @@ symrec_get_or_new(char *name, SymType type) Fatal(FATAL_NOMEM); rec->type = type; rec->value = 0; + rec->filename = strdup(filename); rec->line = line_number; rec->status = SYM_NOSTATUS; diff --git a/libyasm/symrec.h b/libyasm/symrec.h index 936c6728..fd2e5c38 100644 --- a/libyasm/symrec.h +++ b/libyasm/symrec.h @@ -38,7 +38,8 @@ typedef struct symrec_s { char *name; SymType type; SymStatus status; - int line; /* line symbol was first declared or used on */ + char *filename; /* file and line */ + int line; /* symbol was first declared or used on */ double value; } symrec; diff --git a/src/symrec.c b/src/symrec.c index 779e03a1..2196638e 100644 --- a/src/symrec.c +++ b/src/symrec.c @@ -67,6 +67,7 @@ symrec_get_or_new(char *name, SymType type) Fatal(FATAL_NOMEM); rec->type = type; rec->value = 0; + rec->filename = strdup(filename); rec->line = line_number; rec->status = SYM_NOSTATUS; diff --git a/src/symrec.h b/src/symrec.h index 936c6728..fd2e5c38 100644 --- a/src/symrec.h +++ b/src/symrec.h @@ -38,7 +38,8 @@ typedef struct symrec_s { char *name; SymType type; SymStatus status; - int line; /* line symbol was first declared or used on */ + char *filename; /* file and line */ + int line; /* symbol was first declared or used on */ double value; } symrec;