Skip to content

[lldb] Move GetEnvironment function into common code #122173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lldb/source/Host/common/Host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 0 additions & 6 deletions lldb/source/Host/freebsd/Host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@

#include "llvm/TargetParser/Host.h"

extern "C" {
extern char **environ;
}

namespace lldb_private {
class ProcessLaunchInfo;
}
Expand Down Expand Up @@ -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");
}
2 changes: 0 additions & 2 deletions lldb/source/Host/linux/Host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
6 changes: 0 additions & 6 deletions lldb/source/Host/netbsd/HostNetBSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,13 @@
#include "llvm/Object/ELF.h"
#include "llvm/TargetParser/Host.h"

extern "C" {
extern char **environ;
}

using namespace lldb;
using namespace lldb_private;

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())
Expand Down
6 changes: 0 additions & 6 deletions lldb/source/Host/openbsd/Host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,13 @@

#include "llvm/TargetParser/Host.h"

extern "C" {
extern char **environ;
}

using namespace lldb;
using namespace lldb_private;

namespace lldb_private {
class ProcessLaunchInfo;
}

Environment Host::GetEnvironment() { return Environment(environ); }

static bool
GetOpenBSDProcessArgs(const ProcessInstanceInfoMatch *match_info_ptr,
ProcessInstanceInfo &process_info) {
Expand Down
Loading