blob: c57954c3d1131103714b4959ad71526a54ff4621 [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
22#include "Regs.h"
23
24template <typename TypeParam>
Christopher Ferris7b8e4672017-06-01 17:55:25 -070025class RegsFake : public RegsImpl<TypeParam> {
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070026 public:
27 RegsFake(uint16_t total_regs, uint16_t sp_reg)
Christopher Ferris7b8e4672017-06-01 17:55:25 -070028 : RegsImpl<TypeParam>(total_regs, sp_reg, Regs::Location(Regs::LOCATION_UNKNOWN, 0)) {}
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070029 virtual ~RegsFake() = default;
30
31 uint64_t GetRelPc(Elf*, const MapInfo*) override { return 0; }
32 uint64_t GetAdjustedPc(uint64_t, Elf*) override { return 0; }
Christopher Ferris2a25c4a2017-07-07 16:35:48 -070033 void SetFromRaw() override {}
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070034 bool GetReturnAddressFromDefault(Memory*, uint64_t*) { return false; }
35};
36
37#endif // _LIBUNWINDSTACK_TESTS_REGS_FAKE_H