77// ===----------------------------------------------------------------------===//
88
99#include " NativeProcessAIX.h"
10+ #include " Plugins/Process/POSIX/ProcessPOSIXLog.h"
1011#include " lldb/Host/Host.h"
1112#include " lldb/Host/HostProcess.h"
1213#include " lldb/Host/ProcessLaunchInfo.h"
14+ #include " lldb/Host/posix/ProcessLauncherPosixFork.h"
1315#include " lldb/Symbol/ObjectFile.h"
1416#include " lldb/Utility/Log.h"
1517#include " lldb/Utility/State.h"
2123#include < cstring>
2224#include < sstream>
2325#include < string>
26+ #include < sys/ptrace.h>
2427#include < unistd.h>
2528
2629using namespace lldb ;
@@ -34,17 +37,17 @@ static_assert(sizeof(long) >= k_ptrace_word_size,
3437
3538// Simple helper function to ensure flags are enabled on the given file
3639// descriptor.
37- static llvm::Error EnsureFDFlags (int fd, int flags) {
38- Error error;
40+ static Status EnsureFDFlags (int fd, int flags) {
41+ Status error;
3942
4043 int status = fcntl (fd, F_GETFL);
4144 if (status == -1 ) {
42- error = errorCodeToError ( errnoAsErrorCode () );
45+ error = Status::FromErrno ( );
4346 return error;
4447 }
4548
4649 if (fcntl (fd, F_SETFL, status | flags) == -1 ) {
47- error = errorCodeToError ( errnoAsErrorCode () );
50+ error = Status::FromErrno ( );
4851 return error;
4952 }
5053
@@ -123,6 +126,10 @@ NativeProcessAIX::Manager::Attach(
123126 pid, -1 , native_delegate, Info.GetArchitecture (), *this , *tids_or));
124127}
125128
129+ lldb::addr_t NativeProcessAIX::GetSharedLibraryInfoAddress () {
130+ return LLDB_INVALID_ADDRESS;
131+ }
132+
126133NativeProcessAIX::Extension
127134NativeProcessAIX::Manager::GetSupportedExtensions () const {
128135 NativeProcessAIX::Extension supported = {};
@@ -155,7 +162,8 @@ NativeProcessAIX::NativeProcessAIX(::pid_t pid, int terminal_fd,
155162
156163llvm::Expected<std::vector<::pid_t >> NativeProcessAIX::Attach (::pid_t pid) {
157164
158- Error status;
165+ Log *log = GetLog (POSIXLog::Process);
166+ Status status;
159167 if ((status = PtraceWrapper (PT_ATTACH, pid)).Fail ()) {
160168 return errorCodeToError (errnoAsErrorCode ());
161169 }
@@ -172,59 +180,76 @@ llvm::Expected<std::vector<::pid_t>> NativeProcessAIX::Attach(::pid_t pid) {
172180 return std::move (tids);
173181}
174182
175- void NativeProcessAIX::MonitorSIGTRAP (const WaitStatus status,
176- NativeThreadAIX &thread) {}
177-
178- void NativeProcessAIX::MonitorBreakpoint (NativeThreadAIX &thread) {}
179-
180183bool NativeProcessAIX::SupportHardwareSingleStepping () const { return false ; }
181184
182185Status NativeProcessAIX::Resume (const ResumeActionList &resume_actions) {
183186 return Status ();
184187}
185188
186- Error NativeProcessAIX::Halt () {
187- Error error;
189+ Status NativeProcessAIX::Halt () {
190+ Status error;
188191 return error;
189192}
190193
191- Error NativeProcessAIX::Detach () {
192- Error error;
194+ Status NativeProcessAIX::Detach () {
195+ Status error;
193196 return error;
194197}
195198
196- Error NativeProcessAIX::Signal (int signo) {
197- Error error;
199+ Status NativeProcessAIX::Signal (int signo) {
200+ Status error;
198201 return error;
199202}
200203
201- Error NativeProcessAIX::Interrupt () { return Status (); }
204+ Status NativeProcessAIX::Interrupt () { return Status (); }
202205
203- Error NativeProcessAIX::Kill () {
204- Error error;
206+ Status NativeProcessAIX::Kill () {
207+ Status error;
205208 return error;
206209}
207210
208- Error NativeProcessAIX::SetBreakpoint (lldb::addr_t addr, uint32_t size,
209- bool hardware) {
211+ Status NativeProcessAIX::ReadMemory (lldb::addr_t addr, void *buf, size_t size,
212+ size_t &bytes_read) {
213+ return Status ();
214+ }
215+
216+ Status NativeProcessAIX::WriteMemory (lldb::addr_t addr, const void *buf,
217+ size_t size, size_t &bytes_written) {
218+ return Status ();
219+ }
220+
221+ size_t NativeProcessAIX::UpdateThreads () {
222+ // The NativeProcessAIX monitoring threads are always up to date with
223+ // respect to thread state and they keep the thread list populated properly.
224+ // All this method needs to do is return the thread count.
225+ return m_threads.size ();
226+ }
227+
228+ Status NativeProcessAIX::GetLoadedModuleFileSpec (const char *module_path,
229+ FileSpec &file_spec) {
230+ return Status ();
231+ }
232+
233+ Status NativeProcessAIX::SetBreakpoint (lldb::addr_t addr, uint32_t size,
234+ bool hardware) {
210235 if (hardware)
211236 return SetHardwareBreakpoint (addr, size);
212237 else
213238 return SetSoftwareBreakpoint (addr, size);
214239}
215240
216- Error NativeProcessAIX::RemoveBreakpoint (lldb::addr_t addr, bool hardware) {
241+ Status NativeProcessAIX::RemoveBreakpoint (lldb::addr_t addr, bool hardware) {
217242 if (hardware)
218243 return RemoveHardwareBreakpoint (addr);
219244 else
220245 return NativeProcessProtocol::RemoveBreakpoint (addr);
221246}
222247
223- int8_t NativeProcessAIX::GetSignalInfo (WaitStatus wstatus ) const {
224- return wstatus. status ;
248+ Status NativeProcessAIX::GetSignalInfo (lldb:: tid_t tid, void *siginfo ) const {
249+ return Status () ;
225250}
226251
227- Error NativeProcessAIX::Detach (lldb::tid_t tid) {
252+ Status NativeProcessAIX::Detach (lldb::tid_t tid) {
228253 if (tid == LLDB_INVALID_THREAD_ID)
229254 return Status ();
230255
@@ -233,10 +258,10 @@ Error NativeProcessAIX::Detach(lldb::tid_t tid) {
233258
234259// Wrapper for ptrace to catch errors and log calls. Note that ptrace sets
235260// errno on error because -1 can be a valid result (i.e. for PTRACE_PEEK*)
236- Error NativeProcessAIX::PtraceWrapper (int req, lldb::pid_t pid, void *addr,
237- void *data, size_t data_size,
238- long *result) {
239- Error error;
261+ Status NativeProcessAIX::PtraceWrapper (int req, lldb::pid_t pid, void *addr,
262+ void *data, size_t data_size,
263+ long *result) {
264+ Status error;
240265 long int ret;
241266
242267 Log *log = GetLog (POSIXLog::Ptrace);
@@ -252,7 +277,7 @@ Error NativeProcessAIX::PtraceWrapper(int req, lldb::pid_t pid, void *addr,
252277 }
253278
254279 if (errno) {
255- error = errorCodeToError ( errnoAsErrorCode () );
280+ error = Status::FromErrno ( );
256281 ret = -1 ;
257282 }
258283
0 commit comments