Skip to content

Duplicate function names in grcov reports - #1534

Open
bringhurst wants to merge 2 commits into
mozilla:masterfrom
bringhurst:bringhurst/lcov-full-signatures
Open

bringhurst wants to merge 2 commits into
mozilla:masterfrom
bringhurst:bringhurst/lcov-full-signatures

Conversation

@bringhurst

Copy link
Copy Markdown

grcov can give two different C++ functions the same name in an LCOV report. The demangler drops the argument list, so overloads such as f(int) and f(int, int) both become f:

FN:10,f
FN:20,f
FNDA:1,f
FNDA:0,f

When another pass reads that report, it warns that FN 'f' is duplicated and counts one function instead of two.

So, this PR changes it to keep the full signature. The same example would then look like this:

FN:10,f(int)
FN:20,f(int, int)
FNDA:1,f(int)
FNDA:0,f(int, int)

Name-only demangling maps C++ overloads to the same LCOV name.
Reading the report back merges their coverage.

Keep full signatures in FN and FNDA records. Add a round-trip test
for parameter and const overloads, with and without demangling.
Use template methods to cover commas in template arguments.

Export and read the report a second time to check that already-demangled
names keep their coverage. Test both with and without demangling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant