diff options
author | thestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-07-13 18:14:27 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-07-13 18:14:27 +0000 |
commit | 0dd6c95b3fcf0bef0a473901e47eb4c23fb30f5b (patch) | |
tree | 17afa3fb7d89d3edfccbaf8beff9b282c98efb73 /src/common/stabs_to_module_unittest.cc | |
parent | Fix a couple of tiny things for GCC pedantry (diff) | |
download | breakpad-0dd6c95b3fcf0bef0a473901e47eb4c23fb30f5b.tar.xz |
Remove duplicate FUNC entries from dump_syms output.
Review URL: http://breakpad.appspot.com/128001
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@623 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/stabs_to_module_unittest.cc')
-rw-r--r-- | src/common/stabs_to_module_unittest.cc | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/common/stabs_to_module_unittest.cc b/src/common/stabs_to_module_unittest.cc index 4248b3c0..2c432a3e 100644 --- a/src/common/stabs_to_module_unittest.cc +++ b/src/common/stabs_to_module_unittest.cc @@ -74,6 +74,38 @@ TEST(StabsToModule, SimpleCU) { EXPECT_EQ(174823314, line->number); } +TEST(StabsToModule, DuplicateFunctionNames) { + Module m("name", "os", "arch", "id"); + StabsToModule h(&m); + + // Compilation unit with one function, mangled name. + EXPECT_TRUE(h.StartCompilationUnit("compilation-unit", 0xf2cfda36ecf7f46cLL, + "build-directory")); + EXPECT_TRUE(h.StartFunction("funcfoo", + 0xf2cfda36ecf7f46dLL)); + EXPECT_TRUE(h.EndFunction(0)); + EXPECT_TRUE(h.StartFunction("funcfoo", + 0xf2cfda36ecf7f46dLL)); + EXPECT_TRUE(h.EndFunction(0)); + EXPECT_TRUE(h.EndCompilationUnit(0)); + + h.Finalize(); + + // Now check to see what has been added to the Module. + Module::File *file = m.FindExistingFile("compilation-unit"); + ASSERT_TRUE(file != NULL); + + vector<Module::Function *> functions; + m.GetFunctions(&functions, functions.end()); + ASSERT_EQ(1U, functions.size()); + + Module::Function *function = functions[0]; + EXPECT_EQ(0xf2cfda36ecf7f46dLL, function->address); + EXPECT_LT(0U, function->size); // should have used dummy size + EXPECT_EQ(0U, function->parameter_size); + ASSERT_EQ(0U, function->lines.size()); +} + TEST(InferSizes, LineSize) { Module m("name", "os", "arch", "id"); StabsToModule h(&m); @@ -88,7 +120,7 @@ TEST(InferSizes, LineSize) { EXPECT_TRUE(h.EndFunction(0)); // unknown function end address EXPECT_TRUE(h.EndCompilationUnit(0)); // unknown CU end address EXPECT_TRUE(h.StartCompilationUnit("compilation-unit-2", 0xb4523963eff94e92LL, - "build-directory-2")); // next boundary + "build-directory-2")); // next boundary EXPECT_TRUE(h.EndCompilationUnit(0)); h.Finalize(); |