From adf9a7703fd526379a6efb5c98a90d475fed872c Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Sat, 15 Apr 2023 10:44:50 -0400 Subject: [PATCH] Added a statement for every file load that prints the file path of the cell. This will greatly help in diagnosing issues when reading cells from multiple locations including cwd, relative paths, PDK libraries, and the search path. Also: Reworked the timestamp update message so that it prints all at once at the end of processing, not printing output for every cell processed as it is being processed. That prevents output from the file read routine from getting interleaved with the timestamp processing output. --- VERSION | 2 +- database/DBio.c | 17 +++++++++++++++++ database/DBtimestmp.c | 27 ++++++++++++++++++--------- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index 18f2fc9b..76405d41 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.389 +8.3.390 diff --git a/database/DBio.c b/database/DBio.c index bd407034..eb984cb3 100644 --- a/database/DBio.c +++ b/database/DBio.c @@ -1432,6 +1432,23 @@ dbReadOpen(cellDef, setFileName, dereference, errptr) if (!strcmp(pptr, DBSuffix)) *pptr = '\0'; (void) StrDup(&cellDef->cd_file, filename); + if (DBVerbose >= DB_VERBOSE_ALL) + { + char *sptr = strrchr(filename, '/'); + if (sptr == NULL) + TxPrintf("Cell %s read from current working directory\n", + cellDef->cd_name); + else + { + *sptr = '\0'; + TxPrintf("Cell %s read from path %s\n", cellDef->cd_name, filename); + } + } + } + else if (DBVerbose >= DB_VERBOSE_WARN) + { + TxPrintf("Warning: Loaded cell %s but recorded file path is %s\n", + filename, cellDef->cd_file); } cellDef->cd_flags |= CDAVAILABLE; return (f); diff --git a/database/DBtimestmp.c b/database/DBtimestmp.c index 3ad6d7cb..3172e7c7 100644 --- a/database/DBtimestmp.c +++ b/database/DBtimestmp.c @@ -84,6 +84,10 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/ int timestamp; +typedef struct _celllist { + CellDef *cl_cell; + struct _celllist *cl_next; +} CellList; /* * ---------------------------------------------------------------------------- @@ -107,9 +111,9 @@ DBFixMismatch() { CellDef *cellDef; CellUse *parentUse; + CellList *cl = NULL, *clnew; Rect oldArea, parentArea, tmp; int redisplay; - int firstOne = TRUE; Mismatch *tmpm; /* It's very important to disable interrupts during this section! @@ -118,7 +122,7 @@ DBFixMismatch() redisplay = FALSE; if (mismatch == NULL) return; - TxPrintf("Processing timestamp mismatches:"); + TxPrintf("Processing timestamp mismatches.\n"); SigDisableInterrupts(); for (tmpm = mismatch; tmpm; tmpm = tmpm->mm_next) @@ -174,15 +178,20 @@ DBFixMismatch() redisplay = TRUE; } cellDef->cd_flags |= CDPROCESSED; - if (firstOne) - { - TxPrintf(" %s", cellDef->cd_name); - firstOne = FALSE; - } - else TxPrintf(", %s", cellDef->cd_name); - TxFlush(); /* This is needed to prevent _doprnt screwups */ + clnew = (CellList *)mallocMagic(sizeof(CellList)); + clnew->cl_cell = cellDef; + clnew->cl_next = cl; + cl = clnew; } SigEnableInterrupts(); + TxPrintf("Timestamp mismatches found in these cells: "); + while (cl != NULL) + { + TxPrintf("%s", cl->cl_cell->cd_name); + if (cl->cl_next != NULL) TxPrintf(", "); + freeMagic(cl); + cl = cl->cl_next; + } TxPrintf(".\n"); TxFlush(); if (redisplay) WindAreaChanged((MagWindow *) NULL, (Rect *) NULL);