forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDWARFDebugLineTest.cpp
2151 lines (1869 loc) · 85.1 KB
/
DWARFDebugLineTest.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//===- DWARFDebugLineTest.cpp ---------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "llvm/DebugInfo/DWARF/DWARFDebugLine.h"
#include "DwarfGenerator.h"
#include "DwarfUtils.h"
#include "llvm/DebugInfo/DWARF/DWARFContext.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Testing/Support/Error.h"
#include "gtest/gtest.h"
// AIX doesn't support the debug_addr section
#ifdef _AIX
#define NO_SUPPORT_DEBUG_ADDR
#endif
using namespace llvm;
using namespace dwarf;
using namespace dwarfgen;
using namespace object;
using namespace utils;
using namespace testing;
namespace {
struct CommonFixture {
CommonFixture()
: LineData("", true, 0), Recoverable(Error::success()),
RecordRecoverable(std::bind(&CommonFixture::recordRecoverable, this,
std::placeholders::_1)),
Unrecoverable(Error::success()),
RecordUnrecoverable(std::bind(&CommonFixture::recordUnrecoverable, this,
std::placeholders::_1)){};
~CommonFixture() {
EXPECT_FALSE(Recoverable);
EXPECT_FALSE(Unrecoverable);
}
// Note: ASSERT_THAT_EXPECTED cannot be used in a non-void function, so
// setupGenerator() is split into two.
void setupGeneratorImpl(uint16_t Version, uint8_t AddrSize) {
AddressSize = AddrSize;
Triple T = getDefaultTargetTripleForAddrSize(AddressSize ? AddressSize : 8);
if (!isConfigurationSupported(T))
return;
auto ExpectedGenerator = Generator::create(T, Version);
ASSERT_THAT_EXPECTED(ExpectedGenerator, Succeeded());
Gen = std::move(*ExpectedGenerator);
}
bool setupGenerator(uint16_t Version = 4, uint8_t AddrSize = 8) {
setupGeneratorImpl(Version, AddrSize);
return Gen != nullptr;
}
void generate() {
Context = createContext();
assert(Context != nullptr && "test state is not valid");
const DWARFObject &Obj = Context->getDWARFObj();
uint8_t TargetAddrSize = AddressSize == 0 ? 8 : AddressSize;
LineData = DWARFDataExtractor(
Obj, Obj.getLineSection(),
getDefaultTargetTripleForAddrSize(TargetAddrSize).isLittleEndian(),
AddressSize);
}
std::unique_ptr<DWARFContext> createContext() {
assert(Gen != nullptr && "Generator is not set up");
StringRef FileBytes = Gen->generate();
MemoryBufferRef FileBuffer(FileBytes, "dwarf");
auto Obj = object::ObjectFile::createObjectFile(FileBuffer);
if (Obj)
return DWARFContext::create(**Obj);
return nullptr;
}
DWARFDebugLine::SectionParser setupParser() {
LineTable < = Gen->addLineTable(DWARF32);
LT.addExtendedOpcode(9, DW_LNE_set_address, {{0xadd4e55, LineTable::Quad}});
LT.addStandardOpcode(DW_LNS_copy, {});
LT.addByte(0xaa);
LT.addExtendedOpcode(1, DW_LNE_end_sequence, {});
LineTable <2 = Gen->addLineTable(DWARF64);
LT2.addExtendedOpcode(9, DW_LNE_set_address,
{{0x11223344, LineTable::Quad}});
LT2.addStandardOpcode(DW_LNS_copy, {});
LT2.addByte(0xbb);
LT2.addExtendedOpcode(1, DW_LNE_end_sequence, {});
generate();
return DWARFDebugLine::SectionParser(LineData, *Context, Units);
}
void recordRecoverable(Error Err) {
Recoverable = joinErrors(std::move(Recoverable), std::move(Err));
}
void recordUnrecoverable(Error Err) {
Unrecoverable = joinErrors(std::move(Unrecoverable), std::move(Err));
}
Expected<const DWARFDebugLine::LineTable *>
getOrParseLineTableFatalErrors(uint64_t Offset = 0) {
auto ExpectedLineTable = Line.getOrParseLineTable(
LineData, Offset, *Context, nullptr, RecordRecoverable);
EXPECT_THAT_ERROR(std::move(Recoverable), Succeeded());
return ExpectedLineTable;
}
uint8_t AddressSize;
std::unique_ptr<Generator> Gen;
std::unique_ptr<DWARFContext> Context;
DWARFDataExtractor LineData;
DWARFDebugLine Line;
Error Recoverable;
std::function<void(Error)> RecordRecoverable;
Error Unrecoverable;
std::function<void(Error)> RecordUnrecoverable;
SmallVector<std::unique_ptr<DWARFUnit>, 2> Units;
};
// Fixtures must derive from "Test", but parameterised fixtures from
// "TestWithParam". It does not seem possible to inherit from both, so we share
// the common state in a separate class, inherited by the two fixture classes.
struct DebugLineBasicFixture : public Test, public CommonFixture {};
struct DebugLineParameterisedFixture
: public TestWithParam<std::pair<uint16_t, DwarfFormat>>,
public CommonFixture {
void SetUp() override { std::tie(Version, Format) = GetParam(); }
uint16_t Version;
DwarfFormat Format;
};
void checkDefaultPrologue(uint16_t Version, DwarfFormat Format,
DWARFDebugLine::Prologue Prologue,
uint64_t BodyLength) {
// Check version specific fields and values.
uint64_t UnitLength;
uint64_t PrologueLength;
switch (Version) {
case 4:
PrologueLength = 36;
UnitLength = PrologueLength + 2;
EXPECT_EQ(Prologue.MaxOpsPerInst, 1u);
break;
case 2:
case 3:
PrologueLength = 35;
UnitLength = PrologueLength + 2;
break;
case 5:
PrologueLength = 42;
UnitLength = PrologueLength + 4;
EXPECT_EQ(Prologue.getAddressSize(), 8u);
EXPECT_EQ(Prologue.SegSelectorSize, 0u);
break;
default:
llvm_unreachable("unsupported DWARF version");
}
UnitLength += BodyLength + (Format == DWARF32 ? 4 : 8);
EXPECT_EQ(Prologue.TotalLength, UnitLength);
EXPECT_EQ(Prologue.PrologueLength, PrologueLength);
EXPECT_EQ(Prologue.MinInstLength, 1u);
EXPECT_EQ(Prologue.DefaultIsStmt, 1u);
EXPECT_EQ(Prologue.LineBase, -5);
EXPECT_EQ(Prologue.LineRange, 14u);
EXPECT_EQ(Prologue.OpcodeBase, 13u);
std::vector<uint8_t> ExpectedLengths = {0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1};
EXPECT_EQ(Prologue.StandardOpcodeLengths, ExpectedLengths);
ASSERT_EQ(Prologue.IncludeDirectories.size(), 1u);
ASSERT_EQ(Prologue.IncludeDirectories[0].getForm(), DW_FORM_string);
EXPECT_STREQ(*toString(Prologue.IncludeDirectories[0]), "a dir");
ASSERT_EQ(Prologue.FileNames.size(), 1u);
ASSERT_EQ(Prologue.FileNames[0].Name.getForm(), DW_FORM_string);
ASSERT_EQ(Prologue.FileNames[0].DirIdx, 0u);
EXPECT_STREQ(*toString(Prologue.FileNames[0].Name), "a file");
}
TEST_F(DebugLineBasicFixture, GetOrParseLineTableAtInvalidOffset) {
if (!setupGenerator())
GTEST_SKIP();
generate();
EXPECT_THAT_EXPECTED(
getOrParseLineTableFatalErrors(0),
FailedWithMessage(
"offset 0x00000000 is not a valid debug line section offset"));
// Repeat to show that an error is reported each time.
EXPECT_THAT_EXPECTED(
getOrParseLineTableFatalErrors(0),
FailedWithMessage(
"offset 0x00000000 is not a valid debug line section offset"));
// Show that an error is reported for later offsets too.
EXPECT_THAT_EXPECTED(
getOrParseLineTableFatalErrors(1),
FailedWithMessage(
"offset 0x00000001 is not a valid debug line section offset"));
}
TEST_F(DebugLineBasicFixture, GetOrParseLineTableAtInvalidOffsetAfterData) {
if (!setupGenerator())
GTEST_SKIP();
LineTable < = Gen->addLineTable();
LT.setCustomPrologue({{0, LineTable::Byte}});
generate();
EXPECT_THAT_EXPECTED(
getOrParseLineTableFatalErrors(0),
FailedWithMessage(
"parsing line table prologue at offset 0x00000000: "
"unexpected end of data at offset 0x1 while reading [0x0, 0x4)"));
EXPECT_THAT_EXPECTED(
getOrParseLineTableFatalErrors(1),
FailedWithMessage(
"offset 0x00000001 is not a valid debug line section offset"));
}
#ifdef NO_SUPPORT_DEBUG_ADDR
TEST_P(DebugLineParameterisedFixture, DISABLED_PrologueGetLength) {
#else
TEST_P(DebugLineParameterisedFixture, PrologueGetLength) {
#endif
if (!setupGenerator(Version))
GTEST_SKIP();
LineTable < = Gen->addLineTable(Format);
DWARFDebugLine::Prologue Prologue = LT.createBasicPrologue();
LT.setPrologue(Prologue);
generate();
// + 10 for sizes of DWARF-32 unit length, version, prologue length.
uint64_t ExpectedLength = Prologue.PrologueLength + 10;
if (Version == 5)
// Add address and segment selector size fields.
ExpectedLength += 2;
if (Format == DWARF64)
// Unit length grows by 8, prologue length by 4.
ExpectedLength += 12;
auto ExpectedLineTable = Line.getOrParseLineTable(LineData, 0, *Context,
nullptr, RecordRecoverable);
ASSERT_THAT_EXPECTED(ExpectedLineTable, Succeeded());
EXPECT_EQ((*ExpectedLineTable)->Prologue.getLength(), ExpectedLength);
}
#ifdef NO_SUPPORT_DEBUG_ADDR
TEST_P(DebugLineParameterisedFixture, DISABLED_GetOrParseLineTableValidTable) {
#else
TEST_P(DebugLineParameterisedFixture, GetOrParseLineTableValidTable) {
#endif
if (!setupGenerator(Version))
GTEST_SKIP();
SCOPED_TRACE("Checking Version " + std::to_string(Version) + ", Format " +
(Format == DWARF64 ? "DWARF64" : "DWARF32"));
LineTable < = Gen->addLineTable(Format);
LT.addExtendedOpcode(9, DW_LNE_set_address, {{0xadd4e55, LineTable::Quad}});
LT.addStandardOpcode(DW_LNS_copy, {});
LT.addByte(0xaa);
LT.addExtendedOpcode(1, DW_LNE_end_sequence, {});
LineTable <2 = Gen->addLineTable(Format);
LT2.addExtendedOpcode(9, DW_LNE_set_address, {{0x11223344, LineTable::Quad}});
LT2.addStandardOpcode(DW_LNS_copy, {});
LT2.addByte(0xbb);
LT2.addExtendedOpcode(1, DW_LNE_end_sequence, {});
LT2.addExtendedOpcode(9, DW_LNE_set_address, {{0x55667788, LineTable::Quad}});
LT2.addStandardOpcode(DW_LNS_copy, {});
LT2.addByte(0xcc);
LT2.addExtendedOpcode(1, DW_LNE_end_sequence, {});
generate();
auto ExpectedLineTable = Line.getOrParseLineTable(LineData, 0, *Context,
nullptr, RecordRecoverable);
ASSERT_TRUE(ExpectedLineTable.operator bool());
EXPECT_FALSE(Recoverable);
const DWARFDebugLine::LineTable *Expected = *ExpectedLineTable;
checkDefaultPrologue(Version, Format, Expected->Prologue, 16);
EXPECT_EQ(Expected->Sequences.size(), 1u);
uint64_t SecondOffset =
Expected->Prologue.sizeofTotalLength() + Expected->Prologue.TotalLength;
Recoverable = Error::success();
auto ExpectedLineTable2 = Line.getOrParseLineTable(
LineData, SecondOffset, *Context, nullptr, RecordRecoverable);
ASSERT_TRUE(ExpectedLineTable2.operator bool());
EXPECT_FALSE(Recoverable);
const DWARFDebugLine::LineTable *Expected2 = *ExpectedLineTable2;
checkDefaultPrologue(Version, Format, Expected2->Prologue, 32);
EXPECT_EQ(Expected2->Sequences.size(), 2u);
EXPECT_NE(Expected, Expected2);
// Check that if the same offset is requested, the exact same pointer is
// returned.
Recoverable = Error::success();
auto ExpectedLineTable3 = Line.getOrParseLineTable(
LineData, 0, *Context, nullptr, RecordRecoverable);
ASSERT_TRUE(ExpectedLineTable3.operator bool());
EXPECT_FALSE(Recoverable);
EXPECT_EQ(Expected, *ExpectedLineTable3);
Recoverable = Error::success();
auto ExpectedLineTable4 = Line.getOrParseLineTable(
LineData, SecondOffset, *Context, nullptr, RecordRecoverable);
ASSERT_TRUE(ExpectedLineTable4.operator bool());
EXPECT_FALSE(Recoverable);
EXPECT_EQ(Expected2, *ExpectedLineTable4);
// TODO: Add tests that show that the body of the programs have been read
// correctly.
}
#ifdef NO_SUPPORT_DEBUG_ADDR
TEST_P(DebugLineParameterisedFixture, DISABLED_ClearLineValidTable) {
#else
TEST_P(DebugLineParameterisedFixture, ClearLineValidTable) {
#endif
if (!setupGenerator(Version))
GTEST_SKIP();
SCOPED_TRACE("Checking Version " + std::to_string(Version) + ", Format " +
(Format == DWARF64 ? "DWARF64" : "DWARF32"));
LineTable < = Gen->addLineTable(Format);
LT.addExtendedOpcode(9, DW_LNE_set_address, {{0xadd4e55, LineTable::Quad}});
LT.addStandardOpcode(DW_LNS_copy, {});
LT.addByte(0xaa);
LT.addExtendedOpcode(1, DW_LNE_end_sequence, {});
LineTable <2 = Gen->addLineTable(Format);
LT2.addExtendedOpcode(9, DW_LNE_set_address, {{0x11223344, LineTable::Quad}});
LT2.addStandardOpcode(DW_LNS_copy, {});
LT2.addByte(0xbb);
LT2.addExtendedOpcode(1, DW_LNE_end_sequence, {});
LT2.addExtendedOpcode(9, DW_LNE_set_address, {{0x55667788, LineTable::Quad}});
LT2.addStandardOpcode(DW_LNS_copy, {});
LT2.addByte(0xcc);
LT2.addExtendedOpcode(1, DW_LNE_end_sequence, {});
generate();
// Check that we have what we expect before calling clearLineTable().
auto ExpectedLineTable = Line.getOrParseLineTable(LineData, 0, *Context,
nullptr, RecordRecoverable);
ASSERT_TRUE((bool)ExpectedLineTable);
EXPECT_FALSE(Recoverable);
const DWARFDebugLine::LineTable *Expected = *ExpectedLineTable;
checkDefaultPrologue(Version, Format, Expected->Prologue, 16);
EXPECT_EQ(Expected->Sequences.size(), 1u);
uint64_t SecondOffset =
Expected->Prologue.sizeofTotalLength() + Expected->Prologue.TotalLength;
Recoverable = Error::success();
auto ExpectedLineTable2 = Line.getOrParseLineTable(
LineData, SecondOffset, *Context, nullptr, RecordRecoverable);
ASSERT_TRUE((bool)ExpectedLineTable2);
EXPECT_FALSE(Recoverable);
const DWARFDebugLine::LineTable *Expected2 = *ExpectedLineTable2;
checkDefaultPrologue(Version, Format, Expected2->Prologue, 32);
EXPECT_EQ(Expected2->Sequences.size(), 2u);
// Check that we no longer get the line tables after clearLineTable().
Line.clearLineTable(0);
Line.clearLineTable(SecondOffset);
EXPECT_EQ(Line.getLineTable(0), nullptr);
EXPECT_EQ(Line.getLineTable(SecondOffset), nullptr);
// Check that if the same offset is requested, the contents match what we
// had before.
Recoverable = Error::success();
auto ExpectedLineTable3 = Line.getOrParseLineTable(
LineData, 0, *Context, nullptr, RecordRecoverable);
ASSERT_TRUE((bool)ExpectedLineTable3);
EXPECT_FALSE(Recoverable);
const DWARFDebugLine::LineTable *Expected3 = *ExpectedLineTable3;
checkDefaultPrologue(Version, Format, Expected3->Prologue, 16);
EXPECT_EQ(Expected3->Sequences.size(), 1u);
Recoverable = Error::success();
auto ExpectedLineTable4 = Line.getOrParseLineTable(
LineData, SecondOffset, *Context, nullptr, RecordRecoverable);
ASSERT_TRUE((bool)ExpectedLineTable4);
EXPECT_FALSE(Recoverable);
const DWARFDebugLine::LineTable *Expected4 = *ExpectedLineTable4;
checkDefaultPrologue(Version, Format, Expected4->Prologue, 32);
EXPECT_EQ(Expected4->Sequences.size(), 2u);
}
TEST_F(DebugLineBasicFixture, ErrorForReservedLength) {
if (!setupGenerator())
GTEST_SKIP();
LineTable < = Gen->addLineTable();
LT.setCustomPrologue({{0xfffffff0, LineTable::Long}});
generate();
EXPECT_THAT_EXPECTED(
getOrParseLineTableFatalErrors(),
FailedWithMessage(
"parsing line table prologue at offset 0x00000000: unsupported "
"reserved unit length of value 0xfffffff0"));
}
struct DebugLineUnsupportedVersionFixture : public TestWithParam<uint16_t>,
public CommonFixture {
void SetUp() override { Version = GetParam(); }
uint16_t Version;
};
TEST_P(DebugLineUnsupportedVersionFixture, ErrorForUnsupportedVersion) {
if (!setupGenerator())
GTEST_SKIP();
LineTable < = Gen->addLineTable();
LT.setCustomPrologue(
{{LineTable::Half, LineTable::Long}, {Version, LineTable::Half}});
generate();
EXPECT_THAT_EXPECTED(
getOrParseLineTableFatalErrors(),
FailedWithMessage("parsing line table prologue at offset 0x00000000: "
"unsupported version " +
std::to_string(Version)));
}
INSTANTIATE_TEST_SUITE_P(UnsupportedVersionTestParams,
DebugLineUnsupportedVersionFixture,
Values(/*1 below min */ 1, /* 1 above max */ 6,
/* Maximum possible */ 0xffff));
#ifdef NO_SUPPORT_DEBUG_ADDR
TEST_F(DebugLineBasicFixture, DISABLED_ErrorForInvalidV5IncludeDirTable) {
#else
TEST_F(DebugLineBasicFixture, ErrorForInvalidV5IncludeDirTable) {
#endif
if (!setupGenerator(5))
GTEST_SKIP();
LineTable < = Gen->addLineTable();
LT.setCustomPrologue({
{19, LineTable::Long}, // unit length
{5, LineTable::Half}, // version
{8, LineTable::Byte}, // addr size
{0, LineTable::Byte}, // segment selector size
{11, LineTable::Long}, // prologue length
{1, LineTable::Byte}, // min instruction length
{1, LineTable::Byte}, // max ops per instruction
{1, LineTable::Byte}, // default is_stmt
{0, LineTable::Byte}, // line base
{14, LineTable::Byte}, // line range
{2, LineTable::Byte}, // opcode base (small to reduce the amount of
// setup required).
{0, LineTable::Byte}, // standard opcode lengths
{0, LineTable::Byte}, // directory entry format count (should not be
// zero).
{0, LineTable::ULEB}, // directories count
{0, LineTable::Byte}, // file name entry format count
{0, LineTable::ULEB} // file name entry count
});
generate();
auto ExpectedLineTable = Line.getOrParseLineTable(LineData, 0, *Context,
nullptr, RecordRecoverable);
EXPECT_THAT_EXPECTED(ExpectedLineTable, Succeeded());
EXPECT_THAT_ERROR(
std::move(Recoverable),
FailedWithMessage(
"parsing line table prologue at 0x00000000 found an invalid "
"directory or file table description at 0x00000014",
"failed to parse entry content descriptions because no path was "
"found"));
}
#ifdef NO_SUPPORT_DEBUG_ADDR
TEST_P(DebugLineParameterisedFixture, DISABLED_ErrorForTooLargePrologueLength) {
#else
TEST_P(DebugLineParameterisedFixture, ErrorForTooLargePrologueLength) {
#endif
if (!setupGenerator(Version))
GTEST_SKIP();
SCOPED_TRACE("Checking Version " + std::to_string(Version) + ", Format " +
(Format == DWARF64 ? "DWARF64" : "DWARF32"));
LineTable < = Gen->addLineTable(Format);
DWARFDebugLine::Prologue Prologue = LT.createBasicPrologue();
++Prologue.PrologueLength;
LT.setPrologue(Prologue);
generate();
auto ExpectedLineTable = Line.getOrParseLineTable(LineData, 0, *Context,
nullptr, RecordRecoverable);
ASSERT_THAT_EXPECTED(ExpectedLineTable, Succeeded());
DWARFDebugLine::LineTable Result(**ExpectedLineTable);
// Undo the earlier modification so that it can be compared against a
// "default" prologue.
--Result.Prologue.PrologueLength;
checkDefaultPrologue(Version, Format, Result.Prologue, 0);
uint64_t ExpectedEnd =
Prologue.TotalLength + 1 + Prologue.sizeofTotalLength();
EXPECT_THAT_ERROR(
std::move(Recoverable),
FailedWithMessage(
("unknown data in line table prologue at offset 0x00000000: "
"parsing ended (at offset 0x000000" +
Twine::utohexstr(ExpectedEnd - 1) +
") before reaching the prologue end at offset 0x000000" +
Twine::utohexstr(ExpectedEnd))
.str()));
}
#ifdef NO_SUPPORT_DEBUG_ADDR
TEST_P(DebugLineParameterisedFixture, DISABLED_ErrorForTooShortPrologueLength) {
#else
TEST_P(DebugLineParameterisedFixture, ErrorForTooShortPrologueLength) {
#endif
if (!setupGenerator(Version))
GTEST_SKIP();
SCOPED_TRACE("Checking Version " + std::to_string(Version) + ", Format " +
(Format == DWARF64 ? "DWARF64" : "DWARF32"));
LineTable < = Gen->addLineTable(Format);
DWARFDebugLine::Prologue Prologue = LT.createBasicPrologue();
Prologue.PrologueLength -= 2;
LT.setPrologue(Prologue);
generate();
auto ExpectedLineTable = Line.getOrParseLineTable(LineData, 0, *Context,
nullptr, RecordRecoverable);
ASSERT_THAT_EXPECTED(ExpectedLineTable, Succeeded());
DWARFDebugLine::LineTable Result(**ExpectedLineTable);
// Parsing will stop before reading a complete file entry.
ASSERT_EQ(Result.Prologue.IncludeDirectories.size(), 1u);
EXPECT_EQ(toStringRef(Result.Prologue.IncludeDirectories[0]), "a dir");
EXPECT_EQ(Result.Prologue.FileNames.size(), 0u);
// The exact place where the parsing will stop depends on the structure of the
// prologue and the last complete field we are able to read. Before V5 we stop
// before reading the file length. In V5, we stop before the filename.
uint64_t ExpectedEnd = Prologue.TotalLength + Prologue.sizeofTotalLength() -
(Version < 5 ? 2 : 8);
std::vector<std::string> Errs;
Errs.emplace_back(
(Twine("parsing line table prologue at 0x00000000 found an invalid "
"directory or file table description at 0x000000") +
Twine::utohexstr(ExpectedEnd))
.str());
if (Version < 5) {
Errs.emplace_back("file names table was not null terminated before the end "
"of the prologue");
} else {
Errs.emplace_back(
"failed to parse file entry because extracting the form value failed");
}
EXPECT_THAT_ERROR(std::move(Recoverable),
FailedWithMessageArray(testing::ElementsAreArray(Errs)));
}
INSTANTIATE_TEST_SUITE_P(
LineTableTestParams, DebugLineParameterisedFixture,
Values(std::make_pair(
2, DWARF32), // Test lower-bound of v2-3 fields and DWARF32.
std::make_pair(3, DWARF32), // Test upper-bound of v2-3 fields.
std::make_pair(4, DWARF64), // Test v4 fields and DWARF64.
std::make_pair(5, DWARF32), std::make_pair(5, DWARF64)));
TEST_F(DebugLineBasicFixture, ErrorForExtendedOpcodeLengthSmallerThanExpected) {
if (!setupGenerator())
GTEST_SKIP();
LineTable < = Gen->addLineTable();
LT.addByte(0xaa);
// The Length should be 1 + sizeof(ULEB) for a set discriminator opcode.
// The operand will be read for both the discriminator opcode and then parsed
// again as DW_LNS_negate_stmt, to respect the claimed length.
LT.addExtendedOpcode(1, DW_LNE_set_discriminator,
{{DW_LNS_negate_stmt, LineTable::ULEB}});
LT.addByte(0xbb);
LT.addStandardOpcode(DW_LNS_const_add_pc, {});
LT.addExtendedOpcode(1, DW_LNE_end_sequence, {});
generate();
auto ExpectedLineTable = Line.getOrParseLineTable(LineData, 0, *Context,
nullptr, RecordRecoverable);
EXPECT_THAT_ERROR(std::move(Recoverable),
FailedWithMessage("unexpected line op length at offset "
"0x00000031 expected 0x01 found 0x02"));
ASSERT_THAT_EXPECTED(ExpectedLineTable, Succeeded());
ASSERT_EQ((*ExpectedLineTable)->Rows.size(), 3u);
EXPECT_EQ((*ExpectedLineTable)->Sequences.size(), 1u);
EXPECT_EQ((*ExpectedLineTable)->Rows[1].IsStmt, 0u);
EXPECT_EQ((*ExpectedLineTable)->Rows[1].Discriminator, DW_LNS_negate_stmt);
}
TEST_F(DebugLineBasicFixture, ErrorForExtendedOpcodeLengthLargerThanExpected) {
if (!setupGenerator())
GTEST_SKIP();
LineTable < = Gen->addLineTable();
LT.addByte(0xaa);
LT.addStandardOpcode(DW_LNS_const_add_pc, {});
// The Length should be 1 for an end sequence opcode.
LT.addExtendedOpcode(2, DW_LNE_end_sequence, {});
// The negate statement opcode will be skipped.
LT.addStandardOpcode(DW_LNS_negate_stmt, {});
LT.addByte(0xbb);
LT.addStandardOpcode(DW_LNS_const_add_pc, {});
LT.addExtendedOpcode(1, DW_LNE_end_sequence, {});
generate();
auto ExpectedLineTable = Line.getOrParseLineTable(LineData, 0, *Context,
nullptr, RecordRecoverable);
EXPECT_THAT_ERROR(std::move(Recoverable),
FailedWithMessage("unexpected line op length at offset "
"0x00000032 expected 0x02 found 0x01"));
ASSERT_THAT_EXPECTED(ExpectedLineTable, Succeeded());
ASSERT_EQ((*ExpectedLineTable)->Rows.size(), 4u);
EXPECT_EQ((*ExpectedLineTable)->Sequences.size(), 2u);
ASSERT_EQ((*ExpectedLineTable)->Sequences[1].FirstRowIndex, 2u);
EXPECT_EQ((*ExpectedLineTable)->Rows[2].IsStmt, 1u);
}
TEST_F(DebugLineBasicFixture, ErrorForUnitLengthTooLarge) {
if (!setupGenerator())
GTEST_SKIP();
LineTable &Padding = Gen->addLineTable();
// Add some padding to show that a non-zero offset is handled correctly.
Padding.setCustomPrologue({{0, LineTable::Byte}});
LineTable < = Gen->addLineTable();
LT.addStandardOpcode(DW_LNS_copy, {});
LT.addStandardOpcode(DW_LNS_const_add_pc, {});
LT.addExtendedOpcode(1, DW_LNE_end_sequence, {});
DWARFDebugLine::Prologue Prologue = LT.createBasicPrologue();
// Set the total length to 1 higher than the actual length.
++Prologue.TotalLength;
LT.setPrologue(Prologue);
generate();
auto ExpectedLineTable = Line.getOrParseLineTable(LineData, 1, *Context,
nullptr, RecordRecoverable);
EXPECT_THAT_ERROR(
std::move(Recoverable),
FailedWithMessage("line table program with offset 0x00000001 has length "
"0x00000034 but only 0x00000033 bytes are available"));
ASSERT_THAT_EXPECTED(ExpectedLineTable, Succeeded());
EXPECT_EQ((*ExpectedLineTable)->Rows.size(), 2u);
EXPECT_EQ((*ExpectedLineTable)->Sequences.size(), 1u);
}
TEST_F(DebugLineBasicFixture, ErrorForMismatchedAddressSize) {
if (!setupGenerator(4, 8))
GTEST_SKIP();
LineTable < = Gen->addLineTable();
// The line data extractor expects size 8 (Quad) addresses.
uint64_t Addr1 = 0x11223344;
LT.addExtendedOpcode(5, DW_LNE_set_address, {{Addr1, LineTable::Long}});
LT.addStandardOpcode(DW_LNS_copy, {});
// Show that the expected address size is unchanged, so later valid lines
// don't cause a problem.
uint64_t Addr2 = 0x1122334455667788;
LT.addExtendedOpcode(9, DW_LNE_set_address, {{Addr2, LineTable::Quad}});
LT.addExtendedOpcode(1, DW_LNE_end_sequence, {});
generate();
auto ExpectedLineTable = Line.getOrParseLineTable(LineData, 0, *Context,
nullptr, RecordRecoverable);
EXPECT_THAT_ERROR(std::move(Recoverable),
FailedWithMessage("mismatching address size at offset "
"0x00000030 expected 0x08 found 0x04"));
ASSERT_THAT_EXPECTED(ExpectedLineTable, Succeeded());
ASSERT_EQ((*ExpectedLineTable)->Rows.size(), 2u);
EXPECT_EQ((*ExpectedLineTable)->Sequences.size(), 1u);
EXPECT_EQ((*ExpectedLineTable)->Rows[0].Address.Address, Addr1);
EXPECT_EQ((*ExpectedLineTable)->Rows[1].Address.Address, Addr2);
}
TEST_F(DebugLineBasicFixture,
ErrorForMismatchedAddressSizeUnsetInitialAddress) {
if (!setupGenerator(4, 0))
GTEST_SKIP();
LineTable < = Gen->addLineTable();
uint64_t Addr1 = 0x11223344;
LT.addExtendedOpcode(5, DW_LNE_set_address, {{Addr1, LineTable::Long}});
LT.addStandardOpcode(DW_LNS_copy, {});
uint64_t Addr2 = 0x1122334455667788;
LT.addExtendedOpcode(9, DW_LNE_set_address, {{Addr2, LineTable::Quad}});
LT.addExtendedOpcode(1, DW_LNE_end_sequence, {});
generate();
auto ExpectedLineTable = Line.getOrParseLineTable(LineData, 0, *Context,
nullptr, RecordRecoverable);
EXPECT_THAT_ERROR(std::move(Recoverable),
FailedWithMessage("mismatching address size at offset "
"0x00000038 expected 0x04 found 0x08"));
ASSERT_THAT_EXPECTED(ExpectedLineTable, Succeeded());
ASSERT_EQ((*ExpectedLineTable)->Rows.size(), 2u);
EXPECT_EQ((*ExpectedLineTable)->Sequences.size(), 1u);
EXPECT_EQ((*ExpectedLineTable)->Rows[0].Address.Address, Addr1);
EXPECT_EQ((*ExpectedLineTable)->Rows[1].Address.Address, Addr2);
}
TEST_F(DebugLineBasicFixture,
ErrorForUnsupportedAddressSizeInSetAddressLength) {
// Use DWARF v4, and 0 for data extractor address size so that the address
// size is derived from the opcode length.
if (!setupGenerator(4, 0))
GTEST_SKIP();
LineTable < = Gen->addLineTable();
// 4 == length of the extended opcode, i.e. 1 for the opcode itself and 3 for
// the Half (2) + Byte (1) operand, representing the unsupported address size.
LT.addExtendedOpcode(4, DW_LNE_set_address,
{{0x1234, LineTable::Half}, {0x56, LineTable::Byte}});
LT.addStandardOpcode(DW_LNS_copy, {});
// Special opcode to ensure the address has changed between the first and last
// row in the sequence. Without this, the sequence will not be recorded.
LT.addByte(0xaa);
LT.addExtendedOpcode(1, DW_LNE_end_sequence, {});
generate();
auto ExpectedLineTable = Line.getOrParseLineTable(LineData, 0, *Context,
nullptr, RecordRecoverable);
EXPECT_THAT_ERROR(
std::move(Recoverable),
FailedWithMessage("address size 0x03 of DW_LNE_set_address opcode at "
"offset 0x00000030 is unsupported"));
ASSERT_THAT_EXPECTED(ExpectedLineTable, Succeeded());
ASSERT_EQ((*ExpectedLineTable)->Rows.size(), 3u);
EXPECT_EQ((*ExpectedLineTable)->Sequences.size(), 1u);
// Show that the set address opcode is ignored in this case.
EXPECT_EQ((*ExpectedLineTable)->Rows[0].Address.Address, 0u);
}
TEST_F(DebugLineBasicFixture, ErrorForAddressSizeGreaterThanByteSize) {
// Use DWARF v4, and 0 for data extractor address size so that the address
// size is derived from the opcode length.
if (!setupGenerator(4, 0))
GTEST_SKIP();
LineTable < = Gen->addLineTable();
// Specifically use an operand size that has a trailing byte of a supported
// size (8), so that any potential truncation would result in a valid size.
std::vector<LineTable::ValueAndLength> Operands(0x108);
LT.addExtendedOpcode(Operands.size() + 1, DW_LNE_set_address, Operands);
LT.addExtendedOpcode(1, DW_LNE_end_sequence, {});
generate();
auto ExpectedLineTable = Line.getOrParseLineTable(LineData, 0, *Context,
nullptr, RecordRecoverable);
EXPECT_THAT_ERROR(
std::move(Recoverable),
FailedWithMessage("address size 0x108 of DW_LNE_set_address opcode at "
"offset 0x00000031 is unsupported"));
ASSERT_THAT_EXPECTED(ExpectedLineTable, Succeeded());
}
#ifdef NO_SUPPORT_DEBUG_ADDR
TEST_F(DebugLineBasicFixture,
DISABLED_ErrorForUnsupportedAddressSizeDefinedInHeader) {
#else
TEST_F(DebugLineBasicFixture, ErrorForUnsupportedAddressSizeDefinedInHeader) {
#endif
// Use 0 for data extractor address size so that it does not clash with the
// header address size.
if (!setupGenerator(5, 0))
GTEST_SKIP();
LineTable < = Gen->addLineTable();
// AddressSize + 1 == length of the extended opcode, i.e. 1 for the opcode
// itself and 9 for the Quad (8) + Byte (1) operand representing the
// unsupported address size.
uint8_t AddressSize = 9;
LT.addExtendedOpcode(AddressSize + 1, DW_LNE_set_address,
{{0x12345678, LineTable::Quad}, {0, LineTable::Byte}});
LT.addStandardOpcode(DW_LNS_copy, {});
// Special opcode to ensure the address has changed between the first and last
// row in the sequence. Without this, the sequence will not be recorded.
LT.addByte(0xaa);
LT.addExtendedOpcode(1, DW_LNE_end_sequence, {});
DWARFDebugLine::Prologue Prologue = LT.createBasicPrologue();
Prologue.FormParams.AddrSize = AddressSize;
LT.setPrologue(Prologue);
generate();
auto ExpectedLineTable = Line.getOrParseLineTable(LineData, 0, *Context,
nullptr, RecordRecoverable);
EXPECT_THAT_ERROR(
std::move(Recoverable),
FailedWithMessage("parsing line table prologue at offset 0x00000000: "
"invalid address size 9",
"address size 0x09 of DW_LNE_set_address opcode at "
"offset 0x00000038 is unsupported"));
ASSERT_THAT_EXPECTED(ExpectedLineTable, Succeeded());
ASSERT_EQ((*ExpectedLineTable)->Rows.size(), 3u);
EXPECT_EQ((*ExpectedLineTable)->Sequences.size(), 1u);
// Show that the set address opcode is ignored in this case.
EXPECT_EQ((*ExpectedLineTable)->Rows[0].Address.Address, 0u);
}
TEST_F(DebugLineBasicFixture, CallbackUsedForUnterminatedSequence) {
if (!setupGenerator())
GTEST_SKIP();
LineTable < = Gen->addLineTable();
LT.addExtendedOpcode(9, DW_LNE_set_address,
{{0x1122334455667788, LineTable::Quad}});
LT.addStandardOpcode(DW_LNS_copy, {});
LT.addByte(0xaa);
LT.addExtendedOpcode(1, DW_LNE_end_sequence, {});
LT.addExtendedOpcode(9, DW_LNE_set_address,
{{0x99aabbccddeeff00, LineTable::Quad}});
LT.addStandardOpcode(DW_LNS_copy, {});
LT.addByte(0xbb);
LT.addByte(0xcc);
generate();
auto ExpectedLineTable = Line.getOrParseLineTable(LineData, 0, *Context,
nullptr, RecordRecoverable);
EXPECT_THAT_ERROR(std::move(Recoverable),
FailedWithMessage("last sequence in debug line table at "
"offset 0x00000000 is not terminated"));
ASSERT_THAT_EXPECTED(ExpectedLineTable, Succeeded());
EXPECT_EQ((*ExpectedLineTable)->Rows.size(), 6u);
// The unterminated sequence is not added to the sequence list.
EXPECT_EQ((*ExpectedLineTable)->Sequences.size(), 1u);
}
struct AdjustAddressFixtureBase : public CommonFixture {
virtual ~AdjustAddressFixtureBase() {}
// Create and update the prologue as specified by the subclass, then return
// the length of the table.
virtual uint64_t editPrologue(LineTable <) = 0;
virtual uint64_t getAdjustedAddr(uint64_t Base, uint64_t ConstIncrs,
uint64_t SpecialIncrs,
uint64_t AdvanceIncrs) {
return Base + ConstIncrs + SpecialIncrs + AdvanceIncrs;
}
virtual uint64_t getAdjustedLine(uint64_t Base, uint64_t Incr) {
return Base + Incr;
}
uint64_t setupNoProblemTable() {
LineTable &NoProblem = Gen->addLineTable();
NoProblem.addExtendedOpcode(9, DW_LNE_set_address,
{{0xabcd, LineTable::Quad}});
NoProblem.addExtendedOpcode(1, DW_LNE_end_sequence, {});
return editPrologue(NoProblem);
}
uint64_t setupConstAddPcFirstTable() {
LineTable &ConstAddPCFirst = Gen->addLineTable();
ConstAddPCFirst.addExtendedOpcode(9, DW_LNE_set_address,
{{ConstAddPCAddr, LineTable::Quad}});
ConstAddPCFirst.addStandardOpcode(DW_LNS_const_add_pc, {});
ConstAddPCFirst.addStandardOpcode(DW_LNS_const_add_pc, {});
ConstAddPCFirst.addStandardOpcode(DW_LNS_advance_pc,
{{0x10, LineTable::ULEB}});
ConstAddPCFirst.addByte(0x21); // Special opcode, +1 op, +1 line.
ConstAddPCFirst.addExtendedOpcode(1, DW_LNE_end_sequence, {});
return editPrologue(ConstAddPCFirst);
}
uint64_t setupSpecialFirstTable() {
LineTable &SpecialFirst = Gen->addLineTable();
SpecialFirst.addExtendedOpcode(9, DW_LNE_set_address,
{{SpecialAddr, LineTable::Quad}});
SpecialFirst.addByte(0x22); // Special opcode, +1 op, +2 line.
SpecialFirst.addStandardOpcode(DW_LNS_const_add_pc, {});
SpecialFirst.addStandardOpcode(DW_LNS_advance_pc,
{{0x20, LineTable::ULEB}});
SpecialFirst.addByte(0x23); // Special opcode, +1 op, +3 line.
SpecialFirst.addExtendedOpcode(1, DW_LNE_end_sequence, {});
return editPrologue(SpecialFirst);
}
uint64_t setupAdvancePcFirstTable() {
LineTable &AdvancePCFirst = Gen->addLineTable();
AdvancePCFirst.addExtendedOpcode(9, DW_LNE_set_address,
{{AdvancePCAddr, LineTable::Quad}});
AdvancePCFirst.addStandardOpcode(DW_LNS_advance_pc,
{{0x30, LineTable::ULEB}});
AdvancePCFirst.addStandardOpcode(DW_LNS_const_add_pc, {});
AdvancePCFirst.addStandardOpcode(DW_LNS_advance_pc,
{{0x40, LineTable::ULEB}});
AdvancePCFirst.addByte(0x24); // Special opcode, +1 op, +4 line.
AdvancePCFirst.addExtendedOpcode(1, DW_LNE_end_sequence, {});
return editPrologue(AdvancePCFirst);
}
void setupTables(bool AddAdvancePCFirstTable) {
LineTable &Padding = Gen->addLineTable();
Padding.setCustomPrologue({{0, LineTable::Byte}});
NoProblemOffset = 1;
// Show that no warning is generated for the case where no
// DW_LNS_const_add_pc or special opcode is used.
ConstAddPCOffset = setupNoProblemTable() + NoProblemOffset;
// Show that the warning is emitted for the first DW_LNS_const_add_pc opcode
// and then not again.
SpecialOffset = setupConstAddPcFirstTable() + ConstAddPCOffset;
// Show that the warning is emitted for the first special opcode and then
// not again.
AdvancePCOffset = setupSpecialFirstTable() + SpecialOffset;
// Show that the warning is emitted for the first DW_LNS_advance_pc opcode
// (if requested) and then not again.
if (AddAdvancePCFirstTable)
setupAdvancePcFirstTable();
}
Expected<const DWARFDebugLine::LineTable *>
checkTable(uint64_t Offset, StringRef OpcodeType, const Twine &MsgSuffix) {
auto ExpectedTable = Line.getOrParseLineTable(LineData, Offset, *Context,
nullptr, RecordRecoverable);
EXPECT_THAT_ERROR(std::move(Unrecoverable), Succeeded());
if (!IsErrorExpected) {
EXPECT_THAT_ERROR(std::move(Recoverable), Succeeded());
} else {
if (!ExpectedTable)
return ExpectedTable;
uint64_t ExpectedOffset = Offset +
(*ExpectedTable)->Prologue.getLength() +
11; // 11 == size of DW_LNE_set_address.
std::string OffsetHex = Twine::utohexstr(Offset).str();
std::string OffsetZeroes = std::string(8 - OffsetHex.size(), '0');
std::string ExpectedHex = Twine::utohexstr(ExpectedOffset).str();
std::string ExpectedZeroes = std::string(8 - ExpectedHex.size(), '0');
EXPECT_THAT_ERROR(
std::move(Recoverable),
FailedWithMessage(("line table program at offset 0x" + OffsetZeroes +
OffsetHex + " contains a " + OpcodeType +
" opcode at offset 0x" + ExpectedZeroes +
ExpectedHex + ", " + MsgSuffix)
.str()));
}
return ExpectedTable;
}
void runTest(bool CheckAdvancePC, Twine MsgSuffix) {
if (!setupGenerator(Version))
GTEST_SKIP();
setupTables(/*AddAdvancePCFirstTable=*/CheckAdvancePC);
generate();
auto ExpectedNoProblem = Line.getOrParseLineTable(
LineData, NoProblemOffset, *Context, nullptr, RecordRecoverable);
EXPECT_THAT_ERROR(std::move(Recoverable), Succeeded());
EXPECT_THAT_ERROR(std::move(Unrecoverable), Succeeded());
ASSERT_THAT_EXPECTED(ExpectedNoProblem, Succeeded());
auto ExpectedConstAddPC =
checkTable(ConstAddPCOffset, "DW_LNS_const_add_pc", MsgSuffix);
ASSERT_THAT_EXPECTED(ExpectedConstAddPC, Succeeded());
ASSERT_EQ((*ExpectedConstAddPC)->Rows.size(), 2u);
EXPECT_EQ((*ExpectedConstAddPC)->Rows[0].Address.Address,