Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate C++ ctor/dtor entries with --demangle. #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

calin-iorgulescu
Copy link

Under certain circumstances, gcc seems to emit multiple symbols for ctors and dtors. This seems to be in adherence with the specification of the Itanium C++ ABI. A pretty good description of the issue can be found here .

However, c++filt generates the same demangled names for these symbols. Apparently, this was not always the case. Since demangling is currently done after reading the lcov files, this results in duplicate entries in the output XML file.

According to the Cobertura DTD, each class should only have a single method entry. This can lead to issues with certain parsers. For example, the Jenkins Coverage plugin will not accept XML files with duplicate method entries for the same class.

This PR resolves the issue by applying the demangling operation when the function hit data is stored, and summing the hit counts as needed.

* Fixes an issue where duplicate ctor/dtor functions are demangled to the
  same name, creating duplicate function entries.
@dieram3
Copy link

dieram3 commented Aug 27, 2024

Thanks for digging that out! I was wondering why the new coverage Jenkins plugin has the java.lang. IllegalArgumentException: There is already the same child [METHOD] foo::~foo() error.

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.

2 participants