| Christopher Ferris | 53a3c9b | 2017-05-10 18:34:15 -0700 | [diff] [blame] | 1 | /* | 
 | 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 Ferris | d226a51 | 2017-07-14 10:37:19 -0700 | [diff] [blame] | 22 | #include <unwindstack/Memory.h> | 
 | 23 | #include <unwindstack/Regs.h> | 
 | 24 |  | 
 | 25 | namespace unwindstack { | 
| Christopher Ferris | 53a3c9b | 2017-05-10 18:34:15 -0700 | [diff] [blame] | 26 |  | 
 | 27 | template <typename TypeParam> | 
| Christopher Ferris | 7b8e467 | 2017-06-01 17:55:25 -0700 | [diff] [blame] | 28 | class RegsFake : public RegsImpl<TypeParam> { | 
| Christopher Ferris | 53a3c9b | 2017-05-10 18:34:15 -0700 | [diff] [blame] | 29 |  public: | 
 | 30 |   RegsFake(uint16_t total_regs, uint16_t sp_reg) | 
| Christopher Ferris | 7b8e467 | 2017-06-01 17:55:25 -0700 | [diff] [blame] | 31 |       : RegsImpl<TypeParam>(total_regs, sp_reg, Regs::Location(Regs::LOCATION_UNKNOWN, 0)) {} | 
| Christopher Ferris | 53a3c9b | 2017-05-10 18:34:15 -0700 | [diff] [blame] | 32 |   virtual ~RegsFake() = default; | 
 | 33 |  | 
| Christopher Ferris | 53a3c9b | 2017-05-10 18:34:15 -0700 | [diff] [blame] | 34 |   uint64_t GetAdjustedPc(uint64_t, Elf*) override { return 0; } | 
| Christopher Ferris | 2a25c4a | 2017-07-07 16:35:48 -0700 | [diff] [blame] | 35 |   void SetFromRaw() override {} | 
| Christopher Ferris | eb4a6db | 2017-07-19 12:37:45 -0700 | [diff] [blame] | 36 |   bool StepIfSignalHandler(uint64_t, Elf*, Memory*) override { return false; } | 
| Christopher Ferris | 53a3c9b | 2017-05-10 18:34:15 -0700 | [diff] [blame] | 37 |   bool GetReturnAddressFromDefault(Memory*, uint64_t*) { return false; } | 
 | 38 | }; | 
 | 39 |  | 
| Christopher Ferris | d226a51 | 2017-07-14 10:37:19 -0700 | [diff] [blame] | 40 | }  // namespace unwindstack | 
 | 41 |  | 
| Christopher Ferris | 53a3c9b | 2017-05-10 18:34:15 -0700 | [diff] [blame] | 42 | #endif  // _LIBUNWINDSTACK_TESTS_REGS_FAKE_H |