aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectProcess.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2021-11-16 16:44:45 -0800
committerJim Ingham <jingham@apple.com>2021-11-16 16:46:21 -0800
commitdd5505a8f2c75a903ec944b6e46aed2042610673 (patch)
tree023db2be67bf712594808d3c86f28e584188ee58 /lldb/source/Commands/CommandObjectProcess.cpp
parent47f76bb0f478f8c5c1c0d8e8ba374b995b1dccde (diff)
downloadllvm-dd5505a8f2c75a903ec944b6e46aed2042610673.zip
llvm-dd5505a8f2c75a903ec944b6e46aed2042610673.tar.gz
llvm-dd5505a8f2c75a903ec944b6e46aed2042610673.tar.bz2
Revert "Make it possible for lldb to launch a remote binary with no local file."
The reworking of the gdb client tests into the PlatformClientTestBase broke the test for this. I did the mutatis mutandis for the move, but the test still fails. Reverting till I have time to figure out why. This reverts commit b715b79d54d5ca2d4e8c91089b8f6a9389d9dc48.
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectProcess.cpp40
1 files changed, 10 insertions, 30 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp
index 5fd1718..8ce14f2 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -159,12 +159,7 @@ protected:
// If our listener is nullptr, users aren't allows to launch
ModuleSP exe_module_sp = target->GetExecutableModule();
- // If the target already has an executable module, then use that. If it
- // doesn't then someone must be trying to launch using a path that will
- // make sense to the remote stub, but doesn't exist on the local host.
- // In that case use the ExecutableFile that was set in the target's
- // ProcessLaunchInfo.
- if (exe_module_sp == nullptr && !target->GetProcessLaunchInfo().GetExecutableFile()) {
+ if (exe_module_sp == nullptr) {
result.AppendError("no file in target, create a debug target using the "
"'target create' command");
return false;
@@ -224,17 +219,11 @@ protected:
if (!target_settings_argv0.empty()) {
m_options.launch_info.GetArguments().AppendArgument(
target_settings_argv0);
- if (exe_module_sp)
- m_options.launch_info.SetExecutableFile(
- exe_module_sp->GetPlatformFileSpec(), false);
- else
- m_options.launch_info.SetExecutableFile(target->GetProcessLaunchInfo().GetExecutableFile(), false);
+ m_options.launch_info.SetExecutableFile(
+ exe_module_sp->GetPlatformFileSpec(), false);
} else {
- if (exe_module_sp)
- m_options.launch_info.SetExecutableFile(
- exe_module_sp->GetPlatformFileSpec(), true);
- else
- m_options.launch_info.SetExecutableFile(target->GetProcessLaunchInfo().GetExecutableFile(), true);
+ m_options.launch_info.SetExecutableFile(
+ exe_module_sp->GetPlatformFileSpec(), true);
}
if (launch_args.GetArgumentCount() == 0) {
@@ -261,20 +250,11 @@ protected:
llvm::StringRef data = stream.GetString();
if (!data.empty())
result.AppendMessage(data);
- // If we didn't have a local executable, then we wouldn't have had an
- // executable module before launch.
- if (!exe_module_sp)
- exe_module_sp = target->GetExecutableModule();
- if (!exe_module_sp) {
- result.AppendWarning("Could not get executable module after launch.");
- } else {
-
- const char *archname =
- exe_module_sp->GetArchitecture().GetArchitectureName();
- result.AppendMessageWithFormat(
- "Process %" PRIu64 " launched: '%s' (%s)\n", process_sp->GetID(),
- exe_module_sp->GetFileSpec().GetPath().c_str(), archname);
- }
+ const char *archname =
+ exe_module_sp->GetArchitecture().GetArchitectureName();
+ result.AppendMessageWithFormat(
+ "Process %" PRIu64 " launched: '%s' (%s)\n", process_sp->GetID(),
+ exe_module_sp->GetFileSpec().GetPath().c_str(), archname);
result.SetStatus(eReturnStatusSuccessFinishResult);
result.SetDidChangeProcessState(true);
} else {