Giter VIP home page Giter VIP logo

embedded-gcov's Introduction

GCC/gcov code coverage data extraction from the actual embedded system, without requiring a file system, or an operating system, or standard C libraries.

See the PDF slide file in the repo for an overview, and see the github wiki for more information about customization options for your embedded system. Also see the simple Linux-compilable example in the repo.

Embedded gcov: Insert in your code

#include "gcov_public.h"
…
        // want this as early as possible,
        // but cannot call this until after
        // the trap table and system stuff are set up
        // may not be needed in all systems, depending on startup code
        __gcov_call_constructors();
…
                                case 9: // a command in my system
                                        __gcov_exit(); // dumps the data
                                        break;
…

Add the embedded gcov source files gcov_public.c and gcov_gcc.c to your build.

You likely want a separate gcov build target, with preprocessor flags.

May need a separate linker file for gnu ld, defining symbols for __gcov_call_constructors().

Then compile with gcc and usual coverage flags -ftest-coverage -fprofile-arcs

embedded-gcov's People

Contributors

kenpetersjpl 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.