Skip to content

Commit

Permalink
[lldb][AIX] HostInfoAIX Support (#117906)
Browse files Browse the repository at this point in the history
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. #101657
The complete changes for porting are present in this draft PR:
#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.
  • Loading branch information
DhruvSrivastavaX authored Jan 6, 2025
1 parent a3fff3a commit 3a7a9c9
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
28 changes: 28 additions & 0 deletions lldb/include/lldb/Host/aix/HostInfoAIX.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//===-- HostInfoAIX.h -----------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLDB_HOST_AIX_HOSTINFOAIX_H_
#define LLDB_HOST_AIX_HOSTINFOAIX_H_

#include "lldb/Host/posix/HostInfoPosix.h"
#include "lldb/Utility/FileSpec.h"

namespace lldb_private {

class HostInfoAIX : public HostInfoPosix {
friend class HostInfoBase;

public:
static void Initialize(SharedLibraryDirectoryHelper *helper = nullptr);
static void Terminate();

static FileSpec GetProgramFileSpec();
};
} // namespace lldb_private

#endif // LLDB_HOST_AIX_HOSTINFOAIX_H_
5 changes: 5 additions & 0 deletions lldb/source/Host/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ else()
openbsd/Host.cpp
openbsd/HostInfoOpenBSD.cpp
)

elseif (CMAKE_SYSTEM_NAME MATCHES "AIX")
add_host_subdirectory(aix
aix/HostInfoAIX.cpp
)
endif()
endif()

Expand Down
22 changes: 22 additions & 0 deletions lldb/source/Host/aix/HostInfoAIX.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//===-- HostInfoAIX.cpp -------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "lldb/Host/aix/HostInfoAIX.h"

using namespace lldb_private;

void HostInfoAIX::Initialize(SharedLibraryDirectoryHelper *helper) {
HostInfoPosix::Initialize(helper);
}

void HostInfoAIX::Terminate() { HostInfoBase::Terminate(); }

FileSpec HostInfoAIX::GetProgramFileSpec() {
static FileSpec g_program_filespec;
return g_program_filespec;
}

0 comments on commit 3a7a9c9

Please sign in to comment.