• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 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 #pragma once
18 
19 #include <unwindstack/DwarfSection.h>
20 #include <unwindstack/Memory.h>
21 
22 namespace unwindstack {
23 
24 template <typename TypeParam>
25 class DwarfSectionImplFake : public DwarfSectionImpl<TypeParam> {
26  public:
DwarfSectionImplFake(Memory * memory)27   DwarfSectionImplFake(Memory* memory) : DwarfSectionImpl<TypeParam>(memory) {}
28   virtual ~DwarfSectionImplFake() = default;
29 
Init(uint64_t,uint64_t,int64_t)30   bool Init(uint64_t, uint64_t, int64_t) override { return false; }
31 
GetFdes(std::vector<const DwarfFde * > *)32   void GetFdes(std::vector<const DwarfFde*>*) override {}
33 
GetFdeFromPc(uint64_t)34   const DwarfFde* GetFdeFromPc(uint64_t) override { return nullptr; }
35 
GetCieOffsetFromFde32(uint32_t)36   uint64_t GetCieOffsetFromFde32(uint32_t) { return 0; }
37 
GetCieOffsetFromFde64(uint64_t)38   uint64_t GetCieOffsetFromFde64(uint64_t) { return 0; }
39 
AdjustPcFromFde(uint64_t)40   uint64_t AdjustPcFromFde(uint64_t) override { return 0; }
41 
FakeSetCachedCieLocRegs(uint64_t offset,const DwarfLocations & loc_regs)42   void FakeSetCachedCieLocRegs(uint64_t offset, const DwarfLocations& loc_regs) {
43     this->cie_loc_regs_[offset] = loc_regs;
44   }
FakeClearError()45   void FakeClearError() { this->last_error_.code = DWARF_ERROR_NONE; }
46 };
47 
48 }  // namespace unwindstack
49