[lldb] Move GetEnvironment function into common code (#122173)

This commit is contained in:
Brad Smith
2025-01-09 09:41:32 -05:00
committed by GitHub
parent c57810a00a
commit cb04bc05eb
5 changed files with 4 additions and 20 deletions

View File

@@ -114,6 +114,10 @@ void LogChannelSystem::Initialize() {
void LogChannelSystem::Terminate() { g_system_log.Disable(); }
#if !defined(__APPLE__) && !defined(_WIN32)
extern "C" char **environ;
Environment Host::GetEnvironment() { return Environment(environ); }
static thread_result_t
MonitorChildProcessThreadFunction(::pid_t pid,
Host::MonitorChildProcessCallback callback);

View File

@@ -33,10 +33,6 @@
#include "llvm/TargetParser/Host.h"
extern "C" {
extern char **environ;
}
namespace lldb_private {
class ProcessLaunchInfo;
}
@@ -241,8 +237,6 @@ bool Host::GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &process_info) {
return false;
}
Environment Host::GetEnvironment() { return Environment(environ); }
Status Host::ShellExpandArguments(ProcessLaunchInfo &launch_info) {
return Status::FromErrorString("unimplemented");
}

View File

@@ -411,8 +411,6 @@ bool Host::GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &process_info) {
return GetProcessAndStatInfo(pid, process_info, State, tracerpid);
}
Environment Host::GetEnvironment() { return Environment(environ); }
Status Host::ShellExpandArguments(ProcessLaunchInfo &launch_info) {
return Status::FromErrorString("unimplemented");
}

View File

@@ -35,10 +35,6 @@
#include "llvm/Object/ELF.h"
#include "llvm/TargetParser/Host.h"
extern "C" {
extern char **environ;
}
using namespace lldb;
using namespace lldb_private;
@@ -46,8 +42,6 @@ namespace lldb_private {
class ProcessLaunchInfo;
}
Environment Host::GetEnvironment() { return Environment(environ); }
static bool GetNetBSDProcessArgs(const ProcessInstanceInfoMatch *match_info_ptr,
ProcessInstanceInfo &process_info) {
if (!process_info.ProcessIDIsValid())

View File

@@ -30,10 +30,6 @@
#include "llvm/TargetParser/Host.h"
extern "C" {
extern char **environ;
}
using namespace lldb;
using namespace lldb_private;
@@ -41,8 +37,6 @@ namespace lldb_private {
class ProcessLaunchInfo;
}
Environment Host::GetEnvironment() { return Environment(environ); }
static bool
GetOpenBSDProcessArgs(const ProcessInstanceInfoMatch *match_info_ptr,
ProcessInstanceInfo &process_info) {