MCPcopy Create free account
hub / github.com/catboost/catboost / Resolve

Method Resolve

util/system/backtrace.cpp:185–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183 }
184
185 TResolvedSymbol Resolve(void* sym, char* buf, size_t len) {
186 TGuard<TMutex> guard(Mutex);
187
188 TResolvedSymbol ret = {
189 "??",
190 sym};
191
192 if (!InitOk || (len <= 1 + sizeof(SYMBOL_INFO))) {
193 return ret;
194 }
195
196 SYMBOL_INFO* symbol = (SYMBOL_INFO*)buf;
197 Zero(*symbol);
198
199 symbol->MaxNameLen = len - sizeof(SYMBOL_INFO) - 1;
200 symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
201
202 DWORD64 displacement = 0;
203 BOOL res = SymFromAddrFunc(GetCurrentProcess(), (DWORD64)sym, &displacement, symbol);
204 if (res) {
205 ret.NearestSymbol = (void*)symbol->Address;
206 ret.Name = symbol->Name;
207 }
208
209 return ret;
210 }
211
212 TMutex Mutex;
213 HMODULE Library;

Callers 1

ResolveSymbolFunction · 0.45

Calls 1

ZeroFunction · 0.85

Tested by

no test coverage detected