/* BuildSymbolTest.c DHL Test routine series. BuildSymbol module test. Digital STREAM Technology, Inc. */ #include "DHL_Types.h" #include "DHL_BuildSymbol.h" #include "DHL_OS_DebugIO.h" #include "DHL_Console.h" #define printf OS_DbgPrintf void Symbol_Test(void) { UINT32 addr, addr2; const char *name; printf("\n** %s:\n\n", __func__); //---------------------------- printf("\n** name('%s') -> addr test:\n", __func__); addr = DHL_DBG_FindSymbolByName(__func__); if (addr) printf("\t symbol '%s': 0x%x\n", __func__, addr); else printf("\t !! err\n"); //---------------------------- addr2 = addr + 10; printf("\n** addr(0x%x) -> name test:\n", addr2); addr = DHL_DBG_FindSymbolByAddr(addr2, &name); if (addr) printf("\t 0x%x = '%s' + %08x\n", addr2, name, addr2-addr); else printf("\t !! err\n"); //---------------------------- while (1) { char buf[200]; int n; printf("\n type string to search ('x' to exit): "); n = DHL_DBG_GetLine(buf, 200, 0); if (n < 0) continue; if (strcmp(buf, "x") == 0) break; printf("\n lookup symbol '%s'..\n", buf); DHL_DBG_LookupSymbols(buf); } printf("\n exit test\n"); }