Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Xcode + gcov *.da file name mangling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Xcode + gcov *.da file name mangling



Hi

I have been trying to use gcov with Xcode to get code coverage data. This is my first time
using gcov or profiling with Xcode.

When using gcov, a profiling version is built, that is run and when the application exits
successfully, all the profiling data is output to a .da file which can then be used by gcov,
as far as I understand it. The problem is that when the profiling data comes to be output
in my application, it cannot find the .da files. It seems that the name of the file has been
mangled a bit by being prefixed with the Xcode project path (The program is running unit
tests and runs fine until it comes to writing profiling data).

So, after running the unit test executable, just before it exits, there is one error like this
for every source file in my project:

"arc profiling: Can't open output file /Users/user/MyProject//Users/user/MyProject/build/
MyProject.build/Test.build/Objects-profile/ppc/TestMyProject.da."

the path it is should be using is /Users/user/MyProject/build/MyProject.build/Test.build/
Objects-profile/ppc/TestMyProject.da.

- Something is prefixing the file name with the project directory.

grepping the objects in the project shows that they all contain this prefixed path.

I gather that the profiling code reads some pathnames out of the object files.

- Does Xcode have some setting that controls these pathnames?
- I guess Xcode is known to work ok with gcov?
- is there some workaround I could try on gcov?

I am not so interested in solving the bug, I just want the data to prove the unit tests are
covering everything.

- Is there another way to get decent line | branch coverage data?
also,
- is there a way to get hair back into a scalp?

Other info:
Mac OS X 10.3.7
Xcode 1.5
gcov (GCC) 3.3 20030304 (Apple Computer, Inc. build 1666)
Building a Cocoa framework
running unit testing target executable from the build directory of the project.

Relevant? build style settings:

Dev build products path: (nothing)
Dev intermediates path: (nothing)
Header search path: (nothing)
lib search path: (nothing)
framework search path: (nothing)
Build Variants: normal profile
Generate Profiling Code: Yes
Library Style: Dynamic
No prebinding or zero linking
optimization: none [-O0]
Generate Debug Symbols: Yes (full symbols)
Other Warning Flags -fprofile-arcs -ftest-coverage   <- odd I know, did it to make sure of
profiling

Maybe it is something to do with the 666 in the gcov build number?

Mike Amy


____________________________________________________________________
eKit - the global phonecard with more!

Spend less on overseas calls, receive messages worldwide.
Visit http://www.ekit.com/ for details.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.