cmProcess.cxx 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmProcess.h"
  4. #include <csignal>
  5. #include <iostream>
  6. #include <string>
  7. #include <utility>
  8. #include <cmext/algorithm>
  9. #include "cmsys/Process.h"
  10. #include "cmCTest.h"
  11. #include "cmCTestRunTest.h"
  12. #include "cmCTestTestHandler.h"
  13. #include "cmGetPipes.h"
  14. #include "cmStringAlgorithms.h"
  15. #if defined(_WIN32)
  16. # include "cm_kwiml.h"
  17. #endif
  18. #define CM_PROCESS_BUF_SIZE 65536
  19. cmProcess::cmProcess(std::unique_ptr<cmCTestRunTest> runner)
  20. : Runner(std::move(runner))
  21. , Conv(cmProcessOutput::UTF8, CM_PROCESS_BUF_SIZE)
  22. {
  23. this->Timeout = cmDuration::zero();
  24. this->TotalTime = cmDuration::zero();
  25. this->ExitValue = 0;
  26. this->Id = 0;
  27. this->StartTime = std::chrono::steady_clock::time_point();
  28. }
  29. cmProcess::~cmProcess() = default;
  30. void cmProcess::SetCommand(std::string const& command)
  31. {
  32. this->Command = command;
  33. }
  34. void cmProcess::SetCommandArguments(std::vector<std::string> const& args)
  35. {
  36. this->Arguments = args;
  37. }
  38. void cmProcess::SetWorkingDirectory(std::string const& dir)
  39. {
  40. this->WorkingDirectory = dir;
  41. }
  42. bool cmProcess::StartProcess(uv_loop_t& loop, std::vector<size_t>* affinity)
  43. {
  44. this->ProcessState = cmProcess::State::Error;
  45. if (this->Command.empty()) {
  46. return false;
  47. }
  48. this->StartTime = std::chrono::steady_clock::now();
  49. this->ProcessArgs.clear();
  50. // put the command as arg0
  51. this->ProcessArgs.push_back(this->Command.c_str());
  52. // now put the command arguments in
  53. for (std::string const& arg : this->Arguments) {
  54. this->ProcessArgs.push_back(arg.c_str());
  55. }
  56. this->ProcessArgs.push_back(nullptr); // null terminate the list
  57. cm::uv_timer_ptr timer;
  58. int status = timer.init(loop, this);
  59. if (status != 0) {
  60. cmCTestLog(this->Runner->GetCTest(), ERROR_MESSAGE,
  61. "Error initializing timer: " << uv_strerror(status)
  62. << std::endl);
  63. return false;
  64. }
  65. cm::uv_pipe_ptr pipe_writer;
  66. cm::uv_pipe_ptr pipe_reader;
  67. pipe_writer.init(loop, 0);
  68. pipe_reader.init(loop, 0, this);
  69. int fds[2] = { -1, -1 };
  70. status = cmGetPipes(fds);
  71. if (status != 0) {
  72. cmCTestLog(this->Runner->GetCTest(), ERROR_MESSAGE,
  73. "Error initializing pipe: " << uv_strerror(status)
  74. << std::endl);
  75. return false;
  76. }
  77. uv_pipe_open(pipe_reader, fds[0]);
  78. uv_pipe_open(pipe_writer, fds[1]);
  79. uv_stdio_container_t stdio[3];
  80. stdio[0].flags = UV_INHERIT_FD;
  81. stdio[0].data.fd = 0;
  82. stdio[1].flags = UV_INHERIT_STREAM;
  83. stdio[1].data.stream = pipe_writer;
  84. stdio[2] = stdio[1];
  85. uv_process_options_t options = uv_process_options_t();
  86. options.file = this->Command.data();
  87. options.args = const_cast<char**>(this->ProcessArgs.data());
  88. options.stdio_count = 3; // in, out and err
  89. options.exit_cb = &cmProcess::OnExitCB;
  90. options.stdio = stdio;
  91. #if !defined(CMAKE_USE_SYSTEM_LIBUV)
  92. std::vector<char> cpumask;
  93. if (affinity && !affinity->empty()) {
  94. cpumask.resize(static_cast<size_t>(uv_cpumask_size()), 0);
  95. for (auto p : *affinity) {
  96. cpumask[p] = 1;
  97. }
  98. options.cpumask = cpumask.data();
  99. options.cpumask_size = cpumask.size();
  100. } else {
  101. options.cpumask = nullptr;
  102. options.cpumask_size = 0;
  103. }
  104. #else
  105. static_cast<void>(affinity);
  106. #endif
  107. status =
  108. uv_read_start(pipe_reader, &cmProcess::OnAllocateCB, &cmProcess::OnReadCB);
  109. if (status != 0) {
  110. cmCTestLog(this->Runner->GetCTest(), ERROR_MESSAGE,
  111. "Error starting read events: " << uv_strerror(status)
  112. << std::endl);
  113. return false;
  114. }
  115. status = this->Process.spawn(loop, options, this);
  116. if (status != 0) {
  117. cmCTestLog(this->Runner->GetCTest(), ERROR_MESSAGE,
  118. "Process not started\n " << this->Command << "\n["
  119. << uv_strerror(status) << "]\n");
  120. return false;
  121. }
  122. this->PipeReader = std::move(pipe_reader);
  123. this->Timer = std::move(timer);
  124. this->StartTimer();
  125. this->ProcessState = cmProcess::State::Executing;
  126. return true;
  127. }
  128. void cmProcess::StartTimer()
  129. {
  130. auto properties = this->Runner->GetTestProperties();
  131. auto msec =
  132. std::chrono::duration_cast<std::chrono::milliseconds>(this->Timeout);
  133. if (msec != std::chrono::milliseconds(0) || !properties->ExplicitTimeout) {
  134. this->Timer.start(&cmProcess::OnTimeoutCB,
  135. static_cast<uint64_t>(msec.count()), 0);
  136. }
  137. }
  138. bool cmProcess::Buffer::GetLine(std::string& line)
  139. {
  140. // Scan for the next newline.
  141. for (size_type sz = this->size(); this->Last != sz; ++this->Last) {
  142. if ((*this)[this->Last] == '\n' || (*this)[this->Last] == '\0') {
  143. // Extract the range first..last as a line.
  144. const char* text = this->data() + this->First;
  145. size_type length = this->Last - this->First;
  146. while (length && text[length - 1] == '\r') {
  147. length--;
  148. }
  149. line.assign(text, length);
  150. // Start a new range for the next line.
  151. ++this->Last;
  152. this->First = Last;
  153. // Return the line extracted.
  154. return true;
  155. }
  156. }
  157. // Available data have been exhausted without a newline.
  158. if (this->First != 0) {
  159. // Move the partial line to the beginning of the buffer.
  160. this->erase(this->begin(), this->begin() + this->First);
  161. this->First = 0;
  162. this->Last = this->size();
  163. }
  164. return false;
  165. }
  166. bool cmProcess::Buffer::GetLast(std::string& line)
  167. {
  168. // Return the partial last line, if any.
  169. if (!this->empty()) {
  170. line.assign(this->data(), this->size());
  171. this->First = this->Last = 0;
  172. this->clear();
  173. return true;
  174. }
  175. return false;
  176. }
  177. void cmProcess::OnReadCB(uv_stream_t* stream, ssize_t nread,
  178. const uv_buf_t* buf)
  179. {
  180. auto self = static_cast<cmProcess*>(stream->data);
  181. self->OnRead(nread, buf);
  182. }
  183. void cmProcess::OnRead(ssize_t nread, const uv_buf_t* buf)
  184. {
  185. std::string line;
  186. if (nread > 0) {
  187. std::string strdata;
  188. this->Conv.DecodeText(buf->base, static_cast<size_t>(nread), strdata);
  189. cm::append(this->Output, strdata);
  190. while (this->Output.GetLine(line)) {
  191. this->Runner->CheckOutput(line);
  192. line.clear();
  193. }
  194. return;
  195. }
  196. if (nread == 0) {
  197. return;
  198. }
  199. // The process will provide no more data.
  200. if (nread != UV_EOF) {
  201. auto error = static_cast<int>(nread);
  202. cmCTestLog(this->Runner->GetCTest(), ERROR_MESSAGE,
  203. "Error reading stream: " << uv_strerror(error) << std::endl);
  204. }
  205. // Look for partial last lines.
  206. if (this->Output.GetLast(line)) {
  207. this->Runner->CheckOutput(line);
  208. }
  209. this->ReadHandleClosed = true;
  210. this->PipeReader.reset();
  211. if (this->ProcessHandleClosed) {
  212. uv_timer_stop(this->Timer);
  213. this->Runner->FinalizeTest();
  214. }
  215. }
  216. void cmProcess::OnAllocateCB(uv_handle_t* handle, size_t suggested_size,
  217. uv_buf_t* buf)
  218. {
  219. auto self = static_cast<cmProcess*>(handle->data);
  220. self->OnAllocate(suggested_size, buf);
  221. }
  222. void cmProcess::OnAllocate(size_t /*suggested_size*/, uv_buf_t* buf)
  223. {
  224. if (this->Buf.size() != CM_PROCESS_BUF_SIZE) {
  225. this->Buf.resize(CM_PROCESS_BUF_SIZE);
  226. }
  227. *buf =
  228. uv_buf_init(this->Buf.data(), static_cast<unsigned int>(this->Buf.size()));
  229. }
  230. void cmProcess::OnTimeoutCB(uv_timer_t* timer)
  231. {
  232. auto self = static_cast<cmProcess*>(timer->data);
  233. self->OnTimeout();
  234. }
  235. void cmProcess::OnTimeout()
  236. {
  237. this->ProcessState = cmProcess::State::Expired;
  238. bool const was_still_reading = !this->ReadHandleClosed;
  239. if (!this->ReadHandleClosed) {
  240. this->ReadHandleClosed = true;
  241. this->PipeReader.reset();
  242. }
  243. if (!this->ProcessHandleClosed) {
  244. // Kill the child and let our on-exit handler finish the test.
  245. cmsysProcess_KillPID(static_cast<unsigned long>(this->Process->pid));
  246. } else if (was_still_reading) {
  247. // Our on-exit handler already ran but did not finish the test
  248. // because we were still reading output. We've just dropped
  249. // our read handler, so we need to finish the test now.
  250. this->Runner->FinalizeTest();
  251. }
  252. }
  253. void cmProcess::OnExitCB(uv_process_t* process, int64_t exit_status,
  254. int term_signal)
  255. {
  256. auto self = static_cast<cmProcess*>(process->data);
  257. self->OnExit(exit_status, term_signal);
  258. }
  259. void cmProcess::OnExit(int64_t exit_status, int term_signal)
  260. {
  261. if (this->ProcessState != cmProcess::State::Expired) {
  262. if (
  263. #if defined(_WIN32)
  264. ((DWORD)exit_status & 0xF0000000) == 0xC0000000
  265. #else
  266. term_signal != 0
  267. #endif
  268. ) {
  269. this->ProcessState = cmProcess::State::Exception;
  270. } else {
  271. this->ProcessState = cmProcess::State::Exited;
  272. }
  273. }
  274. // Record exit information.
  275. this->ExitValue = exit_status;
  276. this->Signal = term_signal;
  277. this->TotalTime = std::chrono::steady_clock::now() - this->StartTime;
  278. // Because of a processor clock scew the runtime may become slightly
  279. // negative. If someone changed the system clock while the process was
  280. // running this may be even more. Make sure not to report a negative
  281. // duration here.
  282. if (this->TotalTime <= cmDuration::zero()) {
  283. this->TotalTime = cmDuration::zero();
  284. }
  285. this->ProcessHandleClosed = true;
  286. if (this->ReadHandleClosed) {
  287. uv_timer_stop(this->Timer);
  288. this->Runner->FinalizeTest();
  289. }
  290. }
  291. cmProcess::State cmProcess::GetProcessStatus()
  292. {
  293. return this->ProcessState;
  294. }
  295. void cmProcess::ChangeTimeout(cmDuration t)
  296. {
  297. this->Timeout = t;
  298. this->StartTimer();
  299. }
  300. void cmProcess::ResetStartTime()
  301. {
  302. this->StartTime = std::chrono::steady_clock::now();
  303. }
  304. cmProcess::Exception cmProcess::GetExitException()
  305. {
  306. auto exception = Exception::None;
  307. #if defined(_WIN32) && !defined(__CYGWIN__)
  308. auto exit_code = (DWORD)this->ExitValue;
  309. if ((exit_code & 0xF0000000) != 0xC0000000) {
  310. return exception;
  311. }
  312. if (exit_code) {
  313. switch (exit_code) {
  314. case STATUS_DATATYPE_MISALIGNMENT:
  315. case STATUS_ACCESS_VIOLATION:
  316. case STATUS_IN_PAGE_ERROR:
  317. case STATUS_INVALID_HANDLE:
  318. case STATUS_NONCONTINUABLE_EXCEPTION:
  319. case STATUS_INVALID_DISPOSITION:
  320. case STATUS_ARRAY_BOUNDS_EXCEEDED:
  321. case STATUS_STACK_OVERFLOW:
  322. exception = Exception::Fault;
  323. break;
  324. case STATUS_FLOAT_DENORMAL_OPERAND:
  325. case STATUS_FLOAT_DIVIDE_BY_ZERO:
  326. case STATUS_FLOAT_INEXACT_RESULT:
  327. case STATUS_FLOAT_INVALID_OPERATION:
  328. case STATUS_FLOAT_OVERFLOW:
  329. case STATUS_FLOAT_STACK_CHECK:
  330. case STATUS_FLOAT_UNDERFLOW:
  331. # ifdef STATUS_FLOAT_MULTIPLE_FAULTS
  332. case STATUS_FLOAT_MULTIPLE_FAULTS:
  333. # endif
  334. # ifdef STATUS_FLOAT_MULTIPLE_TRAPS
  335. case STATUS_FLOAT_MULTIPLE_TRAPS:
  336. # endif
  337. case STATUS_INTEGER_DIVIDE_BY_ZERO:
  338. case STATUS_INTEGER_OVERFLOW:
  339. exception = Exception::Numerical;
  340. break;
  341. case STATUS_CONTROL_C_EXIT:
  342. exception = Exception::Interrupt;
  343. break;
  344. case STATUS_ILLEGAL_INSTRUCTION:
  345. case STATUS_PRIVILEGED_INSTRUCTION:
  346. exception = Exception::Illegal;
  347. break;
  348. default:
  349. exception = Exception::Other;
  350. }
  351. }
  352. #else
  353. if (this->Signal) {
  354. switch (this->Signal) {
  355. case SIGSEGV:
  356. exception = Exception::Fault;
  357. break;
  358. case SIGFPE:
  359. exception = Exception::Numerical;
  360. break;
  361. case SIGINT:
  362. exception = Exception::Interrupt;
  363. break;
  364. case SIGILL:
  365. exception = Exception::Illegal;
  366. break;
  367. default:
  368. exception = Exception::Other;
  369. }
  370. }
  371. #endif
  372. return exception;
  373. }
  374. std::string cmProcess::GetExitExceptionString()
  375. {
  376. std::string exception_str;
  377. #if defined(_WIN32)
  378. switch (this->ExitValue) {
  379. case STATUS_CONTROL_C_EXIT:
  380. exception_str = "User interrupt";
  381. break;
  382. case STATUS_FLOAT_DENORMAL_OPERAND:
  383. exception_str = "Floating-point exception (denormal operand)";
  384. break;
  385. case STATUS_FLOAT_DIVIDE_BY_ZERO:
  386. exception_str = "Divide-by-zero";
  387. break;
  388. case STATUS_FLOAT_INEXACT_RESULT:
  389. exception_str = "Floating-point exception (inexact result)";
  390. break;
  391. case STATUS_FLOAT_INVALID_OPERATION:
  392. exception_str = "Invalid floating-point operation";
  393. break;
  394. case STATUS_FLOAT_OVERFLOW:
  395. exception_str = "Floating-point overflow";
  396. break;
  397. case STATUS_FLOAT_STACK_CHECK:
  398. exception_str = "Floating-point stack check failed";
  399. break;
  400. case STATUS_FLOAT_UNDERFLOW:
  401. exception_str = "Floating-point underflow";
  402. break;
  403. # ifdef STATUS_FLOAT_MULTIPLE_FAULTS
  404. case STATUS_FLOAT_MULTIPLE_FAULTS:
  405. exception_str = "Floating-point exception (multiple faults)";
  406. break;
  407. # endif
  408. # ifdef STATUS_FLOAT_MULTIPLE_TRAPS
  409. case STATUS_FLOAT_MULTIPLE_TRAPS:
  410. exception_str = "Floating-point exception (multiple traps)";
  411. break;
  412. # endif
  413. case STATUS_INTEGER_DIVIDE_BY_ZERO:
  414. exception_str = "Integer divide-by-zero";
  415. break;
  416. case STATUS_INTEGER_OVERFLOW:
  417. exception_str = "Integer overflow";
  418. break;
  419. case STATUS_DATATYPE_MISALIGNMENT:
  420. exception_str = "Datatype misalignment";
  421. break;
  422. case STATUS_ACCESS_VIOLATION:
  423. exception_str = "Access violation";
  424. break;
  425. case STATUS_IN_PAGE_ERROR:
  426. exception_str = "In-page error";
  427. break;
  428. case STATUS_INVALID_HANDLE:
  429. exception_str = "Invalid handle";
  430. break;
  431. case STATUS_NONCONTINUABLE_EXCEPTION:
  432. exception_str = "Noncontinuable exception";
  433. break;
  434. case STATUS_INVALID_DISPOSITION:
  435. exception_str = "Invalid disposition";
  436. break;
  437. case STATUS_ARRAY_BOUNDS_EXCEEDED:
  438. exception_str = "Array bounds exceeded";
  439. break;
  440. case STATUS_STACK_OVERFLOW:
  441. exception_str = "Stack overflow";
  442. break;
  443. case STATUS_ILLEGAL_INSTRUCTION:
  444. exception_str = "Illegal instruction";
  445. break;
  446. case STATUS_PRIVILEGED_INSTRUCTION:
  447. exception_str = "Privileged instruction";
  448. break;
  449. case STATUS_NO_MEMORY:
  450. default:
  451. char buf[1024];
  452. const char* fmt = "Exit code 0x%" KWIML_INT_PRIx64 "\n";
  453. _snprintf(buf, 1024, fmt, this->ExitValue);
  454. exception_str.assign(buf);
  455. }
  456. #else
  457. switch (this->Signal) {
  458. # ifdef SIGSEGV
  459. case SIGSEGV:
  460. exception_str = "Segmentation fault";
  461. break;
  462. # endif
  463. # ifdef SIGBUS
  464. # if !defined(SIGSEGV) || SIGBUS != SIGSEGV
  465. case SIGBUS:
  466. exception_str = "Bus error";
  467. break;
  468. # endif
  469. # endif
  470. # ifdef SIGFPE
  471. case SIGFPE:
  472. exception_str = "Floating-point exception";
  473. break;
  474. # endif
  475. # ifdef SIGILL
  476. case SIGILL:
  477. exception_str = "Illegal instruction";
  478. break;
  479. # endif
  480. # ifdef SIGINT
  481. case SIGINT:
  482. exception_str = "User interrupt";
  483. break;
  484. # endif
  485. # ifdef SIGABRT
  486. case SIGABRT:
  487. exception_str = "Child aborted";
  488. break;
  489. # endif
  490. # ifdef SIGKILL
  491. case SIGKILL:
  492. exception_str = "Child killed";
  493. break;
  494. # endif
  495. # ifdef SIGTERM
  496. case SIGTERM:
  497. exception_str = "Child terminated";
  498. break;
  499. # endif
  500. # ifdef SIGHUP
  501. case SIGHUP:
  502. exception_str = "SIGHUP";
  503. break;
  504. # endif
  505. # ifdef SIGQUIT
  506. case SIGQUIT:
  507. exception_str = "SIGQUIT";
  508. break;
  509. # endif
  510. # ifdef SIGTRAP
  511. case SIGTRAP:
  512. exception_str = "SIGTRAP";
  513. break;
  514. # endif
  515. # ifdef SIGIOT
  516. # if !defined(SIGABRT) || SIGIOT != SIGABRT
  517. case SIGIOT:
  518. exception_str = "SIGIOT";
  519. break;
  520. # endif
  521. # endif
  522. # ifdef SIGUSR1
  523. case SIGUSR1:
  524. exception_str = "SIGUSR1";
  525. break;
  526. # endif
  527. # ifdef SIGUSR2
  528. case SIGUSR2:
  529. exception_str = "SIGUSR2";
  530. break;
  531. # endif
  532. # ifdef SIGPIPE
  533. case SIGPIPE:
  534. exception_str = "SIGPIPE";
  535. break;
  536. # endif
  537. # ifdef SIGALRM
  538. case SIGALRM:
  539. exception_str = "SIGALRM";
  540. break;
  541. # endif
  542. # ifdef SIGSTKFLT
  543. case SIGSTKFLT:
  544. exception_str = "SIGSTKFLT";
  545. break;
  546. # endif
  547. # ifdef SIGCHLD
  548. case SIGCHLD:
  549. exception_str = "SIGCHLD";
  550. break;
  551. # elif defined(SIGCLD)
  552. case SIGCLD:
  553. exception_str = "SIGCLD";
  554. break;
  555. # endif
  556. # ifdef SIGCONT
  557. case SIGCONT:
  558. exception_str = "SIGCONT";
  559. break;
  560. # endif
  561. # ifdef SIGSTOP
  562. case SIGSTOP:
  563. exception_str = "SIGSTOP";
  564. break;
  565. # endif
  566. # ifdef SIGTSTP
  567. case SIGTSTP:
  568. exception_str = "SIGTSTP";
  569. break;
  570. # endif
  571. # ifdef SIGTTIN
  572. case SIGTTIN:
  573. exception_str = "SIGTTIN";
  574. break;
  575. # endif
  576. # ifdef SIGTTOU
  577. case SIGTTOU:
  578. exception_str = "SIGTTOU";
  579. break;
  580. # endif
  581. # ifdef SIGURG
  582. case SIGURG:
  583. exception_str = "SIGURG";
  584. break;
  585. # endif
  586. # ifdef SIGXCPU
  587. case SIGXCPU:
  588. exception_str = "SIGXCPU";
  589. break;
  590. # endif
  591. # ifdef SIGXFSZ
  592. case SIGXFSZ:
  593. exception_str = "SIGXFSZ";
  594. break;
  595. # endif
  596. # ifdef SIGVTALRM
  597. case SIGVTALRM:
  598. exception_str = "SIGVTALRM";
  599. break;
  600. # endif
  601. # ifdef SIGPROF
  602. case SIGPROF:
  603. exception_str = "SIGPROF";
  604. break;
  605. # endif
  606. # ifdef SIGWINCH
  607. case SIGWINCH:
  608. exception_str = "SIGWINCH";
  609. break;
  610. # endif
  611. # ifdef SIGPOLL
  612. case SIGPOLL:
  613. exception_str = "SIGPOLL";
  614. break;
  615. # endif
  616. # ifdef SIGIO
  617. # if !defined(SIGPOLL) || SIGIO != SIGPOLL
  618. case SIGIO:
  619. exception_str = "SIGIO";
  620. break;
  621. # endif
  622. # endif
  623. # ifdef SIGPWR
  624. case SIGPWR:
  625. exception_str = "SIGPWR";
  626. break;
  627. # endif
  628. # ifdef SIGSYS
  629. case SIGSYS:
  630. exception_str = "SIGSYS";
  631. break;
  632. # endif
  633. # ifdef SIGUNUSED
  634. # if !defined(SIGSYS) || SIGUNUSED != SIGSYS
  635. case SIGUNUSED:
  636. exception_str = "SIGUNUSED";
  637. break;
  638. # endif
  639. # endif
  640. default:
  641. exception_str = cmStrCat("Signal ", this->Signal);
  642. }
  643. #endif
  644. return exception_str;
  645. }