http://llvm.org/bugs/show_bug.cgi?id=16893

            Bug ID: 16893
           Summary: __gcov_flush does not flush dynamically loaded
                    libraries
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Miscellaneous Instrumentation passes
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Created attachment 11037
  --> http://llvm.org/bugs/attachment.cgi?id=11037&action=edit
A simple example that shows the problem, use `make cov`

Calling __gcov_flush() does not flush coverage in dynamically loaded libraries.

Even if the bundle calls __gcov_flush() from a function inside the loaded
bundle it does not flush the coverage of the bundle. 

I have a simple example I can attach but to summarize:


cat bundledobject.m
…
@implementation MyBundledObject
- (void)doSomething {
    NSLog(@"Someone called [- MyBundledObject doSomething]");
    __gcov_flush();
}
@end
…

cat main.m
…
int main() {
…
  Class exampleClass = [bundle classNamed:@"MyBundledObject"];
  id newInstance = [[exampleClass alloc] init];
  [newInstance doSomething];
  __gcov_flush();
  int *i = 0;
  *i = 2; // Causes a seg fault to prevent normal __gcov_flush's from happening
…


The resulting gcda files will have no data for any object loaded from the
bundle. 

If this is not the correct way to flush the coverage buffers in loaded
libraries, please let me know.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to