| 514 | } |
| 515 | |
| 516 | std::pair<cmUVProcessChain::ExceptionCode, std::string> |
| 517 | cmUVProcessChain::Status::GetException() const |
| 518 | { |
| 519 | if (this->SpawnResult) { |
| 520 | return std::make_pair(ExceptionCode::Spawn, |
| 521 | uv_strerror(this->SpawnResult)); |
| 522 | } |
| 523 | #ifdef _WIN32 |
| 524 | if (this->Finished && (this->ExitStatus & 0xF0000000) == 0xC0000000) { |
| 525 | // Child terminated due to exceptional behavior. |
| 526 | switch (this->ExitStatus) { |
| 527 | case STATUS_CONTROL_C_EXIT: |
| 528 | return std::make_pair(ExceptionCode::Interrupt, "User interrupt"); |
| 529 | |
| 530 | case STATUS_FLOAT_DENORMAL_OPERAND: |
| 531 | return std::make_pair(ExceptionCode::Numerical, |
| 532 | "Floating-point exception (denormal operand)"); |
| 533 | case STATUS_FLOAT_DIVIDE_BY_ZERO: |
| 534 | return std::make_pair(ExceptionCode::Numerical, "Divide-by-zero"); |
| 535 | case STATUS_FLOAT_INEXACT_RESULT: |
| 536 | return std::make_pair(ExceptionCode::Numerical, |
| 537 | "Floating-point exception (inexact result)"); |
| 538 | case STATUS_FLOAT_INVALID_OPERATION: |
| 539 | return std::make_pair(ExceptionCode::Numerical, |
| 540 | "Invalid floating-point operation"); |
| 541 | case STATUS_FLOAT_OVERFLOW: |
| 542 | return std::make_pair(ExceptionCode::Numerical, |
| 543 | "Floating-point overflow"); |
| 544 | case STATUS_FLOAT_STACK_CHECK: |
| 545 | return std::make_pair(ExceptionCode::Numerical, |
| 546 | "Floating-point stack check failed"); |
| 547 | case STATUS_FLOAT_UNDERFLOW: |
| 548 | return std::make_pair(ExceptionCode::Numerical, |
| 549 | "Floating-point underflow"); |
| 550 | # ifdef STATUS_FLOAT_MULTIPLE_FAULTS |
| 551 | case STATUS_FLOAT_MULTIPLE_FAULTS: |
| 552 | return std::make_pair(ExceptionCode::Numerical, |
| 553 | "Floating-point exception (multiple faults)"); |
| 554 | # endif |
| 555 | # ifdef STATUS_FLOAT_MULTIPLE_TRAPS |
| 556 | case STATUS_FLOAT_MULTIPLE_TRAPS: |
| 557 | return std::make_pair(ExceptionCode::Numerical, |
| 558 | "Floating-point exception (multiple traps)"); |
| 559 | # endif |
| 560 | case STATUS_INTEGER_DIVIDE_BY_ZERO: |
| 561 | return std::make_pair(ExceptionCode::Numerical, |
| 562 | "Integer divide-by-zero"); |
| 563 | case STATUS_INTEGER_OVERFLOW: |
| 564 | return std::make_pair(ExceptionCode::Numerical, "Integer overflow"); |
| 565 | |
| 566 | case STATUS_DATATYPE_MISALIGNMENT: |
| 567 | return std::make_pair(ExceptionCode::Fault, "Datatype misalignment"); |
| 568 | case STATUS_ACCESS_VIOLATION: |
| 569 | return std::make_pair(ExceptionCode::Fault, "Access violation"); |
| 570 | case STATUS_IN_PAGE_ERROR: |
| 571 | return std::make_pair(ExceptionCode::Fault, "In-page error"); |
| 572 | case STATUS_INVALID_HANDLE: |
| 573 | return std::make_pair(ExceptionCode::Fault, "Invalid handle"); |