[Lldb-commits] [PATCH] D145450: [lldb] Respect empty arguments in target.run-args

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 14 10:39:46 PDT 2023


bulbazord 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.
----------------
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.


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