Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 399823

Summary: Add support to demangle C++ names created by compilers not auto-appending underscore before every symbol name
Product: [Tools] Linux Tools Reporter: Tamas Kleiber <kleiber.tamas>
Component: GCovAssignee: Xavier Raynaud <xraynaud>
Status: RESOLVED FIXED QA Contact: Xavier Raynaud <xraynaud>
Severity: enhancement    
Priority: P3 CC: akurtakov, kleiber.tamas, lilia.ghachem
Version: unspecified   
Target Milestone: 2.0   
Hardware: PC   
OS: Windows All   
Whiteboard:

Description Tamas Kleiber CLA 2013-02-03 15:08:34 EST
Excerpt from c++filt's man page:

--strip-underscore: On some systems, both the C and C ++ compilers put an underscore in front of every name. For example, the C name "foo" gets the low-level name "_foo". This option removes the initial underscore. Whether c++filt removes the underscore by default is target dependent. 

--no-strip-underscore: Do not remove the initial underscore.



Only the "--strip-underscore" variant is supported by the Linux Tools GCov Integration plug-in.

Examples:
[CODE]
c++filt --strip-underscore  __ZNSo9_M_insertIeEERSoT_
std::basic_ostream<char, std::char_traits<char> >& std::basic_ostream<char, std:
:char_traits<char> >::_M_insert<long double>(long double)


c++filt --no-strip-underscore _ZN7testing8internal15TestFactoryImplI28VER_Test_FieldFetchTest_TestE10CreateTestEv
testing::internal::TestFactoryImpl<VER_Test_FieldFetchTest_Test>::CreateTest()
[/CODE]

Please add C++ demangling support for both compiler variants. If --strip-underscore fails try to demangle with --no-strip-underscore option.
Comment 1 Tamas Kleiber CLA 2013-02-03 15:09:44 EST
See http://www.eclipse.org/forums/index.php/t/449525/ for further details.
Comment 2 Xavier Raynaud CLA 2013-04-24 07:04:54 EDT
fix proposal here: https://git.eclipse.org/r/12149
Comment 3 Tamas Kleiber CLA 2013-04-24 14:48:30 EDT
Hello Xavier,

 I've tested the fix proposal and with the new preferences window the desired mode can be configured with the c++filt flags and in the summary output I can see the properly demangled names for my compiler. So for me, the fix is working.

Thanks for your effort!
Comment 4 Tamas Kleiber CLA 2013-04-25 02:18:25 EDT
One thing I noticed is that on my dev PC, I cannot deploy the gcov plug-in. I checked out refs/changes/49/12149/1/FETCH_HEAD and can build and run it is successfully. But when I try to export the gcov feature as a deploy-able plug-in, I get a circular reference error from eclipse.

Could you please check whether it is possible to deploy this revision?
Comment 5 Xavier Raynaud CLA 2013-05-02 10:27:44 EDT
patch integrated in master.
I mark the bug as resolved.

Tamas: It does not fix the circular reference error (In fact, I have not yet reproduced this error).
Comment 6 Tamas Kleiber CLA 2013-05-02 15:49:35 EDT
If its only occurring for me than its not important. Just for reference, I get this error message (even with latest master checked out):

A cycle was detected when generating the classpath org.eclipse.linuxtools.gcov.launch_1.0.0.201305022144, org.eclipse.linuxtools.gcov.core_5.0.0.201305022144, org.eclipse.linuxtools.gcov.launch_1.0.0.201305022144.


But again, its not a big deal as I use release and nightly builds only anyways.

Thanks again for making this change set.