Skip to content

[lldb][AIX] Adding NativeThreadAIX #139537

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 4 commits into from
May 16, 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
1 change: 1 addition & 0 deletions lldb/source/Plugins/Process/AIX/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
add_lldb_library(lldbPluginProcessAIX
NativeProcessAIX.cpp
NativeThreadAIX.cpp

LINK_LIBS
lldbCore
Expand Down
58 changes: 58 additions & 0 deletions lldb/source/Plugins/Process/AIX/NativeThreadAIX.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//===-- NativeThreadAIX.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 "NativeThreadAIX.h"
#include "NativeProcessAIX.h"
#include "lldb/Utility/State.h"

using namespace lldb;
using namespace lldb_private;
using namespace lldb_private::process_aix;

NativeThreadAIX::NativeThreadAIX(NativeProcessAIX &process, lldb::tid_t tid)
: NativeThreadProtocol(process, tid), m_state(StateType::eStateInvalid) {}

std::string NativeThreadAIX::GetName() { return ""; }

lldb::StateType NativeThreadAIX::GetState() { return m_state; }

bool NativeThreadAIX::GetStopReason(ThreadStopInfo &stop_info,
std::string &description) {
return false;
}

Status NativeThreadAIX::SetWatchpoint(lldb::addr_t addr, size_t size,
uint32_t watch_flags, bool hardware) {
return Status("Unable to Set hardware watchpoint.");
}

Status NativeThreadAIX::RemoveWatchpoint(lldb::addr_t addr) {
return Status("Clearing hardware watchpoint failed.");
}

Status NativeThreadAIX::SetHardwareBreakpoint(lldb::addr_t addr, size_t size) {
return Status("Unable to set hardware breakpoint.");
}

Status NativeThreadAIX::RemoveHardwareBreakpoint(lldb::addr_t addr) {
return Status("Clearing hardware breakpoint failed.");
}

NativeProcessAIX &NativeThreadAIX::GetProcess() {
return static_cast<NativeProcessAIX &>(m_process);
}

const NativeProcessAIX &NativeThreadAIX::GetProcess() const {
return static_cast<const NativeProcessAIX &>(m_process);
}

llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>>
NativeThreadAIX::GetSiginfo() const {
return llvm::createStringError(llvm::inconvertibleErrorCode(),
"Not implemented");
}
53 changes: 53 additions & 0 deletions lldb/source/Plugins/Process/AIX/NativeThreadAIX.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//===-- NativeThreadAIX.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_SOURCE_PLUGINS_PROCESS_AIX_NATIVETHREADAIX_H_
#define LLDB_SOURCE_PLUGINS_PROCESS_AIX_NATIVETHREADAIX_H_

#include "lldb/Host/common/NativeThreadProtocol.h"

namespace lldb_private::process_aix {

class NativeProcessAIX;

class NativeThreadAIX : public NativeThreadProtocol {
friend class NativeProcessAIX;

public:
NativeThreadAIX(NativeProcessAIX &process, lldb::tid_t tid);

// NativeThreadProtocol Interface
std::string GetName() override;

lldb::StateType GetState() override;

bool GetStopReason(ThreadStopInfo &stop_info,
std::string &description) override;

Status SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags,
bool hardware) override;

Status RemoveWatchpoint(lldb::addr_t addr) override;

Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override;

Status RemoveHardwareBreakpoint(lldb::addr_t addr) override;

NativeProcessAIX &GetProcess();

const NativeProcessAIX &GetProcess() const;

llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>>
GetSiginfo() const override;

private:
lldb::StateType m_state;
};
} // namespace lldb_private::process_aix

#endif // #ifndef LLDB_SOURCE_PLUGINS_PROCESS_AIX_NATIVETHREADAIX_H_
Loading