DebugServer2
Loading...
Searching...
No Matches
SoftwareBreakpointManager.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/Core/BreakpointManager.h"
14
15namespace ds2 {
17private:
18 std::map<uint64_t, ByteVector> _insns;
19 bool _enabled;
20
21public:
24
25public:
26 virtual void clear() override;
27
28public:
29 virtual int hit(Target::Thread *thread, Site &site) override;
30
31protected:
32 virtual void getOpcode(size_t size, ByteVector &opcode) const;
33
34protected:
35 virtual ErrorCode enableLocation(Site const &site,
36 Target::Thread *thread = nullptr) override;
37 virtual ErrorCode disableLocation(Site const &site,
38 Target::Thread *thread = nullptr) override;
39
40public:
41 void enable(Target::Thread *thread = nullptr) override;
42 void disable(Target::Thread *thread = nullptr) override;
43
44protected:
45 ErrorCode isValid(Address const &address, size_t size,
46 Mode mode) const override;
47 size_t chooseBreakpointSize(Address const &address) const override;
48
49#if defined(ARCH_ARM) || defined(ARCH_ARM64)
50public:
51 virtual void
52 enumerate(std::function<void(Site const &)> const &cb) const override;
53
54public:
55 virtual ErrorCode add(Address const &address, Lifetime lifetime, size_t size,
56 Mode mode) override;
57 virtual ErrorCode remove(Address const &address) override;
58
59public:
60 virtual bool has(Address const &address) const override;
61#endif
62
63 virtual bool enabled(Target::Thread *thread = nullptr) const override;
64
65public:
66 virtual bool fillStopInfo(Target::Thread *thread,
67 StopInfo &stopInfo) override;
68};
69} // namespace ds2
Definition Types.h:95
Definition BreakpointManager.h:20
Definition SoftwareBreakpointManager.h:16
Definition ProcessBase.h:25
Definition BreakpointManager.h:36
Definition Types.h:131