blob: 2b5a8dc834b42b1b9c9cf668773f902278f89fe5 [file] [log] [blame]
Christopher Ferris8642fcb2017-04-24 11:14:39 -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#include <stdint.h>
18
19#include <memory>
20#include <type_traits>
21#include <unordered_map>
22
23#include <android-base/stringprintf.h>
24#include <gtest/gtest.h>
25
Christopher Ferrisd226a512017-07-14 10:37:19 -070026#include <unwindstack/DwarfLocation.h>
27#include <unwindstack/DwarfMemory.h>
28#include <unwindstack/DwarfStructs.h>
Tamas Petz6835d012020-01-22 14:22:41 +010029#include <unwindstack/Elf.h>
Christopher Ferrisd226a512017-07-14 10:37:19 -070030#include <unwindstack/Log.h>
31
Christopher Ferris8642fcb2017-04-24 11:14:39 -070032#include "DwarfCfa.h"
Christopher Ferris8642fcb2017-04-24 11:14:39 -070033
34#include "LogFake.h"
35#include "MemoryFake.h"
36
Christopher Ferrisd226a512017-07-14 10:37:19 -070037namespace unwindstack {
38
Christopher Ferris8642fcb2017-04-24 11:14:39 -070039template <typename TypeParam>
40class DwarfCfaLogTest : public ::testing::Test {
41 protected:
42 void SetUp() override {
43 ResetLogs();
44 memory_.Clear();
45
46 dmem_.reset(new DwarfMemory(&memory_));
47
48 cie_.cfa_instructions_offset = 0x1000;
49 cie_.cfa_instructions_end = 0x1030;
50 // These two values should be different to distinguish between
51 // operations that deal with code versus data.
52 cie_.code_alignment_factor = 4;
53 cie_.data_alignment_factor = 8;
54
55 fde_.cfa_instructions_offset = 0x2000;
56 fde_.cfa_instructions_end = 0x2030;
57 fde_.pc_start = 0x2000;
58 fde_.pc_end = 0x2000;
59 fde_.pc_end = 0x10000;
60 fde_.cie = &cie_;
Tamas Petz6835d012020-01-22 14:22:41 +010061 cfa_.reset(new DwarfCfa<TypeParam>(dmem_.get(), &fde_, ARCH_UNKNOWN));
Christopher Ferris8642fcb2017-04-24 11:14:39 -070062 }
63
64 MemoryFake memory_;
65 std::unique_ptr<DwarfMemory> dmem_;
66 std::unique_ptr<DwarfCfa<TypeParam>> cfa_;
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070067 DwarfCie cie_;
68 DwarfFde fde_;
Christopher Ferris8642fcb2017-04-24 11:14:39 -070069};
Christopher Ferris7e21eba2019-06-20 16:16:42 -070070TYPED_TEST_SUITE_P(DwarfCfaLogTest);
Christopher Ferris8642fcb2017-04-24 11:14:39 -070071
72// NOTE: All class variable references have to be prefaced with this->.
73
74TYPED_TEST_P(DwarfCfaLogTest, cfa_illegal) {
75 for (uint8_t i = 0x17; i < 0x3f; i++) {
Tamas Petz6835d012020-01-22 14:22:41 +010076 if (i == 0x2d || i == 0x2e || i == 0x2f) {
77 // Skip gnu extension ops and aarch64 specialized op.
Christopher Ferris8642fcb2017-04-24 11:14:39 -070078 continue;
79 }
80 this->memory_.SetMemory(0x2000, std::vector<uint8_t>{i});
81
82 ResetLogs();
Christopher Ferris4cc36d22018-06-06 14:47:31 -070083 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x2000, 0x2001));
Christopher Ferris8642fcb2017-04-24 11:14:39 -070084 std::string expected = "4 unwind Illegal\n";
85 expected += android::base::StringPrintf("4 unwind Raw Data: 0x%02x\n", i);
86 ASSERT_EQ(expected, GetFakeLogPrint());
87 ASSERT_EQ("", GetFakeLogBuf());
88 }
89}
90
91TYPED_TEST_P(DwarfCfaLogTest, cfa_nop) {
92 this->memory_.SetMemory(0x2000, std::vector<uint8_t>{0x00});
93
Christopher Ferris4cc36d22018-06-06 14:47:31 -070094 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x2000, 0x2001));
Christopher Ferris8642fcb2017-04-24 11:14:39 -070095 std::string expected =
96 "4 unwind DW_CFA_nop\n"
97 "4 unwind Raw Data: 0x00\n";
98 ASSERT_EQ(expected, GetFakeLogPrint());
99 ASSERT_EQ("", GetFakeLogBuf());
100}
101
102TYPED_TEST_P(DwarfCfaLogTest, cfa_offset) {
103 this->memory_.SetMemory(0x2000, std::vector<uint8_t>{0x83, 0x04});
104
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700105 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x2000, 0x2002));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700106 std::string expected =
107 "4 unwind DW_CFA_offset register(3) 4\n"
108 "4 unwind Raw Data: 0x83 0x04\n";
109 ASSERT_EQ(expected, GetFakeLogPrint());
110 ASSERT_EQ("", GetFakeLogBuf());
111
112 ResetLogs();
113 this->memory_.SetMemory(0x2100, std::vector<uint8_t>{0x83, 0x84, 0x01});
114
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700115 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x2100, 0x2103));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700116 expected =
117 "4 unwind DW_CFA_offset register(3) 132\n"
118 "4 unwind Raw Data: 0x83 0x84 0x01\n";
119 ASSERT_EQ(expected, GetFakeLogPrint());
120 ASSERT_EQ("", GetFakeLogBuf());
121}
122
123TYPED_TEST_P(DwarfCfaLogTest, cfa_offset_extended) {
124 this->memory_.SetMemory(0x500, std::vector<uint8_t>{0x05, 0x03, 0x02});
125
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700126 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x500, 0x503));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700127 std::string expected =
128 "4 unwind DW_CFA_offset_extended register(3) 2\n"
129 "4 unwind Raw Data: 0x05 0x03 0x02\n";
130 ASSERT_EQ(expected, GetFakeLogPrint());
131 ASSERT_EQ("", GetFakeLogBuf());
132
133 ResetLogs();
134 this->memory_.SetMemory(0x1500, std::vector<uint8_t>{0x05, 0x81, 0x01, 0x82, 0x12});
135
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700136 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x1500, 0x1505));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700137 expected =
138 "4 unwind DW_CFA_offset_extended register(129) 2306\n"
139 "4 unwind Raw Data: 0x05 0x81 0x01 0x82 0x12\n";
140 ASSERT_EQ(expected, GetFakeLogPrint());
141 ASSERT_EQ("", GetFakeLogBuf());
142}
143
144TYPED_TEST_P(DwarfCfaLogTest, cfa_offset_extended_sf) {
145 this->memory_.SetMemory(0x500, std::vector<uint8_t>{0x11, 0x05, 0x10});
146
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700147 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x500, 0x503));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700148 std::string expected =
149 "4 unwind DW_CFA_offset_extended_sf register(5) 16\n"
150 "4 unwind Raw Data: 0x11 0x05 0x10\n";
151 ASSERT_EQ(expected, GetFakeLogPrint());
152 ASSERT_EQ("", GetFakeLogBuf());
153
154 // Check a negative value for the offset.
155 ResetLogs();
156 this->memory_.SetMemory(0x1500, std::vector<uint8_t>{0x11, 0x86, 0x01, 0xff, 0x7f});
157
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700158 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x1500, 0x1505));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700159 expected =
160 "4 unwind DW_CFA_offset_extended_sf register(134) -1\n"
161 "4 unwind Raw Data: 0x11 0x86 0x01 0xff 0x7f\n";
162 ASSERT_EQ(expected, GetFakeLogPrint());
163 ASSERT_EQ("", GetFakeLogBuf());
164}
165
166TYPED_TEST_P(DwarfCfaLogTest, cfa_restore) {
167 this->memory_.SetMemory(0x2000, std::vector<uint8_t>{0xc2});
168
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700169 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x2000, 0x2001));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700170 std::string expected =
171 "4 unwind DW_CFA_restore register(2)\n"
172 "4 unwind Raw Data: 0xc2\n";
173 ASSERT_EQ(expected, GetFakeLogPrint());
174 ASSERT_EQ("", GetFakeLogBuf());
175
176 ResetLogs();
177 this->memory_.SetMemory(0x3000, std::vector<uint8_t>{0x82, 0x04, 0xc2});
178
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700179 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x3000, 0x3003));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700180 expected =
181 "4 unwind DW_CFA_offset register(2) 4\n"
182 "4 unwind Raw Data: 0x82 0x04\n"
183 "4 unwind DW_CFA_restore register(2)\n"
184 "4 unwind Raw Data: 0xc2\n";
185 ASSERT_EQ(expected, GetFakeLogPrint());
186 ASSERT_EQ("", GetFakeLogBuf());
187}
188
189TYPED_TEST_P(DwarfCfaLogTest, cfa_restore_extended) {
190 this->memory_.SetMemory(0x4000, std::vector<uint8_t>{0x06, 0x08});
191
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700192 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x4000, 0x4002));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700193 std::string expected =
194 "4 unwind DW_CFA_restore_extended register(8)\n"
195 "4 unwind Raw Data: 0x06 0x08\n";
196 ASSERT_EQ(expected, GetFakeLogPrint());
197 ASSERT_EQ("", GetFakeLogBuf());
198
199 ResetLogs();
200 this->memory_.SetMemory(0x5000, std::vector<uint8_t>{0x05, 0x82, 0x02, 0x04, 0x06, 0x82, 0x02});
201
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700202 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x5000, 0x5007));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700203 expected =
204 "4 unwind DW_CFA_offset_extended register(258) 4\n"
205 "4 unwind Raw Data: 0x05 0x82 0x02 0x04\n"
206 "4 unwind DW_CFA_restore_extended register(258)\n"
207 "4 unwind Raw Data: 0x06 0x82 0x02\n";
208 ASSERT_EQ(expected, GetFakeLogPrint());
209 ASSERT_EQ("", GetFakeLogBuf());
210}
211
212TYPED_TEST_P(DwarfCfaLogTest, cfa_set_loc) {
213 uint8_t buffer[1 + sizeof(TypeParam)];
214 buffer[0] = 0x1;
215 TypeParam address;
216 std::string raw_data("Raw Data: 0x01 ");
217 std::string address_str;
218 if (std::is_same<TypeParam, uint32_t>::value) {
219 address = 0x81234578U;
220 address_str = "0x81234578";
221 raw_data += "0x78 0x45 0x23 0x81";
222 } else {
223 address = 0x8123456712345678ULL;
224 address_str = "0x8123456712345678";
225 raw_data += "0x78 0x56 0x34 0x12 0x67 0x45 0x23 0x81";
226 }
227 memcpy(&buffer[1], &address, sizeof(address));
228
229 this->memory_.SetMemory(0x50, buffer, sizeof(buffer));
230 ResetLogs();
231
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700232 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x50, 0x51 + sizeof(TypeParam)));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700233 std::string expected = "4 unwind DW_CFA_set_loc " + address_str + "\n";
234 expected += "4 unwind " + raw_data + "\n";
235 expected += "4 unwind \n";
236 expected += "4 unwind PC " + address_str + "\n";
237 ASSERT_EQ(expected, GetFakeLogPrint());
238 ASSERT_EQ("", GetFakeLogBuf());
239
240 // Check for a set going back.
241 ResetLogs();
242 this->fde_.pc_start = address + 0x10;
243
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700244 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x50, 0x51 + sizeof(TypeParam)));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700245 expected = "4 unwind DW_CFA_set_loc " + address_str + "\n";
246 expected += "4 unwind " + raw_data + "\n";
247 expected += "4 unwind \n";
248 expected += "4 unwind PC " + address_str + "\n";
249 ASSERT_EQ(expected, GetFakeLogPrint());
250 ASSERT_EQ("", GetFakeLogBuf());
251}
252
253TYPED_TEST_P(DwarfCfaLogTest, cfa_advance_loc) {
254 this->memory_.SetMemory(0x200, std::vector<uint8_t>{0x44});
255
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700256 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x200, 0x201));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700257 std::string expected =
258 "4 unwind DW_CFA_advance_loc 4\n"
259 "4 unwind Raw Data: 0x44\n"
260 "4 unwind \n"
261 "4 unwind PC 0x2010\n";
262 ASSERT_EQ(expected, GetFakeLogPrint());
263 ASSERT_EQ("", GetFakeLogBuf());
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700264}
265
266TYPED_TEST_P(DwarfCfaLogTest, cfa_advance_loc1) {
267 this->memory_.SetMemory(0x200, std::vector<uint8_t>{0x02, 0x04});
268
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700269 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x200, 0x202));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700270 std::string expected =
271 "4 unwind DW_CFA_advance_loc1 4\n"
272 "4 unwind Raw Data: 0x02 0x04\n"
273 "4 unwind \n"
274 "4 unwind PC 0x2004\n";
275 ASSERT_EQ(expected, GetFakeLogPrint());
276 ASSERT_EQ("", GetFakeLogBuf());
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700277}
278
279TYPED_TEST_P(DwarfCfaLogTest, cfa_advance_loc2) {
280 this->memory_.SetMemory(0x600, std::vector<uint8_t>{0x03, 0x04, 0x03});
281
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700282 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x600, 0x603));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700283 std::string expected =
284 "4 unwind DW_CFA_advance_loc2 772\n"
285 "4 unwind Raw Data: 0x03 0x04 0x03\n"
286 "4 unwind \n"
287 "4 unwind PC 0x2304\n";
288 ASSERT_EQ(expected, GetFakeLogPrint());
289 ASSERT_EQ("", GetFakeLogBuf());
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700290}
291
292TYPED_TEST_P(DwarfCfaLogTest, cfa_advance_loc4) {
293 this->memory_.SetMemory(0x500, std::vector<uint8_t>{0x04, 0x04, 0x03, 0x02, 0x01});
294
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700295 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x500, 0x505));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700296 std::string expected =
297 "4 unwind DW_CFA_advance_loc4 16909060\n"
298 "4 unwind Raw Data: 0x04 0x04 0x03 0x02 0x01\n"
299 "4 unwind \n"
300 "4 unwind PC 0x1022304\n";
301 ASSERT_EQ(expected, GetFakeLogPrint());
302 ASSERT_EQ("", GetFakeLogBuf());
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700303}
304
305TYPED_TEST_P(DwarfCfaLogTest, cfa_undefined) {
306 this->memory_.SetMemory(0xa00, std::vector<uint8_t>{0x07, 0x09});
307
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700308 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0xa00, 0xa02));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700309 std::string expected =
310 "4 unwind DW_CFA_undefined register(9)\n"
311 "4 unwind Raw Data: 0x07 0x09\n";
312 ASSERT_EQ(expected, GetFakeLogPrint());
313 ASSERT_EQ("", GetFakeLogBuf());
314
315 ResetLogs();
316 dwarf_loc_regs_t cie_loc_regs;
317 this->memory_.SetMemory(0x1a00, std::vector<uint8_t>{0x07, 0x81, 0x01});
318
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700319 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x1a00, 0x1a03));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700320 expected =
321 "4 unwind DW_CFA_undefined register(129)\n"
322 "4 unwind Raw Data: 0x07 0x81 0x01\n";
323 ASSERT_EQ(expected, GetFakeLogPrint());
324 ASSERT_EQ("", GetFakeLogBuf());
325}
326
327TYPED_TEST_P(DwarfCfaLogTest, cfa_same) {
328 this->memory_.SetMemory(0x100, std::vector<uint8_t>{0x08, 0x7f});
329
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700330 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x100, 0x102));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700331 std::string expected =
332 "4 unwind DW_CFA_same_value register(127)\n"
333 "4 unwind Raw Data: 0x08 0x7f\n";
334 ASSERT_EQ(expected, GetFakeLogPrint());
335 ASSERT_EQ("", GetFakeLogBuf());
336
337 ResetLogs();
338 this->memory_.SetMemory(0x2100, std::vector<uint8_t>{0x08, 0xff, 0x01});
339
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700340 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x2100, 0x2103));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700341 expected =
342 "4 unwind DW_CFA_same_value register(255)\n"
343 "4 unwind Raw Data: 0x08 0xff 0x01\n";
344 ASSERT_EQ(expected, GetFakeLogPrint());
345 ASSERT_EQ("", GetFakeLogBuf());
346}
347
348TYPED_TEST_P(DwarfCfaLogTest, cfa_register) {
349 this->memory_.SetMemory(0x300, std::vector<uint8_t>{0x09, 0x02, 0x01});
350
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700351 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x300, 0x303));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700352 std::string expected =
353 "4 unwind DW_CFA_register register(2) register(1)\n"
354 "4 unwind Raw Data: 0x09 0x02 0x01\n";
355 ASSERT_EQ(expected, GetFakeLogPrint());
356 ASSERT_EQ("", GetFakeLogBuf());
357
358 ResetLogs();
359 this->memory_.SetMemory(0x4300, std::vector<uint8_t>{0x09, 0xff, 0x01, 0xff, 0x03});
360
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700361 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x4300, 0x4305));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700362 expected =
363 "4 unwind DW_CFA_register register(255) register(511)\n"
364 "4 unwind Raw Data: 0x09 0xff 0x01 0xff 0x03\n";
365 ASSERT_EQ(expected, GetFakeLogPrint());
366 ASSERT_EQ("", GetFakeLogBuf());
367}
368
369TYPED_TEST_P(DwarfCfaLogTest, cfa_state) {
370 this->memory_.SetMemory(0x300, std::vector<uint8_t>{0x0a});
371
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700372 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x300, 0x301));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700373
374 std::string expected =
375 "4 unwind DW_CFA_remember_state\n"
376 "4 unwind Raw Data: 0x0a\n";
377 ASSERT_EQ(expected, GetFakeLogPrint());
378 ASSERT_EQ("", GetFakeLogBuf());
379
380 ResetLogs();
381 this->memory_.SetMemory(0x4300, std::vector<uint8_t>{0x0b});
382
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700383 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x4300, 0x4301));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700384
385 expected =
386 "4 unwind DW_CFA_restore_state\n"
387 "4 unwind Raw Data: 0x0b\n";
388 ASSERT_EQ(expected, GetFakeLogPrint());
389 ASSERT_EQ("", GetFakeLogBuf());
390}
391
392TYPED_TEST_P(DwarfCfaLogTest, cfa_state_cfa_offset_restore) {
393 this->memory_.SetMemory(0x3000, std::vector<uint8_t>{0x0a, 0x0e, 0x40, 0x0b});
394
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700395 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x3000, 0x3004));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700396
397 std::string expected =
398 "4 unwind DW_CFA_remember_state\n"
399 "4 unwind Raw Data: 0x0a\n"
400 "4 unwind DW_CFA_def_cfa_offset 64\n"
401 "4 unwind Raw Data: 0x0e 0x40\n"
402 "4 unwind DW_CFA_restore_state\n"
403 "4 unwind Raw Data: 0x0b\n";
404 ASSERT_EQ(expected, GetFakeLogPrint());
405 ASSERT_EQ("", GetFakeLogBuf());
406}
407
408TYPED_TEST_P(DwarfCfaLogTest, cfa_def_cfa) {
409 this->memory_.SetMemory(0x100, std::vector<uint8_t>{0x0c, 0x7f, 0x74});
410
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700411 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x100, 0x103));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700412
413 std::string expected =
414 "4 unwind DW_CFA_def_cfa register(127) 116\n"
415 "4 unwind Raw Data: 0x0c 0x7f 0x74\n";
416 ASSERT_EQ(expected, GetFakeLogPrint());
417 ASSERT_EQ("", GetFakeLogBuf());
418
419 ResetLogs();
420 this->memory_.SetMemory(0x200, std::vector<uint8_t>{0x0c, 0xff, 0x02, 0xf4, 0x04});
421
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700422 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x200, 0x205));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700423
424 expected =
425 "4 unwind DW_CFA_def_cfa register(383) 628\n"
426 "4 unwind Raw Data: 0x0c 0xff 0x02 0xf4 0x04\n";
427 ASSERT_EQ(expected, GetFakeLogPrint());
428 ASSERT_EQ("", GetFakeLogBuf());
429}
430
431TYPED_TEST_P(DwarfCfaLogTest, cfa_def_cfa_sf) {
432 this->memory_.SetMemory(0x100, std::vector<uint8_t>{0x12, 0x30, 0x25});
433
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700434 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x100, 0x103));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700435
436 std::string expected =
437 "4 unwind DW_CFA_def_cfa_sf register(48) 37\n"
438 "4 unwind Raw Data: 0x12 0x30 0x25\n";
439 ASSERT_EQ(expected, GetFakeLogPrint());
440 ASSERT_EQ("", GetFakeLogBuf());
441
442 // Test a negative value.
443 ResetLogs();
444 this->memory_.SetMemory(0x200, std::vector<uint8_t>{0x12, 0xa3, 0x01, 0xfa, 0x7f});
445
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700446 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x200, 0x205));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700447
448 expected =
449 "4 unwind DW_CFA_def_cfa_sf register(163) -6\n"
450 "4 unwind Raw Data: 0x12 0xa3 0x01 0xfa 0x7f\n";
451 ASSERT_EQ(expected, GetFakeLogPrint());
452 ASSERT_EQ("", GetFakeLogBuf());
453}
454
455TYPED_TEST_P(DwarfCfaLogTest, cfa_def_cfa_register) {
456 this->memory_.SetMemory(0x100, std::vector<uint8_t>{0x0d, 0x72});
457
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700458 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x100, 0x102));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700459
460 std::string expected =
461 "4 unwind DW_CFA_def_cfa_register register(114)\n"
462 "4 unwind Raw Data: 0x0d 0x72\n";
463 ASSERT_EQ(expected, GetFakeLogPrint());
464 ASSERT_EQ("", GetFakeLogBuf());
465
466 ResetLogs();
467 this->memory_.SetMemory(0x200, std::vector<uint8_t>{0x0d, 0xf9, 0x20});
468
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700469 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x200, 0x203));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700470
471 expected =
472 "4 unwind DW_CFA_def_cfa_register register(4217)\n"
473 "4 unwind Raw Data: 0x0d 0xf9 0x20\n";
474 ASSERT_EQ(expected, GetFakeLogPrint());
475 ASSERT_EQ("", GetFakeLogBuf());
476}
477
478TYPED_TEST_P(DwarfCfaLogTest, cfa_def_cfa_offset) {
479 this->memory_.SetMemory(0x100, std::vector<uint8_t>{0x0e, 0x59});
480
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700481 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x100, 0x102));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700482
483 std::string expected =
484 "4 unwind DW_CFA_def_cfa_offset 89\n"
485 "4 unwind Raw Data: 0x0e 0x59\n";
486 ASSERT_EQ(expected, GetFakeLogPrint());
487 ASSERT_EQ("", GetFakeLogBuf());
488
489 ResetLogs();
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700490 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x100, 0x102));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700491
492 expected =
493 "4 unwind DW_CFA_def_cfa_offset 89\n"
494 "4 unwind Raw Data: 0x0e 0x59\n";
495 ASSERT_EQ(expected, GetFakeLogPrint());
496 ASSERT_EQ("", GetFakeLogBuf());
497
498 ResetLogs();
499 this->memory_.SetMemory(0x200, std::vector<uint8_t>{0x0e, 0xd4, 0x0a});
500
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700501 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x200, 0x203));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700502
503 expected =
504 "4 unwind DW_CFA_def_cfa_offset 1364\n"
505 "4 unwind Raw Data: 0x0e 0xd4 0x0a\n";
506 ASSERT_EQ(expected, GetFakeLogPrint());
507 ASSERT_EQ("", GetFakeLogBuf());
508}
509
510TYPED_TEST_P(DwarfCfaLogTest, cfa_def_cfa_offset_sf) {
511 this->memory_.SetMemory(0x100, std::vector<uint8_t>{0x13, 0x23});
512
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700513 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x100, 0x102));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700514
515 std::string expected =
516 "4 unwind DW_CFA_def_cfa_offset_sf 35\n"
517 "4 unwind Raw Data: 0x13 0x23\n";
518 ASSERT_EQ(expected, GetFakeLogPrint());
519 ASSERT_EQ("", GetFakeLogBuf());
520
521 ResetLogs();
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700522 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x100, 0x102));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700523
524 expected =
525 "4 unwind DW_CFA_def_cfa_offset_sf 35\n"
526 "4 unwind Raw Data: 0x13 0x23\n";
527 ASSERT_EQ(expected, GetFakeLogPrint());
528 ASSERT_EQ("", GetFakeLogBuf());
529
530 // Negative offset.
531 ResetLogs();
532 this->memory_.SetMemory(0x200, std::vector<uint8_t>{0x13, 0xf6, 0x7f});
533
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700534 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x200, 0x203));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700535
536 expected =
537 "4 unwind DW_CFA_def_cfa_offset_sf -10\n"
538 "4 unwind Raw Data: 0x13 0xf6 0x7f\n";
539 ASSERT_EQ(expected, GetFakeLogPrint());
540 ASSERT_EQ("", GetFakeLogBuf());
541}
542
543TYPED_TEST_P(DwarfCfaLogTest, cfa_def_cfa_expression) {
544 this->memory_.SetMemory(0x100, std::vector<uint8_t>{0x0f, 0x04, 0x01, 0x02, 0x04, 0x05});
545
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700546 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x100, 0x106));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700547
548 std::string expected =
549 "4 unwind DW_CFA_def_cfa_expression 4\n"
550 "4 unwind Raw Data: 0x0f 0x04 0x01 0x02 0x04 0x05\n"
551 "4 unwind Illegal\n"
552 "4 unwind Raw Data: 0x01\n"
553 "4 unwind Illegal\n"
554 "4 unwind Raw Data: 0x02\n"
555 "4 unwind Illegal\n"
556 "4 unwind Raw Data: 0x04\n"
557 "4 unwind Illegal\n"
558 "4 unwind Raw Data: 0x05\n";
559 ASSERT_EQ(expected, GetFakeLogPrint());
560 ASSERT_EQ("", GetFakeLogBuf());
561
562 ResetLogs();
563 std::vector<uint8_t> ops{0x0f, 0x81, 0x01};
564 expected = "4 unwind Raw Data: 0x0f 0x81 0x01";
565 std::string op_string;
566 for (uint8_t i = 3; i < 132; i++) {
567 ops.push_back(0x05);
568 op_string +=
569 "4 unwind Illegal\n"
570 "4 unwind Raw Data: 0x05\n";
571 expected += " 0x05";
572 if (((i + 1) % 10) == 0) {
573 expected += "\n4 unwind Raw Data:";
574 }
575 }
576 expected += '\n';
577 this->memory_.SetMemory(0x200, ops);
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700578 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x200, 0x284));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700579
580 expected = "4 unwind DW_CFA_def_cfa_expression 129\n" + expected;
581 ASSERT_EQ(expected + op_string, GetFakeLogPrint());
582 ASSERT_EQ("", GetFakeLogBuf());
583}
584
585TYPED_TEST_P(DwarfCfaLogTest, cfa_expression) {
586 this->memory_.SetMemory(0x100, std::vector<uint8_t>{0x10, 0x04, 0x02, 0xc0, 0xc1});
587
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700588 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x100, 0x105));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700589
590 std::string expected =
591 "4 unwind DW_CFA_expression register(4) 2\n"
592 "4 unwind Raw Data: 0x10 0x04 0x02 0xc0 0xc1\n"
593 "4 unwind Illegal\n"
594 "4 unwind Raw Data: 0xc0\n"
595 "4 unwind Illegal\n"
596 "4 unwind Raw Data: 0xc1\n";
597 ASSERT_EQ(expected, GetFakeLogPrint());
598 ASSERT_EQ("", GetFakeLogBuf());
599
600 ResetLogs();
601 std::vector<uint8_t> ops{0x10, 0xff, 0x01, 0x82, 0x01};
602 expected = "4 unwind Raw Data: 0x10 0xff 0x01 0x82 0x01";
603 std::string op_string;
604 for (uint8_t i = 5; i < 135; i++) {
605 ops.push_back(0xa0 + (i - 5) % 96);
606 op_string += "4 unwind Illegal\n";
607 op_string += android::base::StringPrintf("4 unwind Raw Data: 0x%02x\n", ops.back());
608 expected += android::base::StringPrintf(" 0x%02x", ops.back());
609 if (((i + 1) % 10) == 0) {
610 expected += "\n4 unwind Raw Data:";
611 }
612 }
613 expected = "4 unwind DW_CFA_expression register(255) 130\n" + expected + "\n";
614
615 this->memory_.SetMemory(0x200, ops);
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700616 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x200, 0x287));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700617
618 ASSERT_EQ(expected + op_string, GetFakeLogPrint());
619 ASSERT_EQ("", GetFakeLogBuf());
620}
621
622TYPED_TEST_P(DwarfCfaLogTest, cfa_val_offset) {
623 this->memory_.SetMemory(0x100, std::vector<uint8_t>{0x14, 0x45, 0x54});
624
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700625 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x100, 0x103));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700626
627 std::string expected =
628 "4 unwind DW_CFA_val_offset register(69) 84\n"
629 "4 unwind Raw Data: 0x14 0x45 0x54\n";
630 ASSERT_EQ(expected, GetFakeLogPrint());
631 ASSERT_EQ("", GetFakeLogBuf());
632
633 ResetLogs();
634 this->memory_.SetMemory(0x400, std::vector<uint8_t>{0x14, 0xa2, 0x02, 0xb4, 0x05});
635
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700636 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x400, 0x405));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700637
638 expected =
639 "4 unwind DW_CFA_val_offset register(290) 692\n"
640 "4 unwind Raw Data: 0x14 0xa2 0x02 0xb4 0x05\n";
641 ASSERT_EQ(expected, GetFakeLogPrint());
642 ASSERT_EQ("", GetFakeLogBuf());
643}
644
645TYPED_TEST_P(DwarfCfaLogTest, cfa_val_offset_sf) {
646 this->memory_.SetMemory(0x100, std::vector<uint8_t>{0x15, 0x56, 0x12});
647
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700648 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x100, 0x103));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700649
650 std::string expected =
651 "4 unwind DW_CFA_val_offset_sf register(86) 18\n"
652 "4 unwind Raw Data: 0x15 0x56 0x12\n";
653 ASSERT_EQ(expected, GetFakeLogPrint());
654 ASSERT_EQ("", GetFakeLogBuf());
655
656 // Negative value.
657 ResetLogs();
658 this->memory_.SetMemory(0xa00, std::vector<uint8_t>{0x15, 0xff, 0x01, 0xc0, 0x7f});
659
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700660 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0xa00, 0xa05));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700661
662 expected =
663 "4 unwind DW_CFA_val_offset_sf register(255) -64\n"
664 "4 unwind Raw Data: 0x15 0xff 0x01 0xc0 0x7f\n";
665 ASSERT_EQ(expected, GetFakeLogPrint());
666 ASSERT_EQ("", GetFakeLogBuf());
667}
668
669TYPED_TEST_P(DwarfCfaLogTest, cfa_val_expression) {
670 this->memory_.SetMemory(0x100, std::vector<uint8_t>{0x16, 0x05, 0x02, 0xb0, 0xb1});
671
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700672 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x100, 0x105));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700673
674 std::string expected =
675 "4 unwind DW_CFA_val_expression register(5) 2\n"
676 "4 unwind Raw Data: 0x16 0x05 0x02 0xb0 0xb1\n"
677 "4 unwind Illegal\n"
678 "4 unwind Raw Data: 0xb0\n"
679 "4 unwind Illegal\n"
680 "4 unwind Raw Data: 0xb1\n";
681 ASSERT_EQ(expected, GetFakeLogPrint());
682 ASSERT_EQ("", GetFakeLogBuf());
683
684 ResetLogs();
685 std::vector<uint8_t> ops{0x16, 0x83, 0x10, 0xa8, 0x01};
686 expected = "4 unwind Raw Data: 0x16 0x83 0x10 0xa8 0x01";
687 std::string op_string;
688 for (uint8_t i = 0; i < 168; i++) {
689 ops.push_back(0xa0 + (i % 96));
690 op_string += "4 unwind Illegal\n";
691 op_string += android::base::StringPrintf("4 unwind Raw Data: 0x%02x\n", ops.back());
692 expected += android::base::StringPrintf(" 0x%02x", ops.back());
693 if (((i + 6) % 10) == 0) {
694 expected += "\n4 unwind Raw Data:";
695 }
696 }
697 expected = "4 unwind DW_CFA_val_expression register(2051) 168\n" + expected + "\n";
698
699 this->memory_.SetMemory(0xa00, ops);
700
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700701 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0xa00, 0xaad));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700702
703 ASSERT_EQ(expected + op_string, GetFakeLogPrint());
704 ASSERT_EQ("", GetFakeLogBuf());
705}
706
707TYPED_TEST_P(DwarfCfaLogTest, cfa_gnu_args_size) {
708 this->memory_.SetMemory(0x2000, std::vector<uint8_t>{0x2e, 0x04});
709
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700710 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x2000, 0x2002));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700711
712 std::string expected =
713 "4 unwind DW_CFA_GNU_args_size 4\n"
714 "4 unwind Raw Data: 0x2e 0x04\n";
715 ASSERT_EQ(expected, GetFakeLogPrint());
716 ASSERT_EQ("", GetFakeLogBuf());
717
718 ResetLogs();
719 this->memory_.SetMemory(0x5000, std::vector<uint8_t>{0x2e, 0xa4, 0x80, 0x04});
720
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700721 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x5000, 0x5004));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700722
723 expected =
724 "4 unwind DW_CFA_GNU_args_size 65572\n"
725 "4 unwind Raw Data: 0x2e 0xa4 0x80 0x04\n";
726 ASSERT_EQ(expected, GetFakeLogPrint());
727 ASSERT_EQ("", GetFakeLogBuf());
728}
729
730TYPED_TEST_P(DwarfCfaLogTest, cfa_gnu_negative_offset_extended) {
731 this->memory_.SetMemory(0x500, std::vector<uint8_t>{0x2f, 0x08, 0x10});
732
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700733 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x500, 0x503));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700734
735 std::string expected =
736 "4 unwind DW_CFA_GNU_negative_offset_extended register(8) 16\n"
737 "4 unwind Raw Data: 0x2f 0x08 0x10\n";
738 ASSERT_EQ(expected, GetFakeLogPrint());
739 ASSERT_EQ("", GetFakeLogBuf());
740
741 ResetLogs();
742 this->memory_.SetMemory(0x1500, std::vector<uint8_t>{0x2f, 0x81, 0x02, 0xff, 0x01});
743
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700744 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x1500, 0x1505));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700745
746 expected =
747 "4 unwind DW_CFA_GNU_negative_offset_extended register(257) 255\n"
748 "4 unwind Raw Data: 0x2f 0x81 0x02 0xff 0x01\n";
749 ASSERT_EQ(expected, GetFakeLogPrint());
750 ASSERT_EQ("", GetFakeLogBuf());
751}
752
753TYPED_TEST_P(DwarfCfaLogTest, cfa_register_override) {
754 this->memory_.SetMemory(0x300, std::vector<uint8_t>{0x09, 0x02, 0x01, 0x09, 0x02, 0x04});
755
Christopher Ferris4cc36d22018-06-06 14:47:31 -0700756 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x300, 0x306));
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700757
758 std::string expected =
759 "4 unwind DW_CFA_register register(2) register(1)\n"
760 "4 unwind Raw Data: 0x09 0x02 0x01\n"
761 "4 unwind DW_CFA_register register(2) register(4)\n"
762 "4 unwind Raw Data: 0x09 0x02 0x04\n";
763 ASSERT_EQ(expected, GetFakeLogPrint());
764 ASSERT_EQ("", GetFakeLogBuf());
765}
766
Tamas Petz6835d012020-01-22 14:22:41 +0100767TYPED_TEST_P(DwarfCfaLogTest, cfa_aarch64_negate_ra_state) {
768 // Verify that if the cfa op is handled properly depending on aarch.
769 this->memory_.SetMemory(0x2000, std::vector<uint8_t>{0x2d});
770
771 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x2000, 0x2001));
772 std::string expected = "4 unwind Illegal (Only valid on aarch64)\n";
773 expected += "4 unwind Raw Data: 0x2d\n";
774 ASSERT_EQ(expected, GetFakeLogPrint());
775 ASSERT_EQ("", GetFakeLogBuf());
776
777 ResetLogs();
778 this->cfa_.reset(new DwarfCfa<TypeParam>(this->dmem_.get(), &this->fde_, ARCH_ARM64));
779
780 ASSERT_TRUE(this->cfa_->Log(0, this->fde_.pc_start, 0x2000, 0x2001));
781 expected = "4 unwind DW_CFA_AARCH64_negate_ra_state\n";
782 expected += "4 unwind Raw Data: 0x2d\n";
783 ASSERT_EQ(expected, GetFakeLogPrint());
784 ASSERT_EQ("", GetFakeLogBuf());
785}
786
Christopher Ferris7e21eba2019-06-20 16:16:42 -0700787REGISTER_TYPED_TEST_SUITE_P(DwarfCfaLogTest, cfa_illegal, cfa_nop, cfa_offset, cfa_offset_extended,
788 cfa_offset_extended_sf, cfa_restore, cfa_restore_extended, cfa_set_loc,
789 cfa_advance_loc, cfa_advance_loc1, cfa_advance_loc2, cfa_advance_loc4,
790 cfa_undefined, cfa_same, cfa_register, cfa_state,
791 cfa_state_cfa_offset_restore, cfa_def_cfa, cfa_def_cfa_sf,
792 cfa_def_cfa_register, cfa_def_cfa_offset, cfa_def_cfa_offset_sf,
793 cfa_def_cfa_expression, cfa_expression, cfa_val_offset,
794 cfa_val_offset_sf, cfa_val_expression, cfa_gnu_args_size,
Tamas Petz6835d012020-01-22 14:22:41 +0100795 cfa_gnu_negative_offset_extended, cfa_register_override,
796 cfa_aarch64_negate_ra_state);
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700797
798typedef ::testing::Types<uint32_t, uint64_t> DwarfCfaLogTestTypes;
Haibo Huang0c01bb62019-12-11 12:46:20 -0800799INSTANTIATE_TYPED_TEST_SUITE_P(Libunwindstack, DwarfCfaLogTest, DwarfCfaLogTestTypes);
Christopher Ferrisd226a512017-07-14 10:37:19 -0700800
801} // namespace unwindstack