Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(676)

Side by Side Diff: src/common/dwarf_cu_to_module_unittest.cc

Issue 1887033002: Fix DWARF handling of inlined functions in namespaces (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/common/dwarf_cu_to_module.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 Google Inc. 1 // Copyright (c) 2010 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 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 dwarf2reader::DW_INL_inlined, 0xcd3c51b946fb1eeeLL, ""); 1316 dwarf2reader::DW_INL_inlined, 0xcd3c51b946fb1eeeLL, "");
1317 DefineInlineInstanceDIE(&root_handler_, "", 0x1e8dac5d507ed7abULL, 1317 DefineInlineInstanceDIE(&root_handler_, "", 0x1e8dac5d507ed7abULL,
1318 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL); 1318 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
1319 root_handler_.Finish(); 1319 root_handler_.Finish();
1320 1320
1321 TestFunctionCount(1); 1321 TestFunctionCount(1);
1322 TestFunction(0, "inline-name", 1322 TestFunction(0, "inline-name",
1323 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL); 1323 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
1324 } 1324 }
1325 1325
1326 // An inline function in a namespace should correctly derive its
1327 // name from its abstract origin, and not just the namespace name.
1328 TEST_F(Specifications, InlineFunctionInNamespace) {
1329 PushLine(0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL, "line-file", 75173118);
1330
1331 StartCU();
1332 DIEHandler* space_handler
1333 = StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_namespace,
1334 "Namespace");
1335 ASSERT_TRUE(space_handler != NULL);
1336 AbstractInstanceDIE(space_handler, 0x1e8dac5d507ed7abULL,
1337 dwarf2reader::DW_INL_inlined, 0LL, "func-name");
1338 DefineInlineInstanceDIE(space_handler, "", 0x1e8dac5d507ed7abULL,
1339 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
1340 space_handler->Finish();
1341 delete space_handler;
1342 root_handler_.Finish();
1343
1344 TestFunctionCount(1);
1345 TestFunction(0, "Namespace::func-name",
1346 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
1347 }
1348
1326 // Check name construction for a long chain containing each combination of: 1349 // Check name construction for a long chain containing each combination of:
1327 // - struct, union, class, namespace 1350 // - struct, union, class, namespace
1328 // - direct and definition 1351 // - direct and definition
1329 TEST_F(Specifications, LongChain) { 1352 TEST_F(Specifications, LongChain) {
1330 PushLine(0x5a0dd6bb85db754cULL, 0x3bccb213d08c7fd3ULL, "line-file", 21192926); 1353 PushLine(0x5a0dd6bb85db754cULL, 0x3bccb213d08c7fd3ULL, "line-file", 21192926);
1331 SetLanguage(dwarf2reader::DW_LANG_C_plus_plus); 1354 SetLanguage(dwarf2reader::DW_LANG_C_plus_plus);
1332 1355
1333 StartCU(); 1356 StartCU();
1334 // The structure we're building here is: 1357 // The structure we're building here is:
1335 // space_A full definition 1358 // space_A full definition
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 reporter.UncoveredLine(line); 1795 reporter.UncoveredLine(line);
1773 EXPECT_TRUE(reporter.uncovered_warnings_enabled()); 1796 EXPECT_TRUE(reporter.uncovered_warnings_enabled());
1774 } 1797 }
1775 1798
1776 TEST_F(Reporter, UnnamedFunction) { 1799 TEST_F(Reporter, UnnamedFunction) {
1777 reporter.UnnamedFunction(0x90c0baff9dedb2d9ULL); 1800 reporter.UnnamedFunction(0x90c0baff9dedb2d9ULL);
1778 } 1801 }
1779 1802
1780 // Would be nice to also test: 1803 // Would be nice to also test:
1781 // - overlapping lines, functions 1804 // - overlapping lines, functions
OLDNEW
« no previous file with comments | « src/common/dwarf_cu_to_module.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698