void poffReleaseDebugFuncInfoTable(void) { poffLibDebugFuncInfo_t *pDebugInfo; poffLibDebugFuncInfo_t *pNextDebugInfo; /* Release the bufferred debug information */ pDebugInfo = g_pDebugInfoHead; while (pDebugInfo) { pNextDebugInfo = pDebugInfo->next; poffReleaseDebugFuncContainer(pDebugInfo); pDebugInfo = pNextDebugInfo; } g_pDebugInfoHead = NULL; g_pDebugInfoTail = NULL; }
static void pass4(poffHandle_t poffHandle) { poffLibDebugFuncInfo_t *pDebugInfoHead = NULL; poffLibDebugFuncInfo_t *pDebugInfoTail = NULL; poffLibDebugFuncInfo_t *pDebugInfo; poffLibDebugFuncInfo_t *pNextDebugInfo; /* Read all function debug information into a link list */ while ((pDebugInfo = poffGetDebugFuncInfo(poffHandle)) != NULL) { if (!pDebugInfoHead) { pDebugInfoHead = pDebugInfo; } else { pDebugInfoTail->next = pDebugInfo; } pDebugInfoTail = pDebugInfo; } /* Convert all of the label references to pcode offsets */ for (pDebugInfo = pDebugInfoHead; pDebugInfo; pDebugInfo = pDebugInfo->next) { /* Check if this is a defined label. This must be the case * because there can be no jumps into a unit file. */ int32_t value = poffGetPcForDefinedLabel(pDebugInfo->value); if (value >= 0) { /* Yes... replace the label reference with a text section offset. */ pDebugInfo->value = value; } else { fatal(ePOFFCONFUSION); } } /* Then put all of the debug info back into the POFF object */ poffDiscardDebugFuncInfo(poffHandle); for (pDebugInfo = pDebugInfoHead; pDebugInfo; pDebugInfo = pDebugInfo->next) { poffAddDebugFuncInfo(poffHandle, pDebugInfo); } /* Release the bufferred debug information */ pDebugInfo = pDebugInfoHead; while (pDebugInfo) { pNextDebugInfo = pDebugInfo->next; poffReleaseDebugFuncContainer(pDebugInfo); pDebugInfo = pNextDebugInfo; } }