MCPcopy Create free account
hub / github.com/bloomberg/pystack / extractFailureInfo

Method extractFailureInfo

src/pystack/_pystack/corefile.cpp:352–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352CoreCrashInfo
353CoreFileExtractor::extractFailureInfo() const
354{
355 Elf* elf = d_analyzer->d_elf.get();
356 CoreCrashInfo result{};
357
358 LOG(DEBUG) << "Extracting failure info structure";
359
360 LOG(DEBUG) << "Checking for NT_SIGINFO section";
361 // Check first if we have a NT_SIGINFO section, as more information can be retrieved from it
362 for (const auto& note_data : getNoteData(elf, NT_SIGINFO, ELF_T_XWORD)) {
363 if (parseCoreSiginfo(note_data, &result) != StatusCode::ERROR) {
364 LOG(DEBUG) << "NT_SIGINFO found";
365 return result;
366 }
367 }
368
369 // Fallback to the NT_PRSTATUS section (even old kernels should always produce this).
370 LOG(DEBUG) << "Checking for NT_PRSTATUS section";
371 for (const auto& note_data : getNoteData(elf, NT_PRSTATUS, ELF_T_XWORD)) {
372 if (parseCorePrstatus(note_data, &result) != StatusCode::ERROR) {
373 LOG(DEBUG) << "NT_PRSTATUS found";
374 return result;
375 }
376 }
377 LOG(DEBUG) << "Failed to locate the NOTE data for the failure info in the core file";
378 return {};
379}
380
381CorePsInfo
382CoreFileExtractor::extractPSInfo() const

Callers

nothing calls this directly

Calls 4

LOGClass · 0.85
getNoteDataFunction · 0.85
parseCoreSiginfoFunction · 0.85
parseCorePrstatusFunction · 0.85

Tested by

no test coverage detected