OLD | NEW |
1 // Copyright (c) 2012, Google Inc. | 1 // Copyright (c) 2012, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 EXPECT_CALL(handler, ProcessAttributeString(_, dwarf2reader::DW_AT_name, | 192 EXPECT_CALL(handler, ProcessAttributeString(_, dwarf2reader::DW_AT_name, |
193 dwarf2reader::DW_FORM_string, | 193 dwarf2reader::DW_FORM_string, |
194 "sam")) | 194 "sam")) |
195 .WillOnce(Return()); | 195 .WillOnce(Return()); |
196 EXPECT_CALL(handler, EndDIE(_)) | 196 EXPECT_CALL(handler, EndDIE(_)) |
197 .WillOnce(Return()); | 197 .WillOnce(Return()); |
198 } | 198 } |
199 | 199 |
200 ByteReader byte_reader(GetParam().endianness == kLittleEndian ? | 200 ByteReader byte_reader(GetParam().endianness == kLittleEndian ? |
201 ENDIANNESS_LITTLE : ENDIANNESS_BIG); | 201 ENDIANNESS_LITTLE : ENDIANNESS_BIG); |
202 CompilationUnit parser(MakeSectionMap(), 0, &byte_reader, &handler); | 202 CompilationUnit parser("", MakeSectionMap(), 0, &byte_reader, &handler); |
203 EXPECT_EQ(parser.Start(), info_contents.size()); | 203 EXPECT_EQ(parser.Start(), info_contents.size()); |
204 } | 204 } |
205 | 205 |
206 INSTANTIATE_TEST_CASE_P( | 206 INSTANTIATE_TEST_CASE_P( |
207 HeaderVariants, DwarfHeader, | 207 HeaderVariants, DwarfHeader, |
208 ::testing::Values(DwarfHeaderParams(kLittleEndian, 4, 2, 4), | 208 ::testing::Values(DwarfHeaderParams(kLittleEndian, 4, 2, 4), |
209 DwarfHeaderParams(kLittleEndian, 4, 2, 8), | 209 DwarfHeaderParams(kLittleEndian, 4, 2, 8), |
210 DwarfHeaderParams(kLittleEndian, 4, 3, 4), | 210 DwarfHeaderParams(kLittleEndian, 4, 3, 4), |
211 DwarfHeaderParams(kLittleEndian, 4, 3, 8), | 211 DwarfHeaderParams(kLittleEndian, 4, 3, 8), |
212 DwarfHeaderParams(kLittleEndian, 4, 4, 4), | 212 DwarfHeaderParams(kLittleEndian, 4, 4, 4), |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 270 |
271 void ExpectEndCompilationUnit() { | 271 void ExpectEndCompilationUnit() { |
272 EXPECT_CALL(handler, EndDIE(_)) | 272 EXPECT_CALL(handler, EndDIE(_)) |
273 .InSequence(s) | 273 .InSequence(s) |
274 .WillOnce(Return()); | 274 .WillOnce(Return()); |
275 } | 275 } |
276 | 276 |
277 void ParseCompilationUnit(const DwarfHeaderParams ¶ms, uint64 offset=0) { | 277 void ParseCompilationUnit(const DwarfHeaderParams ¶ms, uint64 offset=0) { |
278 ByteReader byte_reader(params.endianness == kLittleEndian ? | 278 ByteReader byte_reader(params.endianness == kLittleEndian ? |
279 ENDIANNESS_LITTLE : ENDIANNESS_BIG); | 279 ENDIANNESS_LITTLE : ENDIANNESS_BIG); |
280 CompilationUnit parser(MakeSectionMap(), offset, &byte_reader, &handler); | 280 CompilationUnit parser("", MakeSectionMap(), offset, &byte_reader, &handler)
; |
281 EXPECT_EQ(offset + parser.Start(), info_contents.size()); | 281 EXPECT_EQ(offset + parser.Start(), info_contents.size()); |
282 } | 282 } |
283 | 283 |
284 // The sequence to which the fixture's methods append expectations. | 284 // The sequence to which the fixture's methods append expectations. |
285 Sequence s; | 285 Sequence s; |
286 }; | 286 }; |
287 | 287 |
288 struct DwarfForms: public DwarfFormsFixture, | 288 struct DwarfForms: public DwarfFormsFixture, |
289 public TestWithParam<DwarfHeaderParams> { }; | 289 public TestWithParam<DwarfHeaderParams> { }; |
290 | 290 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 DwarfHeaderParams(kBigEndian, 4, 3, 4), | 478 DwarfHeaderParams(kBigEndian, 4, 3, 4), |
479 DwarfHeaderParams(kBigEndian, 4, 3, 8), | 479 DwarfHeaderParams(kBigEndian, 4, 3, 8), |
480 DwarfHeaderParams(kBigEndian, 4, 4, 4), | 480 DwarfHeaderParams(kBigEndian, 4, 4, 4), |
481 DwarfHeaderParams(kBigEndian, 4, 4, 8), | 481 DwarfHeaderParams(kBigEndian, 4, 4, 8), |
482 DwarfHeaderParams(kBigEndian, 8, 2, 4), | 482 DwarfHeaderParams(kBigEndian, 8, 2, 4), |
483 DwarfHeaderParams(kBigEndian, 8, 2, 8), | 483 DwarfHeaderParams(kBigEndian, 8, 2, 8), |
484 DwarfHeaderParams(kBigEndian, 8, 3, 4), | 484 DwarfHeaderParams(kBigEndian, 8, 3, 4), |
485 DwarfHeaderParams(kBigEndian, 8, 3, 8), | 485 DwarfHeaderParams(kBigEndian, 8, 3, 8), |
486 DwarfHeaderParams(kBigEndian, 8, 4, 4), | 486 DwarfHeaderParams(kBigEndian, 8, 4, 4), |
487 DwarfHeaderParams(kBigEndian, 8, 4, 8))); | 487 DwarfHeaderParams(kBigEndian, 8, 4, 8))); |
OLD | NEW |