MCPcopy Create free account
hub / github.com/crownengine/crown / DbgHelpSymbolResolve

Method DbgHelpSymbolResolve

3rdparty/bx/src/debug.cpp:732–772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

730 struct DbgHelpSymbolResolve
731 {
732 DbgHelpSymbolResolve()
733 {
734 m_imageHlpDll = dlopen("dbghelp.dll");
735
736 if (NULL != m_imageHlpDll)
737 {
738 m_symInitialize = dlsym<SymInitializeFn >(m_imageHlpDll, "SymInitialize");
739 m_symCleanup = dlsym<SymCleanupFn >(m_imageHlpDll, "SymCleanup");
740 m_symFromAddr = dlsym<SymFromAddrFn >(m_imageHlpDll, "SymFromAddr");
741 m_symSetOptions = dlsym<SymSetOptionsFn >(m_imageHlpDll, "SymSetOptions");
742 m_symGetLineFromAddr = dlsym<SymGetLineFromAddrFn>(m_imageHlpDll, BX_ARCH_32BIT ? "SymGetLineFromAddr" : "SymGetLineFromAddr64");
743
744 if (true
745 && NULL != m_symInitialize
746 && NULL != m_symCleanup
747 && NULL != m_symFromAddr
748 && NULL != m_symSetOptions
749 && NULL != m_symGetLineFromAddr
750 )
751 {
752 m_symSetOptions(kSymOptUndName | kSymOptDeferredLoads | kSymOptLoadLines);
753
754 char symCache[1024] = "SRV*";
755 uint32_t len = BX_COUNTOF(symCache) - 4;
756 if (getEnv(symCache + 4, &len, "TEMP") )
757 {
758 len += 4;
759 snprintf(symCache + len, BX_COUNTOF(symCache) - len, "\\SymbolCache*http://msdl.microsoft.com/download/symbols;");
760 }
761 else
762 {
763 symCache[0] = '\0';
764 }
765
766 if (!m_symInitialize(kCurrentProcess, symCache, true) )
767 {
768 cleanup();
769 }
770 }
771 }
772 }
773
774 ~DbgHelpSymbolResolve()
775 {

Callers

nothing calls this directly

Calls 3

dlopenFunction · 0.85
getEnvFunction · 0.70
snprintfFunction · 0.70

Tested by

no test coverage detected