DebugServer2
Loading...
Searching...
No Matches
Process.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/Host/Darwin/PTrace.h"
14#include "DebugServer2/Target/Darwin/MachOProcess.h"
15
16namespace ds2 {
17namespace Target {
18namespace Darwin {
19
21protected:
23
24protected:
25 ErrorCode attach(int waitStatus) override;
26
27public:
28 ErrorCode terminate() override;
29
30public:
31 ErrorCode suspend() override;
32
33public:
34 ErrorCode getMemoryRegionInfo(Address const &address,
35 MemoryRegionInfo &info) override;
36
37public:
38 ErrorCode allocateMemory(size_t size, uint32_t protection,
39 uint64_t *address) override;
40 ErrorCode deallocateMemory(uint64_t address, size_t size) override;
41
42public:
43 ErrorCode readString(Address const &address, std::string &str, size_t length,
44 size_t *count = nullptr) override;
45 ErrorCode readMemory(Address const &address, void *data, size_t length,
46 size_t *count = nullptr) override;
47 ErrorCode writeMemory(Address const &address, void const *data, size_t length,
48 size_t *count = nullptr) override;
49
50public:
51 ErrorCode wait() override;
52
53public:
54 Host::POSIX::PTrace &ptrace() const override;
55
56protected:
57 ErrorCode updateInfo() override;
58 ErrorCode updateAuxiliaryVector() override;
59
60protected:
61 friend class Thread;
62 ErrorCode readCPUState(ThreadId tid, Architecture::CPUState &state,
63 uint32_t flags = 0);
64 ErrorCode writeCPUState(ThreadId tid, Architecture::CPUState const &state,
65 uint32_t flags = 0);
66
67public:
68 ErrorCode afterResume() override;
69
70protected:
71 friend class POSIX::Process;
72};
73} // namespace Darwin
74} // namespace Target
75} // namespace ds2
Definition Types.h:95
Definition PTrace.h:22
Definition PTrace.h:28
Definition MachOProcess.h:20
Definition Process.h:20
Definition Thread.h:26
Definition Process.h:23
Definition Types.h:361