[Lldb-commits] [PATCH] D155117: Platform qemu-user: Build path to qemu automatically if not specified

Ted Woodward via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 22 12:20:38 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGbe88462cd6aa: Platform qemu-user: Build path to qemu automatically if not specified (authored by ted).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155117/new/

https://reviews.llvm.org/D155117

Files:
  lldb/source/Plugins/Platform/QemuUser/PlatformQemuUser.cpp


Index: lldb/source/Plugins/Platform/QemuUser/PlatformQemuUser.cpp
===================================================================
--- lldb/source/Plugins/Platform/QemuUser/PlatformQemuUser.cpp
+++ lldb/source/Plugins/Platform/QemuUser/PlatformQemuUser.cpp
@@ -162,9 +162,18 @@
                                                Target &target, Status &error) {
   Log *log = GetLog(LLDBLog::Platform);
 
+  // If platform.plugin.qemu-user.emulator-path is set, use it.
   FileSpec qemu = GetGlobalProperties().GetEmulatorPath();
-  if (!qemu)
-    qemu.SetPath(("qemu-" + GetGlobalProperties().GetArchitecture()).str());
+  // If platform.plugin.qemu-user.emulator-path is not set, build the
+  // executable name from platform.plugin.qemu-user.architecture.
+  if (!qemu) {
+    llvm::StringRef arch = GetGlobalProperties().GetArchitecture();
+    // If platform.plugin.qemu-user.architecture is not set, build the
+    // executable name from the target Triple's ArchName
+    if (arch.empty())
+      arch = target.GetArchitecture().GetTriple().getArchName();
+    qemu.SetPath(("qemu-" + arch).str());
+  }
   FileSystem::Instance().ResolveExecutableLocation(qemu);
 
   llvm::SmallString<0> socket_model, socket_path;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155117.552468.patch
Type: text/x-patch
Size: 1224 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230822/5940877a/attachment-0001.bin>


More information about the lldb-commits mailing list