[Lldb-commits] [lldb] [lldb][OpenBSD] Make use of Environment class (PR #122040)

Brad Smith via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 7 18:24:00 PST 2025


https://github.com/brad0 created https://github.com/llvm/llvm-project/pull/122040

None

>From 881a7767c1397951bf5275682a13037cd93dfcd5 Mon Sep 17 00:00:00 2001
From: Brad Smith <brad at comstyle.com>
Date: Tue, 7 Jan 2025 21:16:56 -0500
Subject: [PATCH] [lldb][OpenBSD] Make use of Environment class

---
 lldb/source/Host/openbsd/Host.cpp | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/lldb/source/Host/openbsd/Host.cpp b/lldb/source/Host/openbsd/Host.cpp
index a4dc3918acfd08..e7ad18e03e19b3 100644
--- a/lldb/source/Host/openbsd/Host.cpp
+++ b/lldb/source/Host/openbsd/Host.cpp
@@ -41,18 +41,7 @@ namespace lldb_private {
 class ProcessLaunchInfo;
 }
 
-Environment Host::GetEnvironment() {
-  Environment env;
-  char *v;
-  char **var = environ;
-  for (; var != NULL && *var != NULL; ++var) {
-    v = strchr(*var, (int)'-');
-    if (v == NULL)
-      continue;
-    env.insert(v);
-  }
-  return env;
-}
+Environment Host::GetEnvironment() { return Environment(environ); }
 
 static bool
 GetOpenBSDProcessArgs(const ProcessInstanceInfoMatch *match_info_ptr,



More information about the lldb-commits mailing list