| 350 | } |
| 351 | |
| 352 | CoreCrashInfo |
| 353 | CoreFileExtractor::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 | |
| 381 | CorePsInfo |
| 382 | CoreFileExtractor::extractPSInfo() const |
nothing calls this directly
no test coverage detected