Skip to content

Commit 3a7a9c9

Browse files
[lldb][AIX] HostInfoAIX Support (llvm#117906)
This PR is in reference to porting LLDB on AIX. Link to discussions on llvm discourse and github: 1. https://discourse.llvm.org/t/port-lldb-to-ibm-aix/80640 2. llvm#101657 The complete changes for porting are present in this draft PR: llvm#102601 Added a HostInfoAIX file for the AIX platform. Most of the common functionalities are handled by the parent HostInfoPosix now, So we just have some basic functions implemented here.
1 parent a3fff3a commit 3a7a9c9

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//===-- HostInfoAIX.h -----------------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLDB_HOST_AIX_HOSTINFOAIX_H_
10+
#define LLDB_HOST_AIX_HOSTINFOAIX_H_
11+
12+
#include "lldb/Host/posix/HostInfoPosix.h"
13+
#include "lldb/Utility/FileSpec.h"
14+
15+
namespace lldb_private {
16+
17+
class HostInfoAIX : public HostInfoPosix {
18+
friend class HostInfoBase;
19+
20+
public:
21+
static void Initialize(SharedLibraryDirectoryHelper *helper = nullptr);
22+
static void Terminate();
23+
24+
static FileSpec GetProgramFileSpec();
25+
};
26+
} // namespace lldb_private
27+
28+
#endif // LLDB_HOST_AIX_HOSTINFOAIX_H_

lldb/source/Host/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ else()
133133
openbsd/Host.cpp
134134
openbsd/HostInfoOpenBSD.cpp
135135
)
136+
137+
elseif (CMAKE_SYSTEM_NAME MATCHES "AIX")
138+
add_host_subdirectory(aix
139+
aix/HostInfoAIX.cpp
140+
)
136141
endif()
137142
endif()
138143

lldb/source/Host/aix/HostInfoAIX.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//===-- HostInfoAIX.cpp -------------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include "lldb/Host/aix/HostInfoAIX.h"
10+
11+
using namespace lldb_private;
12+
13+
void HostInfoAIX::Initialize(SharedLibraryDirectoryHelper *helper) {
14+
HostInfoPosix::Initialize(helper);
15+
}
16+
17+
void HostInfoAIX::Terminate() { HostInfoBase::Terminate(); }
18+
19+
FileSpec HostInfoAIX::GetProgramFileSpec() {
20+
static FileSpec g_program_filespec;
21+
return g_program_filespec;
22+
}

0 commit comments

Comments
 (0)