[all-commits] [llvm/llvm-project] cc0fc3: [LLDB] Fix the use of "platform process launch" wi...

David Spickett via All-commits all-commits at lists.llvm.org
Tue Jun 27 00:41:33 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cc0fc358540517a3d205243c27bd543afeae2b02
      https://github.com/llvm/llvm-project/commit/cc0fc358540517a3d205243c27bd543afeae2b02
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2023-06-27 (Tue, 27 Jun 2023)

  Changed paths:
    M lldb/source/Commands/CommandObjectPlatform.cpp
    A lldb/test/API/commands/platform/process/launch/Makefile
    A lldb/test/API/commands/platform/process/launch/TestPlatformProcessLaunch.py
    A lldb/test/API/commands/platform/process/launch/main.c

  Log Message:
  -----------
  [LLDB] Fix the use of "platform process launch" with no extra arguments

This fixes #62068.

After 8d1de7b34af46a089eb5433c700419ad9b2923ee the following issue appeared:
```
$ ./bin/lldb /tmp/test.o
(lldb) target create "/tmp/test.o"
Current executable set to '/tmp/test.o' (aarch64).
(lldb) platform process launch -s
error: Cannot launch '': Nothing to launch
```

Previously would call target->GetRunArguments when there were no extra
arguments, so we could find out what target.run-args might be.

Once that change started relying on the first arg being the exe,
the fact that that call clears the existing argument list caused the bug.

Instead, have it set a local arg list and append that to the existing
one. Which in this case will just contain the exe name.

Since there's no existing tests for this command I've added a new file
that covers enough to check this issue.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D153636




More information about the All-commits mailing list