================ @@ -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); +} ---------------- DhruvSrivastavaX wrote:
Yes true, I agree with that. Okay, in that case I can drop this change out for now and we can decide on whether to add it or not later. https://github.com/llvm/llvm-project/pull/139537 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits