| 94 | } |
| 95 | |
| 96 | Status PstackWatcher::HasProgram(const char* progname) { |
| 97 | Subprocess proc({ "which", progname } ); |
| 98 | proc.DisableStderr(); |
| 99 | proc.DisableStdout(); |
| 100 | RETURN_NOT_OK_PREPEND(proc.Start(), |
| 101 | Substitute("HasProgram($0): error running 'which'", progname)); |
| 102 | RETURN_NOT_OK(proc.Wait()); |
| 103 | int exit_status; |
| 104 | string exit_info; |
| 105 | RETURN_NOT_OK(proc.GetExitStatus(&exit_status, &exit_info)); |
| 106 | if (exit_status == 0) { |
| 107 | return Status::OK(); |
| 108 | } |
| 109 | return Status::NotFound(Substitute("can't find $0: $1", progname, exit_info)); |
| 110 | } |
| 111 | |
| 112 | Status PstackWatcher::HasGoodGdb() { |
| 113 | // Check for the existence of gdb. |
nothing calls this directly
no test coverage detected