================
@@ -146,6 +146,40 @@ lldb::ProcessSP PlatformWasm::Attach(ProcessAttachInfo
&attach_info,
return nullptr;
}
+Args PlatformWasm::MakeRuntimeCommand(llvm::StringRef runtime_path,
+ const Args &runtime_args,
+ llvm::StringRef port_arg, uint16_t port,
+ llvm::StringRef env_arg,
+ const Environment &env,
+ llvm::StringRef module_path,
+ const Args &inferior_args) {
+ Args args({runtime_path});
+ args.AppendArguments(runtime_args);
+ args.AppendArgument(llvm::formatv("{0}{1}", port_arg, port).str());
+
+ // Forward the inferior's environment into the WASI runtime. How arguments
are
+ // passed is configurable. When not configured, no environment is passed.
+ if (!env_arg.empty())
+ for (const auto &kv : env)
+ args.AppendArgument(
+ llvm::formatv("{0}{1}", env_arg, Environment::compose(kv)).str());
+
+ // The runtime is handed the module to run as a path on this host. A launch
+ // takes its executable from the name the module goes by on the platform,
+ // which for a module reported by a stub is a name of the stub's choosing
+ // rather than a path that resolves here, so run the file the target has.
----------------
bulbazord wrote:
This comment confuses me. It's quite abstract as somebody not working on wasm
support actively and the second sentence looks like a run-on. It feels like
you're saying "The runtime takes the path to the module on the host instead of
what the stub reports it as". Is that right?
https://github.com/llvm/llvm-project/pull/220700
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits