-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[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
DhruvSrivastavaX
merged 4 commits into
llvm:main
from
DhruvSrivastavaX:aix-native-threads
May 16, 2025
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| //===-- 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" | ||
| #include <procinfo.h> | ||
| #include <sys/procfs.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() { | ||
| NativeProcessAIX &process = GetProcess(); | ||
| auto BufferOrError = getProcFile(process.GetID(), "psinfo"); | ||
| if (!BufferOrError) | ||
| return ""; | ||
| auto &Buffer = *BufferOrError; | ||
| if (Buffer->getBufferSize() < sizeof(psinfo_t)) | ||
| return ""; | ||
| const psinfo_t *psinfo = | ||
| reinterpret_cast<const psinfo_t *>(Buffer->getBufferStart()); | ||
| return std::string(psinfo->pr_fname); | ||
| } | ||
|
|
||
| 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(); | ||
labath marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| 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(); | ||
| } | ||
|
|
||
| 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"); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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_ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.