BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
cov.h
Go to the documentation of this file.
1/*
2 * cov.h - function coverage of an m68k program built with
3 * -finstrument-functions-once (the coverage configuration, preset
4 * amiga-cov; openspec change test-coverage, D2 and D3).
5 *
6 * The compiler calls __cyg_profile_func_enter at the first entry of every
7 * instrumented function; the hook sets the function's bit in a bitmap over
8 * the code hunk (one bit per 2-byte offset, covfmt.h). At the program's
9 * end the bitmap is OR-ed into TEST:cov/<program>.cov.
10 *
11 * With libnix's startup code nothing has to be called: cov.c puts
12 * cov_start into libnix's constructor list and cov_write into its
13 * destructor list, which libnix runs when main returns and on exit().
14 *
15 * cov.c is compiled with the program's own options (-fbaserel) but not
16 * instrumented, and so are the entry stubs that load a4 (glue*.c): the hook
17 * addresses its globals relative to a4. COV_PROGRAM (a string) names the
18 * file, e.g. "blitz2" for TEST:cov/blitz2.cov.
19 */
20#ifndef SHARED_COV_COV_H
21#define SHARED_COV_COV_H
22
23/* allocate the bitmap (the size of the code hunk); before it, the hook
24 records nothing */
25void cov_start(void);
26
27/* OR the bitmap into TEST:cov/<COV_PROGRAM>.cov and free it. Without
28 TEST:cov nothing is written and no requester shows; errors are ignored. */
29void cov_write(void);
30
31/* the hooks of -finstrument-functions(-once) */
32void __cyg_profile_func_enter(void *fn, void *site);
33void __cyg_profile_func_exit(void *fn, void *site);
34
35#endif
void cov_start(void)
Definition cov.c:52
void __cyg_profile_func_enter(void *fn, void *site)
Definition cov.c:35
void __cyg_profile_func_exit(void *fn, void *site)
Definition cov.c:46
void cov_write(void)
Definition cov.c:107