[all-commits] [llvm/llvm-project] 1c228a: [lldb] Have Host::RunShellCommand ret stderr & std...

Jason Molenda via All-commits all-commits at lists.llvm.org
Tue Mar 10 13:49:17 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1c228a0533ae76bace6a3e3fe1c22fc2858dbf75
      https://github.com/llvm/llvm-project/commit/1c228a0533ae76bace6a3e3fe1c22fc2858dbf75
  Author: Jason Molenda <jmolenda at apple.com>
  Date:   2026-03-10 (Tue, 10 Mar 2026)

  Changed paths:
    M lldb/include/lldb/Host/Host.h
    M lldb/include/lldb/Target/Platform.h
    M lldb/include/lldb/Target/RemoteAwarePlatform.h
    M lldb/source/API/SBPlatform.cpp
    M lldb/source/Commands/CommandObjectPlatform.cpp
    M lldb/source/Host/common/Host.cpp
    M lldb/source/Host/macosx/objcxx/Host.mm
    M lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
    M lldb/source/Host/windows/Host.cpp
    M lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
    M lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
    M lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
    M lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
    M lldb/source/Plugins/SymbolLocator/DebugSymbols/SymbolLocatorDebugSymbols.cpp
    M lldb/source/Target/Platform.cpp
    M lldb/source/Target/RemoteAwarePlatform.cpp

  Log Message:
  -----------
  [lldb] Have Host::RunShellCommand ret stderr & stdout seperately (#184548)

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



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list