Git Product home page Git Product logo

ggcov's Introduction

This is a simple GUI for browsing C test coverage data gathered
by programs instrumented with "gcc -fprofile-arcs -ftest-coverage".
Hence it's a graphical replacement for the "gcov" program that
comes with gcc.

I wrote this program because I was sick of crappy text mode coverage
results, having been spoilt some years earlier by the PureCoverage GUI.

To use ggcov, invoke it with one or more .c filenames.  It will
find and read the .bb, .bbg, and .da files in the same directory as
the .c files, and display data for you.  You can also invoke ggcov
with a directory name; ggcov will apply itself to all the .c files
in that directory.  Finally, you can mix multiple directories and
.c file names.

GGcov has three windows:

Summary
    presents a test coverage summary at one of four scopes: overall,
    file, function, or range of lines in a file.  Note that the
    range of lines can span function boundaries.
    
Function List
    presents a list of all functions in the covered files, with their
    coverage statistics.  The list can be sorted by line coverage,
    call coverage and branch coverage.
    
Source
    presents the source of a covered file, annotated with source line
    numbers and source line execution counts.  Lines can be colour
    coded according to whether they have been covered.
    

Limitations
-----------

The gcc+ggcov system has several limitations and gotches of which you
should be aware.

*   Gcc will add enough instrumentation to .bbg files for ggcov to
    tell that certain arcs between basic blocks are actually calls
    to other functions, but there isn't enough information to tell
    *which* other functions are being called, even when this is
    known at compile time.  Ggcov attempts to extract this information
    after the fact by scanning the code in object files and correlating
    that with the .bbg files.  This process can fail for several
    reasons, which will result in the data in the Call Graph and Call
    Butterfly windows being absent or incomplete, and the data in the
    Calls window not having the function names.  Reasons for the include:
    
    x	gcc 2.96 on RedHat 7.3 is buggy and doesn't write the necessary
    	information to the .bbg file (note that gcov on RH 7.3 cannot
	correctly report call stats either).
	
    x	the object files are missing
    
    x	the object files are for an architecture which is not yet
    	supported by ggcov for the purposes of this feature (at time
	of writing, only x86 on Linux is supported).
	
    x	calls through function pointers or C++ virtual functions
    	are not known at compile time and cannot be calculated
	using the data available to ggcov.

*   Ggcov does not handle non-local flow transfer (such as setjmp()
    or C++ exceptions) well.  With the compilers I've been able to
    test, neither does gcov.

*   Code which puts multiple basic blocks on a line may not give the
    line coverage numbers you expect.  In particular, when an entire
    loop is squashed into a single line, ggcov will report the number
    of times the loop ran plus one for each time the loop started,
    instead of the number of times the line as a whole ran.

*   The Call Graph window uses a very primitive graph layout algorithm
    and may well loop or crash when given used on some programs.
    
*   The .da file is written by the instrumented program at two times
    only: just before fork() and just after exit().  If your instrumented
    program does neither (e.g. a long running server or a program that
    terminates on a signal), it's counts will be lost.


Greg Banks <[email protected]>
2 July 2003.

ggcov's People

Contributors

gnb avatar jserv avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.