Host::RunShellCommand takes a std::string *command_output argument and a bool hide_stderr=false defaulted argument. If the shell command returns stderr and stdout text, it is intermixed in the same command_output, unless hide_stderr=true. In SymbolLocatorDebugSymbols::DownloadObjectAndSymbolFile we call an external program to find a binary and dSYM by uuid, and the external program returns a plist (xml) output. In some cases, it printed a (harmless) warning message to stderr, and then a complete plist output to stdout. We attempt to parse the combination of these two streams, and the parse fails - we don't get the output. This patch removes hide_stderr and instead adds a `std::string *separated_error_output` argument. If `separated_error_output` is nullptr, output and error texts are returned combined in the `command_output` argument. If a std::string object address is provided for `separated_error_output`, then standard error output is separated into this string. A caller which wants the old `hide_stderr=true` behavior should pass a throwaway std::string object to `RunShellCommand` and ignore it. rdar://168621579
11 KiB
11 KiB