DebugServer2
Loading...
Searching...
No Matches
PTrace.h
1//
2// Copyright (c) 2014-present, Facebook, Inc.
3// All rights reserved.
4//
5// This source code is licensed under the University of Illinois/NCSA Open
6// Source License found in the LICENSE file in the root directory of this
7// source tree. An additional grant of patent rights can be found in the
8// PATENTS file in the same directory.
9//
10
11#pragma once
12
13#include "DebugServer2/Architecture/CPUState.h"
14#include "DebugServer2/Host/POSIX/PTrace.h"
15
16namespace ds2 {
17namespace Host {
18namespace Darwin {
19
20struct PTracePrivateData;
21
22class PTrace : public POSIX::PTrace {
23public:
24 ErrorCode traceThat(ProcessId pid) override;
25
26public:
27 ErrorCode kill(ProcessThreadId const &ptid, int signal) override;
28
29public:
30 ErrorCode readString(ProcessThreadId const &ptid, Address const &address,
31 std::string &str, size_t length,
32 size_t *nread = nullptr) override;
33 ErrorCode readMemory(ProcessThreadId const &ptid, Address const &address,
34 void *buffer, size_t length,
35 size_t *nread = nullptr) override;
36 ErrorCode writeMemory(ProcessThreadId const &ptid, Address const &address,
37 void const *buffer, size_t length,
38 size_t *nwritten = nullptr) override;
39
40public:
41 ErrorCode readCPUState(ProcessThreadId const &ptid, ProcessInfo const &info,
42 Architecture::CPUState &state) override;
43 ErrorCode writeCPUState(ProcessThreadId const &ptid, ProcessInfo const &info,
44 Architecture::CPUState const &state) override;
45
46public:
47 ErrorCode suspend(ProcessThreadId const &ptid) override;
48
49public:
50 ErrorCode getSigInfo(ProcessThreadId const &ptid, siginfo_t &si) override;
51};
52} // namespace Darwin
53} // namespace Host
54} // namespace ds2
Definition Types.h:95
Definition PTrace.h:22
Definition PTrace.h:28
Definition Types.h:263
Definition Types.h:57