This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Make SBTarget::LaunchSimple start form the target's LaunchInfo
ClosedPublic

Authored by JDevlieghere on Aug 4 2020, 11:53 AM.

Details

Summary

Currently SBTarget::LaunchSimple creates a new LaunchInfo which means it ignores any target properties that have been set. Instead, it should start from the target's LaunchInfo and populated the specified fields.

Diff Detail

Event Timeline

JDevlieghere requested review of this revision.Aug 4 2020, 11:53 AM
JDevlieghere updated this revision to Diff 282990.
JDevlieghere created this revision.

Add test

Test a few more cases

Address Jim's offline feedback about GetProcessLaunchInfo including the executable.

jingham accepted this revision.Aug 4 2020, 6:44 PM

LGTM

This revision is now accepted and ready to land.Aug 4 2020, 6:44 PM
JDevlieghere added inline comments.Aug 4 2020, 11:20 PM
lldb/source/Target/Target.cpp
3918 ↗(On Diff #283100)

Unfortunately doing this here doesn't work. Some of the code that's using GetProcessLaunchInfo() depends on the assumption that the m_arguments list in ProcessInfo does not contain argv[0], while other code, most notably the code to actually launch a binary, depends on it being the first argument. So whatever I do here, I break some code.

Back to previous revision.

@JDevlieghere This change is is failing LLDB Windows buildbot since build 18051. Can you please fix that?

@JDevlieghere This change is is failing LLDB Windows buildbot since build 18051. Can you please fix that?

Thanks for the heads up. I had just pushed a fix:

commit 927afdffbb1deebd83b86d024b67687d758521d0 
Author: Jonas Devlieghere <jonas@devlieghere.com>
Date:   Wed Aug 5 15:37:50 2020 -0700

    [lldb] Skip test_launch_simple on Windows

    Because stdio manipulation unsupported on Windows.
max-kudr removed a subscriber: max-kudr.Aug 5 2020, 3:58 PM

@JDevlieghere This change is is failing LLDB Windows buildbot since build 18051. Can you please fix that?

Thanks for the heads up. I had just pushed a fix:

commit 927afdffbb1deebd83b86d024b67687d758521d0 
Author: Jonas Devlieghere <jonas@devlieghere.com>
Date:   Wed Aug 5 15:37:50 2020 -0700

    [lldb] Skip test_launch_simple on Windows

    Because stdio manipulation unsupported on Windows.

This still fails on http://lab.llvm.org:8011/builders/lldb-aarch64-ubuntu and http://lab.llvm.org:8011/builders/lldb-arm-ubuntu