[Lldb-commits] [PATCH] D145450: [lldb] Respect empty arguments in target.run-args
Pavel Labath via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Mar 14 12:53:46 PDT 2023
labath added inline comments.
================
Comment at: lldb/source/Host/common/ProcessLaunchInfo.cpp:324-325
std::string safe_arg = Args::GetShellSafeArgument(m_shell, argv[i]);
+ if (safe_arg.empty())
+ safe_arg = "\"\"";
// Add a space to separate this arg from the previous one.
----------------
bulbazord wrote:
> labath wrote:
> > Shouldn't this belong inside `Args::GetShellSafeArgument`? I don't think there's any situation where the current behavior of the function would be correct (and this is the only caller of the function anyway...)
> As in, we should set safe_arg to `\"\"` when `argv[I]` is the empty string (e.g. safe_arg should never be empty)? If that's what you're suggesting, I think that would be a reasonable thing to do.
I think it is. What I'm saying is that `Args::GetShellSafeArgument(???, "")` should automatically return `"\"\"` instead of needing to fix this up afterwards...
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145450/new/
https://reviews.llvm.org/D145450
More information about the lldb-commits
mailing list