diff --git a/scp.c b/scp.c index 7edc324d..ec910d4f 100644 --- a/scp.c +++ b/scp.c @@ -16252,7 +16252,9 @@ for (i = 0; (dptr = devices[i]) != NULL; i++) { } if (arptr != NULL) { Bad = TRUE; - Mprintf (f, "\tThe %s DEVICE %d REGister entry has an identical name\n", dptr->name, amb_entry); + if (rptr->source_file != NULL) + Mprintf (f, "\tIn %s at line %d:\n", rptr->source_file, rptr->source_line); + Mprintf (f, "\tThe %s DEVICE's REGister entry #%d has an identical name\n", dptr->name, amb_entry + 1); Mprintf (f, "\ttherefore EXAMINE and SAVE operations will reference %u byte%s\n", bytes, (bytes != 1) ? "s" : ""); Mprintf (f, "\tand DEPOSIT and RESTORE operations will affect %u byte%s of memory\n", bytes, (bytes != 1) ? "s" : ""); Mprintf (f, "\tinconsistently.\n"); diff --git a/sim_defs.h b/sim_defs.h index 136e6d5e..c2e49ae0 100644 --- a/sim_defs.h +++ b/sim_defs.h @@ -705,6 +705,8 @@ struct REG { size_t obj_size; /* sizeof(*loc) */ size_t size; /* sizeof(**loc) or sizeof(*loc) if depth == 1 */ const char *macro; /* Initializer Macro Name */ + const char *source_file; /* source file used macro */ + int source_line; /* source line used macro */ /* NOTE: Flags and maxval MUST always be last since they are initialized outside of macro definitions */ uint32 flags; /* flags */ t_value maxval; /* maximum value */ @@ -1019,7 +1021,7 @@ struct MEMFILE { /* Internal use ONLY (see below) Generic Register declaration for all fields */ #define _RegCheck(nm,loc,rdx,wd,off,dep,desc,flds,qptr,siz,elesiz,macro) \ - nm, (loc), (rdx), (wd), (off), (dep), (desc), (flds), (qptr), (siz), sizeof(*(loc)), (elesiz), #macro + nm, (loc), (rdx), (wd), (off), (dep), (desc), (flds), (qptr), (siz), sizeof(*(loc)), (elesiz), #macro, __FILE__, __LINE__ /* Generic Register declaration for all fields. If the register structure is extended, this macro will be retained and a