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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/common/dwarf_cu_to_module.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/common/dwarf_cu_to_module_unittest.cc
diff --git a/src/common/dwarf_cu_to_module_unittest.cc b/src/common/dwarf_cu_to_module_unittest.cc
index 0ae73e8167946487711c4b3b760112e3faa2ad51..619e90a2ee5b95e0d2159de001e9b7338b2d6630 100644
--- a/src/common/dwarf_cu_to_module_unittest.cc
+++ b/src/common/dwarf_cu_to_module_unittest.cc
@@ -1323,6 +1323,29 @@ TEST_F(Specifications, InlineFunction) {
0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
}
+// An inline function in a namespace should correctly derive its
+// name from its abstract origin, and not just the namespace name.
+TEST_F(Specifications, InlineFunctionInNamespace) {
+ PushLine(0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL, "line-file", 75173118);
+
+ StartCU();
+ DIEHandler* space_handler
+ = StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_namespace,
+ "Namespace");
+ ASSERT_TRUE(space_handler != NULL);
+ AbstractInstanceDIE(space_handler, 0x1e8dac5d507ed7abULL,
+ dwarf2reader::DW_INL_inlined, 0LL, "func-name");
+ DefineInlineInstanceDIE(space_handler, "", 0x1e8dac5d507ed7abULL,
+ 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
+ space_handler->Finish();
+ delete space_handler;
+ root_handler_.Finish();
+
+ TestFunctionCount(1);
+ TestFunction(0, "Namespace::func-name",
+ 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
+}
+
// Check name construction for a long chain containing each combination of:
// - struct, union, class, namespace
// - direct and definition
« 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