| 406 | |
| 407 | |
| 408 | Ref<DebugInfo> DebugInfoParser::Parse(Ref<BinaryView> view, Ref<BinaryView> debugFile, Ref<DebugInfo> existingDebugInfo, |
| 409 | std::function<bool(size_t, size_t)> progress) const |
| 410 | { |
| 411 | ProgressContext ctxt; |
| 412 | if (progress) |
| 413 | ctxt.callback = progress; |
| 414 | else |
| 415 | ctxt.callback = [=](size_t, size_t) { return true; }; |
| 416 | |
| 417 | BNDebugInfo* info = nullptr; |
| 418 | if (existingDebugInfo) |
| 419 | { |
| 420 | info = BNParseDebugInfo(m_object, view->GetObject(), debugFile->GetObject(), existingDebugInfo->GetObject(), |
| 421 | ProgressCallback, &ctxt); |
| 422 | if (!info) |
| 423 | return nullptr; |
| 424 | info = BNNewDebugInfoReference(info); |
| 425 | } |
| 426 | else |
| 427 | { |
| 428 | info = BNParseDebugInfo(m_object, view->GetObject(), debugFile->GetObject(), nullptr, ProgressCallback, &ctxt); |
| 429 | if (!info) |
| 430 | return nullptr; |
| 431 | } |
| 432 | return new DebugInfo(info); |
| 433 | } |
| 434 | |
| 435 | |
| 436 | bool DebugInfoParser::IsValidForView(const Ref<BinaryView> view) const |
no test coverage detected