Changeset 1205


Ignore:
Timestamp:
Feb 8, 2004, 4:53:22 AM (22 years ago)
Author:
bird
Message:

Diagnostics.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/emxomf/weakld.c

    • Property cvs2svn:cvs-rev changed from 1.25 to 1.26
    r1204 r1205  
    443443static inline unsigned symHash(const char* pszSym, unsigned cch);
    444444static const char * symGetDescr(PWLDSYM pSym);
     445static void         symDumpReferers(PWLDSYM pSym);
    445446static void         symDbg(PWLDSYM pSym, const char *pszMsg);
    446447static PWLDSYM      symAdd(PWLD pWld, PWLDMOD pMod, unsigned fFlags, const char *pachName, int cchName, PWLDSYMACTION peAction);
     
    13561357    else
    13571358        wldErr(pWld, "Unresolved symbol (%s) '%s'.", symGetDescr(pSym), pSym->pszName);
    1358     if (pSym->cReferers)
    1359     {
    1360         int     i;
    1361         wldInfo("The symbol is referenced by:\n");
    1362         for (i = 0; i < pSym->cReferers; i++)
    1363         {
    1364             pMod = pSym->paReferers[i];
    1365             if (pMod->pLib)
    1366                 fprintf(stderr, "    %s(%s)\n", pMod->pLib->pszLibName, pMod->pszModName);
    1367             else
    1368                 fprintf(stderr, "    %s\n", pMod->pszModName);
    1369         }
    1370     }
     1359    symDumpReferers(pSym);
    13711360    return 0;
    13721361}
     
    14611450}
    14621451
     1452
     1453/**
     1454 * Dumps the list of modules referencing a symbol.
     1455 *
     1456 * @param   pSym    Symbol in question.
     1457 */
     1458static void symDumpReferers(PWLDSYM pSym)
     1459{
     1460    if (pSym->cReferers)
     1461    {
     1462        int i;
     1463        wldInfo("The symbol is referenced by:\n");
     1464        for (i = 0; i < pSym->cReferers; i++)
     1465        {
     1466            PWLDMOD pMod = pSym->paReferers[i];
     1467            if (pMod->pLib)
     1468                fprintf(stderr, "    %s(%s)\n", pMod->pLib->pszLibName, pMod->pszModName);
     1469            else
     1470                fprintf(stderr, "    %s\n", pMod->pszModName);
     1471        }
     1472    }
     1473}
    14631474
    14641475
     
    17091720            modErr(pMod, "Duplicate symbol '%s' ('%s').", pszName, pSym->pszName);
    17101721            if (pSym->pMod)
    1711                 modErr(pSym->pMod, "Previous symbol defined in this module.");
    1712             wldInfo("fFlags new 0x%04x  fFlags old 0x%04x.", fFlags, pSym->fFlags);
     1722                modErr(pSym->pMod, "Symbol previosly defined in this module.");
     1723            wldInfo("fFlags new 0x%04x  fFlags old 0x%04x (%s).", fFlags, pSym->fFlags, symGetDescr(pSym));
     1724            symDumpReferers(pSym);
    17131725            pSym = NULL;
    17141726        }
    1715 
    1716         /*
    1717          * Maintain the module pointer and referers.
    1718          */
    1719         if (pSym)
    1720         {
    1721             if (SYM_IS_DEFINED(pSym->fFlags))
    1722                 pSym->pMod = pMod;
    1723             else
     1727    }
     1728
     1729    /*
     1730     * Maintain the module pointer and referers.
     1731     */
     1732    if (pSym)
     1733    {
     1734        if (SYM_IS_DEFINED(pSym->fFlags))
     1735            pSym->pMod = pMod;
     1736        else
     1737        {
     1738            int i;
     1739            for (i = 0; i < pSym->cReferers; i++)
     1740                if (pSym->paReferers[i] == pMod)
     1741                    break;
     1742            if (i >= pSym->cReferers)
    17241743            {
    1725                 int i;
    1726                 for (i = 0; i < pSym->cReferers; i++)
    1727                     if (pSym->paReferers[i] == pMod)
    1728                         break;
    1729                 if (i >= pSym->cReferers)
    1730                 {
    1731                     if (!(pSym->cReferers % 64))
    1732                         pSym->paReferers = xrealloc(pSym->paReferers, sizeof(pSym->paReferers[0]) * (pSym->cReferers + 64));
    1733                     pSym->paReferers[pSym->cReferers++] = pMod;
    1734                 }
     1744                if (!(pSym->cReferers % 64))
     1745                    pSym->paReferers = xrealloc(pSym->paReferers, sizeof(pSym->paReferers[0]) * (pSym->cReferers + 64));
     1746                pSym->paReferers[pSym->cReferers++] = pMod;
    17351747            }
    17361748        }
Note: See TracChangeset for help on using the changeset viewer.