blob: b667ec12513230aadda8c2603f5738f28f60f8ab [file] [log] [blame]
Christopher Ferris53a3c9b2017-05-10 18:34:15 -07001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _LIBUNWINDSTACK_TESTS_REGS_FAKE_H
18#define _LIBUNWINDSTACK_TESTS_REGS_FAKE_H
19
20#include <stdint.h>
21
Christopher Ferrisd226a512017-07-14 10:37:19 -070022#include <unwindstack/Memory.h>
23#include <unwindstack/Regs.h>
24
25namespace unwindstack {
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070026
27template <typename TypeParam>
Christopher Ferris7b8e4672017-06-01 17:55:25 -070028class RegsFake : public RegsImpl<TypeParam> {
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070029 public:
30 RegsFake(uint16_t total_regs, uint16_t sp_reg)
Christopher Ferris7b8e4672017-06-01 17:55:25 -070031 : RegsImpl<TypeParam>(total_regs, sp_reg, Regs::Location(Regs::LOCATION_UNKNOWN, 0)) {}
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070032 virtual ~RegsFake() = default;
33
Josh Gao0953ecd2017-08-25 13:55:06 -070034 uint32_t MachineType() override { return 0; }
35
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070036 uint64_t GetAdjustedPc(uint64_t, Elf*) override { return 0; }
Christopher Ferris2a25c4a2017-07-07 16:35:48 -070037 void SetFromRaw() override {}
Christopher Ferrisb9de87f2017-09-20 13:37:24 -070038 bool SetPcFromReturnAddress(Memory*) override { return false; }
Christopher Ferriseb4a6db2017-07-19 12:37:45 -070039 bool StepIfSignalHandler(uint64_t, Elf*, Memory*) override { return false; }
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070040 bool GetReturnAddressFromDefault(Memory*, uint64_t*) { return false; }
41};
42
Christopher Ferrisd226a512017-07-14 10:37:19 -070043} // namespace unwindstack
44
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070045#endif // _LIBUNWINDSTACK_TESTS_REGS_FAKE_H